/* ==========================================================
   GLIITY JEWELRIES - SHOP & CART STYLESHEET (RESPONSIVE FRAMING)
   ========================================================== */

/* Shop Controls & Filters */
.shop-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: clamp(24px, 4vw, 36px);
}

.category-pills-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.category-pills-wrap::-webkit-scrollbar {
  display: none;
}

.category-pill {
  padding: 8px 18px;
  border-radius: 30px;
  background-color: #ffffff;
  border: 1px solid #dfd9ce;
  font-size: clamp(0.75rem, 1.2vw, 0.8125rem);
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.category-pill:hover, .category-pill.active {
  background-color: var(--bg-dark);
  color: var(--gold-light);
  border-color: var(--bg-dark);
  box-shadow: var(--shadow-sm);
}

.shop-subbar,
.shop-search-sort {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid #eae5db;
}

.shop-search-box,
.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}

.shop-search-input,
.search-input-wrap input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 6px;
  border: 1px solid #dcd5c9;
  background-color: #ffffff;
  font-size: 0.875rem;
  color: var(--text-dark);
}

.shop-search-input:focus,
.search-input-wrap input:focus {
  outline: none;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 2px rgba(197, 168, 128, 0.2);
}

.shop-search-icon,
.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dark-muted);
  pointer-events: none;
}

.shop-sort-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-sort-label {
  font-size: 0.75rem;
  color: var(--text-dark-muted);
  font-weight: 500;
  white-space: nowrap;
}

.shop-sort-select {
  padding: 9px 14px;
  border-radius: 6px;
  border: 1px solid #dcd5c9;
  background-color: #ffffff;
  font-size: 0.85rem;
  color: var(--text-dark);
}

/* Product Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2.5vw, 28px);
}

@media (max-width: 1120px) and (min-width: 769px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

/* Product Card */
.product-card {
  background-color: #ffffff;
  border: 1px solid #eae6dc;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  position: relative;
  min-width: 0;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-primary);
  box-shadow: var(--shadow-md);
}

.product-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: #f7f5f0;
}

.product-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.product-card:hover .product-thumb-wrap img {
  transform: scale(1.06);
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 3;
}

.badge-bestseller {
  background-color: var(--bg-dark);
  color: var(--gold-light);
  border: 1px solid var(--gold-border);
}

.badge-new {
  background: var(--gold-gradient);
  color: var(--bg-dark);
}

.badge-limited {
  background-color: #991b1b;
  color: #ffffff;
}

.quick-view-overlay-btn {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background-color: rgba(7, 31, 30, 0.92);
  color: var(--gold-light);
  border: 1px solid var(--gold-primary);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  transition: all var(--transition-fast);
  z-index: 4;
  white-space: nowrap;
}

.product-card:hover .quick-view-overlay-btn {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.product-card-body {
  padding: clamp(12px, 2vw, 18px);
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
  min-width: 0;
}

.product-cat-kicker {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-dark);
  font-weight: 600;
  margin-bottom: 4px;
}

.product-card-title {
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 1.15vw, 1.05rem);
  color: var(--text-dark);
  margin-bottom: 6px;
  font-weight: 600;
  line-height: 1.35;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-desc {
  font-size: 0.75rem;
  color: var(--text-dark-muted);
  line-height: 1.5;
  margin-bottom: 10px;
  min-height: 3em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #f1ece2;
  gap: 8px;
}

.product-price {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 1.3vw, 1.25rem);
  font-weight: 700;
  color: var(--text-dark);
}

.product-price-old {
  font-size: 0.75rem;
  text-decoration: line-through;
  color: var(--text-dark-subtle);
  margin-left: 4px;
}

.btn-add-card {
  padding: 6px 12px;
  font-size: 0.6875rem;
  border-radius: 4px;
  background-color: var(--bg-dark);
  color: var(--gold-light);
  border: 1px solid var(--gold-border);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-add-card:hover {
  background-color: var(--gold-primary);
  color: var(--bg-dark);
  border-color: var(--gold-primary);
}

/* Product Detail Modal */
.product-modal-container {
  max-width: 920px;
  width: min(920px, 94vw);
}

.product-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 36px);
}

.p-modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.p-modal-main-img {
  width: 100%;
  height: clamp(260px, 35vw, 400px);
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e8e4dc;
}

.p-modal-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.p-modal-thumb-btn {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.p-modal-thumb-btn.active {
  border-color: var(--gold-primary);
}

.p-modal-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-modal-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.p-modal-kicker {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-dark);
  font-weight: 600;
  margin-bottom: 4px;
}

.p-modal-title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  margin-bottom: 10px;
  color: var(--text-dark);
}

.p-modal-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.p-modal-price {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  font-weight: 700;
  color: var(--text-dark);
}

.p-modal-stock {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--status-instock);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.p-modal-stock::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-instock);
}

.p-modal-desc {
  font-size: 0.875rem;
  color: var(--text-dark-muted);
  line-height: 1.65;
  margin-bottom: 18px;
}

/* Variations */
.variation-group {
  margin-bottom: 16px;
}

.variation-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.variation-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.v-pill {
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid #d5cec2;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  background: #ffffff;
}

.v-pill.active {
  background-color: var(--bg-dark);
  color: var(--gold-light);
  border-color: var(--bg-dark);
}

/* Quantity & Actions */
.modal-actions-row {
  display: flex;
  gap: 10px;
  margin: 18px 0 12px 0;
}

