/* ==========================================================================
   css/modern.css — שכבת העיצוב המודרני + מגירת העגלה
   נטען אחרי css/store.css (includes/layout.php), כך ש-store.css המקורי בשרת נשאר כמו שהוא.
   מקור: deadseashoping-modern-upgrade.zip (החלק שמתחיל ב-"MODERN LUXURY DESIGN UPGRADE").
   ========================================================================== */

/* ==========================================================================
   DEAD SEA SHOPING — MODERN LUXURY DESIGN UPGRADE (2026)
   Drop-in visual refresh + Modern Product Cards + Slide-Out Cart Drawer
   ========================================================================== */

:root {
  --deep:       #0b3446;
  --teal:       #166374;
  --aqua:       #d8ecee;
  --sand:       #ebe0ce;
  --sand-lt:    #faf8f4;
  --surface:    #ffffff;
  --gold:       #c8a24a;
  --gold-dk:    #9e7b28;
  --ink:        #162329;
  --muted:      #5c727c;
  --line:       rgba(11, 52, 70, 0.09);
  --line-strong:rgba(11, 52, 70, 0.16);
  --radius:     16px;
  --radius-sm:  10px;
  --shadow:     0 8px 28px rgba(11, 52, 70, 0.07);
  --shadow-lg:  0 20px 54px rgba(11, 52, 70, 0.14);
  --maxw:       1320px;
  --ease-lux:   cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  background: var(--sand-lt);
  color: var(--ink);
  letter-spacing: -0.005em;
}

.container {
  max-width: var(--maxw);
}

/* ── Modern Glass Header ─────────────────────────────────────────────────── */
.site-header, header.header {
  background: rgba(255, 255, 255, 0.86) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(11, 52, 70, 0.04);
}

/* ── Refined Luxury Buttons ──────────────────────────────────────────────── */
.btn {
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.22s var(--ease-lux), box-shadow 0.25s var(--ease-lux), background 0.22s ease, border-color 0.22s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #0b3446 0%, #145466 100%);
  box-shadow: 0 6px 18px rgba(11, 52, 70, 0.18);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #145466 0%, #1b6d80 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(11, 52, 70, 0.24);
}
.btn-gold {
  background: linear-gradient(135deg, #d4af55 0%, #bd953a 100%);
  color: #1f1702;
  box-shadow: 0 5px 14px rgba(200, 162, 74, 0.25);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #c69f44 0%, #a58029 100%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 9px 22px rgba(158, 123, 40, 0.30);
}

/* ── Section Polish ──────────────────────────────────────────────────────── */
.section-sand {
  background: linear-gradient(180deg, #f4eee3 0%, #faf8f4 100%);
}
.section-head h2 {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--deep);
}

/* ── Modern Luxury Product Grid & Cards ──────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 26px;
}

.product-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(11, 52, 70, 0.03);
  transition: transform 0.32s var(--ease-lux), box-shadow 0.32s var(--ease-lux), border-color 0.25s ease;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(200, 162, 74, 0.42);
}

/* Clean 1:1 Studio Thumbnail */
.product-thumb {
  aspect-ratio: 1 / 1;
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #f5f1e9 100%);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.product-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain !important;   /* !important — בכרטיס יש style="object-fit:cover" בתוך התגית */
  background: #fff;
  object-position: center;
  transition: transform 0.55s var(--ease-lux);
}
.product-card:hover .product-thumb img {
  transform: scale(1.06);
}

/* Subtle bottom vignette on hover */
.product-thumb::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 36%;
  background: linear-gradient(to top, rgba(11, 52, 70, 0.14), transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.product-card:hover .product-thumb::after {
  opacity: 1;
}

/* Refined Badge Styling (safe with inline-styled badges too) */
.product-thumb .tag {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 4;
  background: rgba(11, 52, 70, 0.88);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 10px rgba(11, 52, 70, 0.18);
}

/* Wishlist Heart Button (injected automatically by cart-drawer.js or PHP) */
.ds-wish-btn {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(11, 52, 70, 0.08);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(11, 52, 70, 0.08);
  transition: transform 0.2s var(--ease-lux), color 0.2s ease, background 0.2s ease;
}
.ds-wish-btn:hover {
  transform: scale(1.1);
  color: #e11d48;
  background: #fff;
}
.ds-wish-btn.is-active {
  color: #e11d48;
  background: #fff0f3;
  border-color: rgba(225, 29, 72, 0.22);
}

/* Card Body */
.product-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.p-cat {
  font-size: 0.7rem;
  color: var(--gold-dk);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.product-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.76em;
}
.product-body h3 a {
  transition: color 0.2s ease;
}
.product-body h3 a:hover {
  color: var(--teal);
}
.p-desc {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.48;
  margin-top: 2px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Card Footer — Price + Action */
.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 1.16rem;
  font-weight: 800;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
}
.price .old {
  font-size: 0.8rem;
  color: #94a3b8;
  text-decoration: line-through;
  font-weight: 500;
  margin-inline-start: 0;
}
.product-foot .btn-sm {
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}

/* Mobile 2-column compact luxury grid */
@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .product-body {
    padding: 12px 12px 14px;
    gap: 4px;
  }
  .product-body h3 {
    font-size: 0.88rem;
    min-height: 2.6em;
  }
  .p-desc {
    display: none;
  }
  .product-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 10px;
  }
  .product-foot .btn-sm {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.8rem;
  }
  .price {
    font-size: 1.02rem;
  }
}

