/* ═══════════════════════════════════════════════
   MODALS & CART — Refined Editorial Style
═══════════════════════════════════════════════ */

/* ── OVERLAYS ── */
.modal-overlay,
.cart-panel-overlay {
  position: fixed; 
  inset: 0; 
  z-index: 2000;
  background: rgba(10, 9, 7, 0.85);
  backdrop-filter: blur(12px);
  display: flex; 
  align-items: center; 
  justify-content: center;
  padding: 24px; 
  opacity: 0; 
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.open,
.cart-panel-overlay.open { 
  opacity: 1; 
  pointer-events: all; 
}

/* ── MODAL BOX ── */
.modal {
  background: #ffffff;
  padding: 0;
  max-width: 500px; 
  width: 100%; 
  position: relative;
  transform: translateY(24px) scale(0.98);
  opacity: 0;
  transition: 
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  will-change: transform, opacity;
}
.modal-overlay.open .modal { 
  transform: translateY(0) scale(1); 
  opacity: 1;
}

/* Modal image section */
.modal__image {
  width: 100%;
  height: 240px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.2) 100%);
  flex-shrink: 0;
}

.modal__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: 
    filter 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  filter: saturate(0.85) brightness(1.01);
}

.modal-overlay.open .modal__image img {
  animation: imageReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes imageReveal {
  from {
    filter: saturate(0.6) brightness(0.95);
    transform: scale(1.08);
  }
  to {
    filter: saturate(0.85) brightness(1.01);
    transform: scale(1);
  }
}

/* Organic texture for modal image */
.modal__image::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(200, 220, 200, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(46, 107, 69, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

/* Shine effect on modal image */
.modal__image::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 70%;
  height: 100%;
  background: linear-gradient(
    110deg,
    transparent 15%,
    rgba(255, 255, 255, 0.2) 45%,
    rgba(255, 255, 255, 0.08) 55%,
    transparent 85%
  );
  transform: skewX(-12deg);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.modal-overlay.open .modal__image::after {
  animation: imageShine 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
}

@keyframes imageShine {
  0% { left: -100%; opacity: 0; }
  50% { opacity: 1; }
  100% { left: 120%; opacity: 0; }
}

/* Modal content section */
.modal__content {
  padding: 52px;
  flex: 1;
  overflow-y: auto;
}

.modal__close {
  position: absolute; 
  top: 24px; 
  right: 24px; 
  z-index: 10;
  width: 40px; 
  height: 40px; 
  border: none;
  background: transparent; 
  color: var(--text-3); 
  cursor: pointer;
  font-size: 20px; 
  font-weight: 300;
  display: flex; 
  align-items: center; 
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 44px;
  min-width: 44px;
  border-radius: 8px;
}
.modal__close:hover { 
  color: var(--black); 
  background: rgba(0, 0, 0, 0.04);
  transform: scale(1.1) rotate(90deg);
}

/* Typography */
.modal__title {
  font-family: 'Cormorant Garant', serif;
  font-size: 34px; 
  font-weight: 400; 
  color: var(--text);
  margin-bottom: 12px; 
  text-align: center;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.modal__subtitle {
  font-size: 13px; 
  color: var(--text-3);
  margin-bottom: 36px; 
  text-align: center;
  line-height: 1.6;
}
.modal__subtitle strong { 
  color: var(--green); 
  font-weight: 600; 
}

/* Forms in Modals */
.modal-form { 
  display: flex; 
  flex-direction: column; 
  gap: 18px; 
}
.modal-form .form-group { 
  margin-bottom: 0; 
}
.modal-form button[type="submit"] {
  margin-top: 8px;
  background: linear-gradient(135deg, var(--black) 0%, rgba(26, 24, 20, 0.95) 100%);
  color: var(--cream);
  border: none; 
  padding: 13px;
  font-size: 11px; 
  font-weight: 700; 
  letter-spacing: 1.6px;
  text-transform: uppercase; 
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 8px;
  min-height: 46px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(10, 9, 7, 0.12);
}
.modal-form button[type="submit"]::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--green);
  transform: translateY(101%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}
.modal-form button[type="submit"] span,
.modal-form button[type="submit"]:not(:has(span)) {
  position: relative;
  z-index: 1;
}
.modal-form button[type="submit"]:hover { 
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(10, 9, 7, 0.18);
}
.modal-form button[type="submit"]:hover::before {
  transform: translateY(0);
}

/* Success State */
.modal__success { 
  text-align: center; 
  padding: 32px 0; 
  animation: fadeIn 0.5s ease 0.2s both;
}
.modal__success-icon {
  width: 56px; 
  height: 56px; 
  margin: 0 auto 28px;
  border: 2px solid var(--green);
  border-radius: 50%;
  display: flex; 
  align-items: center; 
  justify-content: center;
  position: relative;
  animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal__success-icon::after {
  content: '';
  width: 16px; 
  height: 9px;
  border-bottom: 2px solid var(--green);
  border-left: 2px solid var(--green);
  transform: rotate(-45deg) translateY(-1px);
}
.modal__success p { 
  font-size: 14px; 
  color: var(--text-2); 
  line-height: 1.8;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── CART PANEL ── */
.cart-panel-overlay {
  align-items: stretch; 
  justify-content: flex-end; 
  padding: 0;
}

.cart-panel {
  width: 420px; 
  max-width: 100%;
  background: #ffffff;
  display: flex; 
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 
    -20px 0 60px rgba(0, 0, 0, 0.12),
    inset -1px 0 0 rgba(255, 255, 255, 0.4);
}
.cart-panel-overlay.open .cart-panel { 
  transform: translateX(0); 
}

.cart-panel__header {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 32px 32px 24px; 
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, transparent 100%);
}

.cart-panel__header h3 {
  font-family: 'Cormorant Garant', serif;
  font-size: 26px; 
  font-weight: 400; 
  color: var(--text);
  letter-spacing: -0.5px;
  margin: 0;
}

.cart-panel__header .modal__close {
  position: static; 
  width: auto; 
  height: auto;
  top: auto;
  right: auto;
}

.cart-panel__empty {
  padding: 60px 32px; 
  text-align: center; 
  color: var(--text-3);
  font-size: 13px; 
  line-height: 1.8;
}

.cart-panel__list {
  flex: 1; 
  overflow-y: auto; 
  padding: 24px 32px;
  display: flex; 
  flex-direction: column; 
  gap: 16px;
}

.cart-item {
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 16px;
  padding-bottom: 16px; 
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}
.cart-item:hover {
  transform: translateX(-4px);
}

.cart-item__info { 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
}

.cart-item__info strong { 
  font-size: 14px; 
  font-weight: 600; 
  color: var(--text); 
  line-height: 1.3;
}

.cart-item__info span { 
  font-size: 11px; 
  color: var(--text-3); 
  text-transform: uppercase; 
  letter-spacing: 0.8px; 
}

.cart-item__status {
  font-size: 8px; 
  font-weight: 700;
  text-transform: uppercase; 
  letter-spacing: 1.2px;
  padding: 6px 12px; 
  border-radius: 6px;
  white-space: nowrap; 
  flex-shrink: 0;
  border: 1px solid transparent;
  min-height: 28px;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

/* Status color variants — updated by admin */
.cart-status--new {
  color: #b57d00; 
  background: rgba(181, 125, 0, 0.1);
  border-color: rgba(181, 125, 0, 0.3);
}
.cart-status--new:hover {
  background: rgba(181, 125, 0, 0.15);
  border-color: rgba(181, 125, 0, 0.4);
}

.cart-status--processing {
  color: #2563eb; 
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
}
.cart-status--processing:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.4);
}

.cart-status--done {
  color: var(--green); 
  background: rgba(100, 160, 80, 0.1);
  border-color: rgba(100, 160, 80, 0.35);
}
.cart-status--done:hover {
  background: rgba(100, 160, 80, 0.15);
  border-color: rgba(100, 160, 80, 0.45);
}

.cart-panel__footer { 
  padding: 32px; 
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.8) 100%);
}

.cart-panel__footer .btn {
  background: linear-gradient(135deg, var(--black) 0%, rgba(26, 24, 20, 0.95) 100%);
  color: var(--cream);
  padding: 13px 0; 
  font-size: 11px; 
  font-weight: 700;
  letter-spacing: 1.6px;
  width: 100%; 
  border: none; 
  text-transform: uppercase; 
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center; 
  display: block;
  min-height: 46px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(10, 9, 7, 0.12);
}

.cart-panel__footer .btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--green);
  transform: translateY(101%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 0;
}