.qty-counter {
  display: flex;
  align-items: center;
  border: 1px solid #cfc8bd;
  border-radius: 4px;
  overflow: hidden;
}

.qty-btn {
  width: 36px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f7f5f0;
  font-size: 1rem;
  font-weight: 600;
}

.qty-input {
  width: 38px;
  height: 44px;
  border: none;
  text-align: center;
  font-weight: 600;
  font-size: 0.9375rem;
}

.p-modal-whatsapp-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #15803d;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-top: 8px;
}

.p-modal-whatsapp-link:hover {
  text-decoration: underline;
}

/* Cart Slide Drawer */
.cart-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 23, 22, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.cart-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 100vw);
  height: 100vh;
  background-color: #ffffff;
  z-index: 1150;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-drawer);
  transform: translateX(100%);
  transition: transform var(--transition-base);
}

.cart-drawer-overlay.open .cart-drawer {
  transform: translateX(0);
}

.cart-header {
  padding: 16px 20px;
  background-color: var(--bg-dark);
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--gold-border);
}

.cart-header h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: #ffffff;
}

.cart-close-btn {
  color: var(--text-light-muted);
  font-size: 1.4rem;
}

.shipping-progress-banner {
  background-color: var(--bg-cream-soft);
  padding: 12px 20px;
  border-bottom: 1px solid #eee8dc;
}

.shipping-progress-text {
  font-size: 0.75rem;
  color: var(--text-dark);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.shipping-bar-track {
  width: 100%;
  height: 5px;
  background-color: #e2ddd3;
  border-radius: 3px;
  overflow: hidden;
}

.shipping-bar-fill {
  height: 100%;
  background: var(--gold-gradient);
  transition: width var(--transition-base);
}

.cart-items-wrap {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-dark-muted);
}

.cart-item-card {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0eee6;
}

.cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #e8e4dc;
}

.cart-item-info h4 {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.cart-item-variant {
  font-size: 0.6875rem;
  color: var(--text-dark-muted);
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-dark);
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cart-item-remove {
  color: #991b1b;
  font-size: 0.6875rem;
  padding: 2px;
}

.cart-footer {
  padding: 16px 20px;
  background-color: #fdfdfc;
  border-top: 1px solid #ede8de;
}

.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  font-family: var(--font-serif);
  font-weight: 700;
  margin-bottom: 6px;
}

.cart-notice {
  font-size: 0.6875rem;
  color: var(--text-dark-muted);
  margin-bottom: 14px;
}

/* Checkout Modal */
.checkout-modal-container {
  max-width: 720px;
  width: min(720px, 94vw);
}

.checkout-steps {
  display: flex;
  border-bottom: 1px solid #eee8dc;
  margin-bottom: 18px;
}

.checkout-step-tab {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dark-muted);
  border-bottom: 2px solid transparent;
}

.checkout-step-tab.active {
  color: var(--gold-dark);
  border-bottom-color: var(--gold-primary);
}

.delivery-method-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.delivery-option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid #dcd5c9;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.delivery-option-card.selected {
  border-color: var(--gold-primary);
  background-color: var(--gold-subtle);
}

.delivery-option-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.delivery-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-dark);
}

.delivery-desc {
  font-size: 0.6875rem;
  color: var(--text-dark-muted);
}

.delivery-cost {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-dark);
}

/* Order Confirmation Screen */
.order-confirm-card {
  text-align: center;
  padding: 30px 16px;
}

.confirm-check-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 16px auto;
  box-shadow: var(--shadow-gold);
}

.order-ref-badge {
  display: inline-block;
  background-color: var(--bg-dark);
  color: var(--gold-light);
  font-family: monospace;
  font-size: 0.9375rem;
  padding: 6px 14px;
  border-radius: 4px;
  margin: 12px 0;
  border: 1px solid var(--gold-border);
}

/* ==========================================================
   BREAKPOINTS: SHOP GRID ON LAPTOPS, TABLETS, PHONES (FRAMING FIXES)
   ========================================================== */

/* Laptops (992px to 1240px) */
@media (max-width: 1240px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

/* Tablets (768px to 992px) */
@media (max-width: 992px) {
  .product-modal-grid {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

/* Phones & Small Tablets (< 768px): 2-Column Luxury Compact Grid */
@media (max-width: 768px) {
  .shop-subbar,
  .shop-search-sort {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .shop-search-box,
  .search-input-wrap {
    max-width: 100%;
    min-width: 100%;
    width: 100%;
  }

  .shop-sort-box {
    width: 100%;
    justify-content: space-between;
  }

  .shop-sort-select {
    width: 100%;
    flex: 1;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-card-body {
    padding: 10px 8px;
  }

  .product-card-desc {
    display: none; /* Clean luxury browsing on mobile */
  }

  .product-card-title {
    font-size: 0.8125rem;
    min-height: 2.4em;
    line-height: 1.25;
  }

  .product-price {
    font-size: 0.9375rem;
  }

  .product-price-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding-top: 8px;
  }

  .btn-add-card {
    width: 100%;
    justify-content: center;
    padding: 6px 8px;
    font-size: 0.6875rem;
  }

  .quick-view-overlay-btn {
    display: none; /* Touch directly opens card */
  }

  .cart-drawer {
    width: 100vw;
  }
}

/* Extra Narrow Phones (< 340px) */
@media (max-width: 340px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}
