.portfolio-section {
  width: 100%;
  padding: clamp(10px, 2vh, 30px);
  display: flex;
  justify-content: center;
}

.portfolio-modal-content::-webkit-scrollbar {
  width: 3px;
}

.portfolio-modal-content::-webkit-scrollbar-thumb {
  background: #c7a46a;
  border-radius: 30px;
}

.portfolio-modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.portfolio-cover {
  width: min(1400px, 90%);
  height: 700px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 20px;
}

.portfolio-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px);
  transform: scale(1.05);
  transition: 0.4s;
}

.portfolio-cover:hover img {
  transform: scale(1.1);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  background: rgba(0, 0, 0, 0.35);
  transition: 0.3s;
}

.portfolio-overlay h2 {
  font-size: 60px;
}

.portfolio-overlay p {
  margin-top: 15px;

  font-size: 20px;
}

.portfolio-cover:hover .portfolio-overlay {
  background: rgba(0, 0, 0, 0.2);
}
/* ===========================
   Модальное окно портфолио
=========================== */

.portfolio-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  z-index: 9999;
}

.portfolio-modal.active {
  opacity: 1;

  visibility: visible;
}

.portfolio-modal-content {
  width: 82vw;
  max-height: 76vh;
  overflow-y: auto;
  background: #111;
  border-radius: 20px;
  padding: 25px;
  position: relative;
  border-right: 12px solid transparent;
}

.portfolio-close {
  position: fixed;
  right: 35px;
  top: 35px;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: #c7a46a;
  color: white;
  z-index: 20;
  font-size: 34px;
  align-items: center;
  display: flex;
  justify-content: center;
}

#portfolioGrid {
  width: 100%;
}

.portfolio-item {
  width: calc(25% - 14px);
  margin-bottom: 18px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}

.portfolio-item img {
  width: 100%;
  display: block;
  border-radius: 18px;
}

.portfolio-item::after,
.portfolio-item::before {
  display: none;
}

.portfolio-item:hover::after {
  opacity: 1;
}

.portfolio-item:hover img {
  transform: scale(1.03);
}

.portfolio-item:hover::before {
  opacity: 1;
}

.viewer {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  z-index: 99999;
}

.viewer-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(45px) brightness(0.25);
  transform: scale(1.2);
}

#viewerImage {
  max-width: 85vw;
  max-height: 85vh;
  position: relative;
  z-index: 10;
  border-radius: 14px;
}

/* ==========================
      VIEWER
========================== */

.viewer {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: 0.35s;
  z-index: 999999;
  overflow: hidden;
  pointer-events: none;
}

.viewer.active {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

.viewer-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: blur(45px) brightness(0.18);
  transform: scale(1.2);
  transition: 0.4s;
}

.viewer-image {
  position: relative;
  z-index: 5;
  max-width: 85vw;
  max-height: 85vh;
  border-radius: 14px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.55);
  transition: 0.35s;
}

.viewer-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 70px;
  height: 70px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 34px;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  transition: 0.3s;
  z-index: 10;
}

.viewer-btn:hover {
  background: #c7a46a;
}

.viewer-prev {
  left: 40px;
}

.viewer-next {
  right: 40px;
}

.viewer-close {
  position: absolute;
  right: 35px;
  top: 35px;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: #c7a46a;
  color: white;
  z-index: 20;
  font-size: 34px;
  align-items: center;
  display: flex;
  justify-content: center;
}

.viewer-counter {
  position: absolute;
  bottom: 30px;
  color: white;
  font-size: 18px;
  z-index: 20;
}

.portfolio-admin-bar {
  display: none;
  margin-bottom: 30px;
}

.portfolio-admin-bar.active {
  display: flex;
}

#addPortfolioPhoto {
  background: #c7a46a;
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  transition: 0.3s;
}

#addPortfolioPhoto:hover {
  transform: translateY(-2px);
  background: #d3b27b;
}

.portfolio-controls {
  position: absolute;
  top: 10px;
  right: 10px;

  display: flex;
  gap: 8px;

  opacity: 0;
  transition: 0.3s;

  z-index: 10;
}

.portfolio-item:hover .portfolio-controls {
  opacity: 1;
}

.portfolio-controls button {
  width: 38px;
  height: 38px;

  border: none;
  border-radius: 50%;

  cursor: pointer;

  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);

  color: white;

  transition: 0.25s;
}

.portfolio-controls button:hover {
  background: #c7a46a;
  transform: scale(1.08);
}

.undo-notification {
  position: fixed;

  left: 50%;
  bottom: 30px;

  transform: translateX(-50%) translateY(100px);

  display: flex;
  align-items: center;
  gap: 18px;

  background: #1b1b1b;

  color: white;

  padding: 15px 22px;

  border-radius: 14px;

  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);

  transition: 0.35s;

  opacity: 0;

  z-index: 999999;
}

.undo-notification.active {
  transform: translateX(-50%) translateY(0);

  opacity: 1;
}

.undo-notification button {
  border: none;

  background: #c7a46a;

  color: white;

  padding: 8px 16px;

  border-radius: 10px;

  cursor: pointer;

  transition: 0.25s;
}

.undo-notification button:hover {
  transform: translateY(-2px);
}

.portfolio-item.dragging {
  opacity: 0.35;

  transform: scale(0.96);
}