.cart-panel__footer .btn span,
.cart-panel__footer .btn:not(:has(span)) {
  position: relative;
  z-index: 1;
}

.cart-panel__footer .btn:hover { 
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(10, 9, 7, 0.18);
}

.cart-panel__footer .btn:hover::before {
  transform: translateY(0);
}

/* ── PRODUCT DETAIL MODAL ──
   Compact single-column modal for detailed product info.
   Text-focused without product photo. */
.modal--detail {
  max-width: 440px; 
  width: 100%; 
  padding: 0;
  display: flex; 
  flex-direction: column;
  max-height: 88vh;
  overflow: hidden;
  border-radius: 16px;
}

/* Product image at top of modal */
.detail-visual {
  height: 280px;
  width: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0.2) 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  border-radius: 16px 16px 0 0;
}

.detail-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: 
    filter 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  filter: saturate(0.85) brightness(1.01);
}

.modal-overlay.open .detail-visual img {
  animation: imageReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes imageReveal {
  from {
    opacity: 0;
    transform: scale(1.05);
    filter: saturate(0.6) brightness(1.1);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: saturate(0.85) brightness(1.01);
  }
}

.detail-body {
  padding: 28px 28px 32px;
  flex: 1; 
  min-height: 0;
  display: flex; 
  flex-direction: column;
  overflow-y: auto;
}

.detail-header { 
  margin-bottom: 16px; 
  text-align: center;
  animation: fadeIn 0.5s ease 0.1s both;
}

.detail-header .product-card__cat {
  font-size: 9px; 
  font-weight: 700; 
  letter-spacing: 2.2px;
  text-transform: uppercase; 
  color: var(--green); 
  display: block; 
  margin-bottom: 10px;
}

.detail-title {
  font-family: 'Cormorant Garant', serif; 
  font-size: 28px;
  font-weight: 400; 
  color: var(--text); 
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.detail-desc {
  font-size: 13.5px; 
  color: var(--text-2); 
  line-height: 1.75;
  text-align: center; 
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  animation: fadeIn 0.5s ease 0.15s both;
}

/* Variants */
.detail-variants {
  display: flex; 
  gap: 7px; 
  flex-wrap: wrap; 
  justify-content: center; 
  margin-bottom: 20px;
  animation: fadeIn 0.5s ease 0.2s both;
}

.detail-variant-tag {
  padding: 5px 11px; 
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 10px; 
  font-weight: 500;
  color: var(--text-3); 
  background: rgba(245, 245, 242, 0.6);
  border-radius: 6px;
  min-height: 28px;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  cursor: default;
}
.detail-variant-tag:hover {
  background: rgba(46, 107, 69, 0.08);
  border-color: rgba(46, 107, 69, 0.25);
  color: var(--green);
}

/* All info at once — stacked sections */
.detail-sections {
  display: flex; 
  flex-direction: column; 
  gap: 18px;
}

.detail-section {
  padding-top: 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  animation: fadeIn 0.5s ease;
}

.detail-section:first-child {
  padding-top: 0;
  border-top: none;
}

.detail-section__title {
  font-size: 10px; 
  font-weight: 700; 
  letter-spacing: 2.2px;
  text-transform: uppercase; 
  color: var(--green);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section__title::before {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--green);
}

.detail-section__body { 
  animation: fadeIn 0.4s ease;
}

.detail-benefits { 
  display: flex; 
  flex-direction: column; 
  gap: 10px; 
}

.detail-benefit-item {
  display: flex; 
  align-items: flex-start; 
  gap: 11px;
  font-size: 13px; 
  color: var(--text-2); 
  line-height: 1.6;
}

.detail-benefit-item::before {
  content: '—'; 
  color: var(--green); 
  font-weight: 400; 
  flex-shrink: 0;
  font-size: 14px;
}

.detail-composition {
  font-size: 13px; 
  color: var(--text-2); 
  line-height: 1.8;
}

.detail-storage { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
}

.detail-storage-item { 
  border-left: 3px solid var(--green); 
  padding-left: 12px;
  transition: all 0.3s ease;
}
.detail-storage-item:hover {
  padding-left: 14px;
}

.detail-storage-item strong {
  display: block; 
  font-size: 9px; 
  text-transform: uppercase;
  letter-spacing: 1.6px; 
  color: var(--green); 
  margin-bottom: 4px;
  font-weight: 700;
}

.detail-storage-item span { 
  font-size: 13px; 
  color: var(--text); 
  line-height: 1.6;
}

/* ════════════════════════════════════════════════
   MOBILE ADJUSTMENTS
════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .modal {
    padding: 44px 32px;
    max-width: 90vw;
    border-radius: 14px;
  }
  
  .modal__close {
    width: 40px;
    height: 40px;
  }

  .detail-visual {
    height: 260px;
  }

  /* Cart panel on tablet */
  .cart-panel {
    width: 90vw;
    max-width: 480px;
    border-radius: 0;
    border-left: none;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
  }
}

@media (max-width: 600px) {
  .modal { 
    padding: 36px 28px;
    max-width: 100%;
    margin: 20px;
    border-radius: 12px;
    max-height: 85vh;
  }
  
  .modal__title {
    font-size: 26px;
    margin-bottom: 10px;
  }
  
  .modal__subtitle {
    font-size: 12px;
    margin-bottom: 28px;
  }

  .modal--detail {
    max-width: 100%;
    margin: 0;
    border-radius: 12px;
  }

  .detail-visual {
    height: 240px;
  }

  /* Cart panel on mobile */
  .cart-panel { 
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .cart-panel__header {
    padding: 28px 24px 20px;
  }
  
  .cart-panel__header h3 {
    font-size: 22px;
  }
  
  .cart-panel__list {
    padding: 18px 24px;
  }
  
  .cart-panel__footer {
    padding: 28px 24px;
  }
  
  .cart-panel__empty {
    padding: 48px 24px;
    font-size: 12px;
  }

  .detail-visual {
    height: 220px;
  }

  .detail-body { 
    padding: 24px 24px 28px;
  }
  
  .detail-title { 
    font-size: 24px;
  }
  
  .detail-header {
    margin-bottom: 14px;
  }

  .detail-desc {
    font-size: 12px;
    margin-bottom: 18px;
    padding-bottom: 18px;
  }

  .detail-variants {
    margin-bottom: 18px;
    gap: 6px;
  }

  .detail-sections {
    gap: 14px;
  }

  .detail-section {
    padding-top: 14px;
  }
}

@media (max-width: 480px) {
  .modal { 
    padding: 32px 24px;
    margin: 16px;
    border-radius: 12px;
  }
  
  .modal__close {
    width: 36px;
    height: 36px;
    top: 16px;
    right: 16px;
    font-size: 18px;
  }

  .modal__title {
    font-size: 22px;
  }

  .modal__subtitle {
    font-size: 11px;
  }

  .modal-form {
    gap: 14px;
  }

  .modal--detail {
    border-radius: 12px;
  }

  .detail-visual {
    height: 200px;
    border-radius: 12px 12px 0 0;
  }

  .detail-body { 
    padding: 22px 20px 24px;
  }
  
  .detail-title { 
    font-size: 20px;
  }
  
  .detail-header {
    margin-bottom: 12px;
  }

  .detail-header .product-card__cat {
    font-size: 8px;
    margin-bottom: 8px;
  }

  .detail-desc {
    font-size: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
  }

  .detail-variant-tag {
    font-size: 9px;
    padding: 4px 9px;
  }

  .detail-benefits {
    gap: 9px;
  }

  .detail-benefit-item {
    font-size: 12px;
    gap: 10px;
  }

  .detail-composition {
    font-size: 12px;
  }

  .detail-storage-item {
    padding-left: 10px;
  }

  .detail-storage-item:hover {
    padding-left: 10px;
  }

  .detail-storage-item strong {
    font-size: 8px;
  }

  .detail-storage-item span {
    font-size: 12px;
  }

  .cart-panel__header {
    padding: 22px 20px 16px;
  }

  .cart-panel__header h3 {
    font-size: 20px;
  }

  .cart-panel__list {
    padding: 14px 20px;
  }

  .cart-panel__footer {
    padding: 22px 20px;
  }

  .cart-item__status {
    font-size: 8px;
    padding: 5px 9px;
    min-height: 26px;
  }
}

@media (max-width: 360px) {
  .modal {
    padding: 28px 20px;
    margin: 12px;
    border-radius: 10px;
  }

  .modal__title {
    font-size: 20px;
  }

  .modal__close {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .detail-visual {
    height: 180px;
  }

  .detail-title {
    font-size: 18px;
  }

  .detail-body {
    padding: 20px 16px 20px;
  }

  .detail-sections {
    gap: 12px;
  }

  .detail-benefit-item {
    font-size: 11px;
    gap: 8px;
  }
}
