/* ==========================================================================
   1. FONTS & GLOBAL LAYOUT
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

.shop-layout,
.shop-layout * {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 500 !important;
}

.shop-layout {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 59px);
  margin-top: 59px;
}

@media (max-width: 768px) {
  .shop-layout {
    flex-direction: column;
  }
}

/* ==========================================================================
   2. SIDEBAR: FILTER PANEL WRAPPER
   ========================================================================== */

.shop-sidebar {
  width: 230px;
  min-width: 230px;
  flex-shrink: 0;
  height: calc(100vh - 59px);
  position: sticky;
  top: 59px;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid #e8e8e8;
  background: #fff;
}

@media (max-width: 768px) {
  .shop-sidebar {
    position: fixed;
    left: 0;
    top: 59px;
    width: 70%;
    max-width: 240px;
    height: calc(100vh - 59px);
    z-index: 99;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-right: 1px solid #e8e8e8;
  }
  
  .shop-sidebar.open {
    transform: translateX(0);
  }
}

@media (max-width: 480px) {
  .shop-sidebar {
    width: 100%;
    max-width: 100%;
  }
}
.shop-sidebar::-webkit-scrollbar { width: 0; }

.sb-section {
  padding: 19px 16px;
  border-bottom: 1px solid #f0f0f0;
}
.sb-section:last-child { border-bottom: none; }