/* ==========================================================================
   SLIDE-OUT CART DRAWER (.ds-drawer)
   ========================================================================== */
.ds-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(11, 30, 40, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.ds-drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.ds-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  z-index: 9999;
  width: min(440px, 100vw);
  background: #ffffff;
  box-shadow: -12px 0 44px rgba(11, 52, 70, 0.22);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.36s var(--ease-lux);
}
[dir="rtl"] .ds-drawer {
  transform: translateX(-100%);
  box-shadow: 12px 0 44px rgba(11, 52, 70, 0.22);
}
.ds-drawer.is-open {
  transform: translateX(0) !important;
}

/* Drawer Header */
.ds-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.ds-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--deep);
}
.ds-drawer-count {
  background: var(--sand);
  color: var(--deep);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
}
.ds-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--sand-lt);
  color: var(--deep);
  font-size: 1.15rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.ds-drawer-close:hover {
  background: var(--deep);
  color: #fff;
  transform: rotate(90deg);
}

/* Shipping Progress Strip */
.ds-drawer-ship {
  padding: 12px 22px;
  background: linear-gradient(135deg, #f8f4ec 0%, #eff6f7 100%);
  border-bottom: 1px solid var(--line);
}
.ds-ship-text {
  font-size: 0.84rem;
  color: var(--deep);
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ds-ship-text strong {
  color: var(--teal);
  font-weight: 800;
}
.ds-ship-bar {
  height: 7px;
  background: rgba(11, 52, 70, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.ds-ship-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  border-radius: 999px;
  transition: width 0.45s var(--ease-lux);
}
.ds-ship-fill.is-done {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

/* Scrollable Drawer Body */
.ds-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ds-drawer-empty {
  text-align: center;
  padding: 46px 16px;
  color: var(--muted);
}
.ds-drawer-empty-ico {
  font-size: 3rem;
  margin-bottom: 10px;
  opacity: 0.7;
}
.ds-drawer-empty h4 {
  color: var(--deep);
  font-size: 1.05rem;
  margin-bottom: 6px;
}

/* Drawer Item Row */
.ds-d-item {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 14px;
  padding: 12px;
  background: var(--sand-lt);
  border: 1px solid var(--line);
  border-radius: 14px;
  align-items: center;
  transition: border-color 0.2s ease;
}
.ds-d-item:hover {
  border-color: var(--line-strong);
}
.ds-d-thumb {
  width: 74px;
  height: 74px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 1.8rem;
}
.ds-d-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ds-d-info {
  min-width: 0;
}
.ds-d-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ds-d-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.ds-d-price {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
}
.ds-d-qty {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
}
.ds-d-qty button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--deep);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.ds-d-qty button:hover {
  background: var(--sand-lt);
}
.ds-d-qty span {
  min-width: 24px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.ds-d-rm {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s ease;
}
.ds-d-rm:hover {
  color: #e11d48;
}

/* Upsell Strip inside Drawer */
.ds-drawer-upsell {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}
.ds-upsell-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--deep);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ds-upsell-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ds-upsell-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}
.ds-upsell-card img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
}
.ds-upsell-info {
  flex: 1;
  min-width: 0;
}
.ds-upsell-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-upsell-price {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--teal);
}
.ds-upsell-add {
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--deep);
  background: transparent;
  color: var(--deep);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.ds-upsell-add:hover {
  background: var(--deep);
  color: #fff;
}

/* Drawer Footer */
.ds-drawer-foot {
  padding: 16px 22px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 -8px 24px rgba(11, 52, 70, 0.05);
}
.ds-d-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ds-d-subrow span:first-child {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 600;
}
.ds-d-subtotal {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
}
.ds-d-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}
.ds-d-actions .btn {
  padding: 12px 14px;
  font-size: 0.9rem;
}

/* ── תוספות: סכומים במגירה, אזור בטוח באייפון, הסתרת פס משלוח ── */
.ds-drawer-ship[hidden] { display: none !important; }
.ds-d-sums { margin-bottom: 12px; }
.ds-d-sums .ds-d-subrow { margin-bottom: 6px; }
.ds-d-subrow span:last-child { font-weight: 800; color: var(--deep); font-variant-numeric: tabular-nums; }
.ds-d-disc span, .ds-d-disc span:first-child { color: #16a34a !important; font-weight: 700; }
.ds-d-total { padding-top: 6px; border-top: 1px dashed var(--line-strong); }
.ds-drawer-foot { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.ds-drawer-body .ds-drawer-empty { padding: 30px 10px; }