.sb-heading {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #0b0909;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   3. FILTER: CUSTOM SORT DROPDOWN
   ========================================================================== */

.sb-select { display: none; }

.custom-select-wrap {
  position: relative;
  width: 100%;
  user-select: none;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 12px;
  color: #111;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.custom-select-trigger:hover,
.custom-select-wrap:hover .custom-select-trigger {
  border-color: #111;
  background: #f0f0f0;
  box-shadow: 0 3px 10px rgba(0,0,0,0.10);
}

.custom-select-trigger.open {
  border-color: #111;
  box-shadow: 0 3px 10px rgba(0,0,0,0.10);
  border-radius: 6px 6px 0 0;
  background: #f0f0f0;
}

.custom-select-arrow {
  width: 9px;
  height: 9px;
  border-right: 2px solid #555;
  border-bottom: 2px solid #555;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
  flex-shrink: 0;
}

.custom-select-trigger.open .custom-select-arrow,
.custom-select-wrap:hover .custom-select-arrow {
  transform: rotate(-135deg) translateY(-2px);
}

.custom-select-options {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #111;
  border-top: none;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 0.45s cubic-bezier(0.4,0,0.2,1),
              opacity 0.35s ease,
              transform 0.4s cubic-bezier(0.4,0,0.2,1);
  z-index: 999;
  pointer-events: none;
}

.custom-select-options.open,
.custom-select-wrap:hover .custom-select-options {
  max-height: 200px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.custom-select-option {
  padding: 9px 12px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, padding-left 0.25s ease;
}

.custom-select-option:hover {
  background: #f3f4f6;
  color: #111;
  padding-left: 16px;
}

.custom-select-option.selected {
  background: #111;
  color: #fff;
}

.custom-select-option.selected:hover {
  background: #333;
  padding-left: 16px;
}

/* ==========================================================================
   4. FILTER: PRICE (INPUTS + RANGE SLIDER)
   ========================================================================== */

.sb-price-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.sb-price-input {
  flex: 1;
  width: 100%;
  padding: 5px 7px;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  font-size: 11px;
  color: #111;
  outline: none;
  box-sizing: border-box;
}
.sb-price-input:focus { border-color: #111; }

.sb-dual-range { position: relative; height: 18px; }

.sb-track {
  position: absolute;
  top: 8px; left: 0; right: 0;
  height: 3px;
  background: #e5e7eb;
  border-radius: 999px;
}

.sb-fill {
  position: absolute;
  height: 3px;
  background: #111;
  border-radius: 999px;
}

.sb-range-input {
  position: absolute;
  top: 8px;
  width: 100%;
  height: 3px;
  background: transparent;
  appearance: none;
  outline: none;
  pointer-events: none;
}
.sb-range-input::-webkit-slider-thumb {
  appearance: none;
  width: 15px; height: 15px;
  background: #fff;
  border: 2px solid #111;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.sb-range-input::-webkit-slider-thumb:hover { transform: scale(1.15); }

/* ==========================================================================
   5. FILTER: COLOR DOTS + COLOR CHIPS
   ========================================================================== */

.sb-color-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.sb-dot {
  width: 26px; height: 26px;
  flex-shrink: 0;
  border-radius: 5px;
  border: 2px solid transparent;
  outline: 2.5px solid transparent;
  outline-offset: 2px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.15s, outline 0.15s;
}
.sb-dot:hover { transform: scale(1.12); }
.sb-dot.on { outline-color: #111; }
.sb-dot-rainbow {
  border: none;
  background: linear-gradient(135deg, #f9a8d4, #93c5fd, #86efac, #fde68a, #f97316);
}

.sb-color-chips {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.sb-chip-c {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  font-size: 11px;
}
.sb-chip-c button {
  padding: 0;
  background: none;
  border: none;
  font-size: 13px;
  line-height: 1;
  opacity: 0.45;
  cursor: pointer;
}
.sb-chip-c button:hover { opacity: 1; color: #e11d48; }

/* ==========================================================================
   6. FILTER: CUSTOM COLOR PICKER
   ========================================================================== */

.sb-cp {
  display: none;
  flex-direction: column;
  gap: 7px;
  margin-top: 19px;
  padding: 9px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.sb-cp.open { display: flex; }

.sb-cp-sb {
  position: relative;
  width: 100%; height: 130px;
  border-radius: 5px;
  overflow: hidden;
  cursor: crosshair;
}
#sbCpCanvas { display: block; width: 100%; height: 100%; border-radius: 5px; }
.sb-cp-cursor {
  position: absolute;
  top: 0; left: 100%;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sb-cp-hue { position: relative; height: 12px; border-radius: 999px; cursor: pointer; }
#sbCpHue { display: block; width: 100%; height: 12px; border-radius: 999px; }
.sb-cp-hue-thumb {
  position: absolute;
  top: 50%;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sb-cp-row { display: flex; align-items: center; gap: 6px; }

.sb-cp-preview {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 4px;
  border: 2px solid #444;
  background: #e11d48;
}

.sb-cp-inputs { display: flex; flex: 1; gap: 3px; }

.sb-cp-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.sb-cp-field input {
  width: 100%;
  padding: 4px 2px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 3px;
  font-size: 10px;
  color: #fff;
  text-align: center;
  outline: none;
  box-sizing: border-box;
}
.sb-cp-field input:focus { border-color: #888; }
.sb-cp-field label {
  margin-top: 2px;
  font-size: 9px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sb-cp-add {
  width: 100%;
  padding: 6px;
  background: #fff;
  color: #111;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}
.sb-cp-add:hover { background: #e5e7eb; }

/* ==========================================================================
   7. FILTER: SIZE & APPLY BUTTON
   ========================================================================== */

.sb-size-wrap { display: flex; flex-wrap: wrap; gap: 5px; }

.sb-size-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 11px;
  color: #555;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.sb-size-btn:hover { border-color: #111; color: #111; }
.sb-size-btn.on { background: #111; border-color: #111; color: #fff; }

.sb-apply {
  width: 100%;
  padding: 9px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.sb-apply:hover { background: #333; }

/* ==========================================================================
   8. MAIN CONTENT: PRODUCT GRID AREA
   ========================================================================== */

.shop-main { flex: 1; min-width: 0; padding: 15px; }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 cards per row */
  gap: 16px;
}

.shop-empty {
  grid-column: 1 / -1;
  padding: 60px 0;
  font-size: 14px;
  color: #bbb;
  text-align: center;
}

/* ==========================================================================
   9. PRODUCT CARDS: TILE, IMAGES, BADGES, INFO, CTA
   ========================================================================== */

/* 9.1 Card container & hover */

.product-card {
  position: relative;
  background: #fff;
  border: 1px solid #e9e9e9;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

/* 9.2 Image area (main + hover image) */

.product-card__img-wrap {
  position: relative;
  height: 390px;
  overflow: hidden;
  background: #f5f5f5;
}

.product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-main {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 1;
  transition: opacity 0.55s ease, transform 0.6s ease;
}

.img-hover {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.55s ease, transform 0.6s ease;
}

.product-card:hover .img-main { opacity: 0; transform: scale(1.05); }
.product-card:hover .img-hover { opacity: 1; transform: scale(1.05); }

/* 9.3 Badges on card */

.product-card__badge {
  position: absolute;
  top: 12px;
  z-index: 3;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 20px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.badge-out {
  top: 50%;
  left: 0; right: 0;
  width: 100%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 13px;
  padding: 14px 0;
  border-radius: 0;
  letter-spacing: 0.12em;
  text-align: center;
  white-space: nowrap;
}
.badge-low { background: #f59e0b; }

/* NEW badge — default position top-right */
.badge-new {
  right: 12px;
  background: #ed0e0e;
}

/* 9.4 Product info */

.product-card__info {
  padding: 14px;
  text-align: center;
}

.product-card__type {
  font-size: 10px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  font-weight: 700;
}

.product-card__name {
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 10px;
  display: -webkit-box;
  display: box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.product-card__price {
  font-size: 20px;
  font-weight: 800;
  color: #111;
}

/* 9.5 Card CTA button — centred over image on hover */

.product-card__btn {
  position: absolute !important;
  bottom: 12px !important; /* move to bottom */
  left: 50% !important;
  transform: translateX(-50%) translateY(20px) !important;

  width: 80% !important;
  padding: 12px 0 !important;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 6px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;

  opacity: 0 !important;
  pointer-events: none !important;
  z-index: 5 !important;

  transition: opacity 0.25s ease, transform 0.25s ease !important;
}

.product-card:hover .product-card__btn {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(-50%) !important;
  pointer-events: auto !important;
}

/* ==========================================================================
   10. DISCOUNT BADGE & SALE PRICE STYLING
   ========================================================================== */

/* Discount badge — top-right of image */
.badge-discount {
  position: absolute;
  top: 12px;
  right: 0;
  z-index: 4;

  background: #df2f07;
  color: #fff;

  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  padding: 6px 14px;

  clip-path: polygon(0 0, 100% 0, 100% 100%, 10% 100%, 0 50%);
}

/* ── KEY FIX: when discount badge is present, push NEW badge below it ── */
/* discount badge height (~32px) + top offset (12px) + gap (6px) = 50px  */
.badge-discount ~ .badge-new {
  top: 52px;
}

/* Price wrapper */
.product-card__price-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

/* Old price */
.product-card__price-old {
  font-size: 13px;
  color: #aaa;
  text-decoration: line-through;
}

/* Sale price */
.product-card__price-sale {
  font-size: 20px;
  font-weight: 800;
  color: #111;
}

/* Drawer price styling */
.pd-price-old {
  font-size: 16px;
  color: #aaa;
  text-decoration: line-through;
  margin-right: 8px;
}

.pd-price-sale {
  font-size: 22px;
  color: #111;
  margin-right: 8px;
}

.pd-price-badge {
  display: inline-block;
  background: linear-gradient(135deg, #2e1065, #7c3aed);
  color: #fff;
  font-size: 14px;
  padding: 3px 10px;
  border-radius: 4px;
  vertical-align: middle;
}

/* ==========================================================================
   13. RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 768px) {
  .shop-layout { flex-direction: column; }
  .shop-sidebar {
    width: 100%; min-width: 0;
    height: auto; position: static;
    border-right: none;
    border-bottom: 1px solid #efefef;
  }
}

