/* ==========================================================
   STOREFRONT STYLES & LAYOUTS
   Multi-Category E-Commerce Platform (Pisteuo)
   ========================================================== */

/* 1. Hero Banner Carousel */
.hero-slider-section {
  padding: 1.5rem 0;
}

.hero-slider-container {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--brand-gradient);
}

.hero-slide {
  position: relative;
  min-height: 440px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 26, 71, 0.9) 0%, rgba(7, 92, 255, 0.42) 60%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 580px;
  padding: 3rem 4rem;
  color: #ffffff;
}

.hero-content .hero-badge {
  display: inline-block;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.hero-content h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.hero-content p {
  font-size: 1.0625rem;
  color: #cbd5e1;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* 2. Trust Indicators Strip */
.trust-strip {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.trust-card {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.trust-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.trust-info h5 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.trust-info p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* 3. Category Grid Cards */
.category-section {
  padding: 3.5rem 0 2rem;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}

.category-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  text-decoration: none;
  background: var(--brand-gradient);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.85;
}

.category-card:hover img {
  transform: scale(1.08);
  opacity: 0.95;
}

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(15, 23, 42, 0.9) 100%);
}

.category-card-content {
  position: relative;
  z-index: 5;
  color: #ffffff;
}

.category-card-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.category-card-content span {
  font-size: 0.8125rem;
  color: #cbd5e1;
  font-weight: 500;
}

/* 4. Product Card Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.product-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
  box-shadow: 0 5px 20px rgba(15, 23, 42, 0.06);
}

/* Policy pages */
.policy-page { padding: 3rem 0 5rem; }
.policy-shell { max-width: 900px; margin: 0 auto; }
.policy-hero { margin-bottom: 1.5rem; padding: 2rem; border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: linear-gradient(135deg,#eaf2ff,#e8eef8); }
.policy-hero h1 { margin-bottom: .5rem; font-size: clamp(1.8rem,5vw,2.5rem); }
.policy-content { padding: clamp(1.25rem,4vw,2.5rem); border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: #fff; }
.policy-content section + section { margin-top: 2rem; }
.policy-content h2 { margin-bottom: .6rem; font-size: 1.2rem; }
.policy-content p,.policy-content li { color: var(--text-muted); line-height: 1.75; }
.policy-content ul { padding-left: 1.25rem; }

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.product-card-thumb {
  position: relative;
  height: 240px;
  flex: 0 0 240px;
  background: #f8fafc;
  overflow: hidden;
}

.product-card-thumb > a {
  display: block;
  width: 100%;
  height: 100%;
}

.product-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.product-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 5;
}

.wishlist-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 5;
  transition: all var(--transition-fast);
}

.wishlist-btn:hover, .wishlist-btn.active {
  color: var(--danger);
  background: #ffffff;
}

.product-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
  background: #ffffff;
}

.product-category-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

.product-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-title a:hover {
  color: var(--primary);
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

.sale-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.base-price {
  font-size: 0.875rem;
  color: var(--text-subtle);
  text-decoration: line-through;
}

.discount-percent {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.product-card-action {
  margin-top: 0.875rem;
}

/* 5. Shop Faceted Filter Layout */
.shop-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 2rem 0 4rem;
}

.filter-sidebar {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  align-self: flex-start;
  position: sticky;
  top: 90px;
}

.filter-group {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.filter-group:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.filter-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.filter-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.filter-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.filter-checkbox-label:hover {
  color: var(--text-main);
}

/* 6. Product Detail View */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  padding: 2.5rem 0 4rem;
}

.product-gallery {
  display: flex;
  gap: 1rem;
  position: sticky;
  top: 90px;
}

.gallery-thumbs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 76px;
}

.thumb-item {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-subtle);
  transition: all var(--transition-fast);
}

.thumb-item.active, .thumb-item:hover {
  border-color: var(--primary);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-main {
  flex: 1;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Product Options & Swatches */
.variant-selector-group {
  margin: 1.5rem 0;
}

.variant-label {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.625rem;
  display: flex;
  justify-content: space-between;
}

.variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.variant-chip {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.variant-chip:hover, .variant-chip.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.variant-chip.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--border-color);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.color-swatch.active {
  box-shadow: 0 0 0 2.5px var(--primary);
  transform: scale(1.1);
}

/* Quantity & Action buttons */
.quantity-control {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  width: 120px;
}

.quantity-control button {
  background: transparent;
  border: none;
  width: 36px;
  height: 38px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.quantity-control input {
  flex: 1;
  border: none;
  text-align: center;
  font-weight: 700;
  outline: none;
  font-size: 0.9375rem;
  width: 48px;
}

/* 7. Cart & Checkout Pages */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2.5rem;
  padding: 2.5rem 0 4rem;
}

.cart-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
}

.cart-item-row {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-color);
}

.cart-item-row:last-child {
  border-bottom: none;
}

.cart-item-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--bg-subtle);
}

.order-summary-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  position: sticky;
  top: 90px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.875rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.summary-row.total-row {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: 1rem;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

/* 8. Order Status Timeline */
.timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--border-color);
  z-index: 1;
}

.timeline-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-subtle);
  font-weight: 700;
}

.timeline-step.completed .timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.timeline-step.active .timeline-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.timeline-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.timeline-step.active .timeline-label,
.timeline-step.completed .timeline-label {
  color: var(--text-main);
}

/* Responsive */
@media (max-width: 1024px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .shop-layout { grid-template-columns: 1fr; }
  .filter-sidebar { position: static; top: auto; }
  .cart-layout { grid-template-columns: 1fr; }
  .order-summary-box { position: static; top: auto; }
  .product-detail-layout { grid-template-columns: 1fr; }
  .product-gallery {
    position: static;
    top: auto;
  }
}

@media (max-width: 768px) {
  .trust-grid { grid-template-columns: 1fr 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-card-thumb {
    height: auto;
    flex-basis: auto;
    aspect-ratio: 1 / 1;
  }
  .product-price-row { flex-wrap: wrap; }
  .hero-content { padding: 2rem 1.5rem; }
  .hero-content h1 { font-size: 2rem; }
  .product-detail-layout {
    display: block;
    padding-top: 1rem;
  }
  .product-gallery {
    display: flex;
    position: relative;
    top: auto;
    flex-direction: column-reverse;
    width: 100%;
    margin-bottom: 1.5rem;
  }
  .gallery-main {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }
  .gallery-thumbs { flex-direction: row; width: 100%; overflow-x: auto; }
  .product-info-column {
    position: relative;
    clear: both;
    width: 100%;
  }
  .hero-slider-section { padding: 0.75rem 0; }
  .hero-slide { min-height: 360px; }
  .section-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }
  .cart-layout { gap: 1.25rem; padding: 1.5rem 0 3rem; }
  .cart-card,
  .order-summary-box { padding: 1rem; }
  .cart-item-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0.75rem;
  }
  .cart-item-thumb { width: 64px; height: 64px; }
  .cart-item-row > :nth-child(n+3) { grid-column: 2; }
  .summary-row { gap: 1rem; }
  .summary-row > :last-child { text-align: right; }
  .timeline { overflow-x: auto; gap: 2rem; padding-bottom: 0.5rem; }
  .timeline-step { min-width: 72px; }
  .product-info-column [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .product-info-column [style*="display:flex"] {
    flex-wrap: wrap;
  }
  main.container[style*="padding"] {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  .cart-layout [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .cart-layout .admin-card-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .cart-layout label[style*="display:flex"] {
    align-items: flex-start !important;
    min-width: 0;
  }
  .cart-layout label[style*="display:flex"] > div {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .account-layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  .account-layout [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .account-layout .admin-card-header,
  .account-layout .flex-between {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .account-layout [style*="justify-content:space-between"] {
    gap: 0.75rem;
    flex-wrap: wrap;
  }
  .account-layout [style*="display:flex"] > * {
    min-width: 0;
  }
  .flash-deal-banner {
    padding: 2rem !important;
  }
  .flash-deal-banner > * {
    min-width: 0;
  }
  .flash-deal-banner img {
    width: 100%;
    max-width: 260px !important;
  }
  .shop-layout > section > .flex-between {
    align-items: stretch;
    flex-direction: column;
    gap: 0.75rem;
  }
  .shop-layout > section > .flex-between > div,
  .shop-layout .form-select {
    width: 100% !important;
  }
}

@media (max-width: 480px) {
  .hero-slide { min-height: 330px; }
  .hero-content { padding: 1.5rem 1.1rem; }
  .hero-content h1 { font-size: 1.7rem; }
  .hero-content p { font-size: 0.9rem; margin-bottom: 1.25rem; }
  .hero-content [style*="display:flex"] { flex-wrap: wrap; }
  .trust-grid { grid-template-columns: 1fr; gap: 1rem; }
  .category-section { padding-top: 2.25rem; }
  .category-grid { gap: 0.75rem; }
  .category-card { height: 180px; padding: 1rem; }
  .product-grid { grid-template-columns: 1fr; gap: 1rem; }
  .product-card-body { padding: 1rem; }
  .product-card-thumb { aspect-ratio: 4 / 3; }
  .shop-layout { gap: 1rem; padding-top: 1rem; }
  .filter-sidebar { padding: 1rem; }
  .product-detail-layout { padding-bottom: 2.5rem; }
  .gallery-main { aspect-ratio: 4 / 3; }
  .gallery-thumbs { gap: 0.5rem; }
  .thumb-item { width: 60px; height: 60px; flex: 0 0 60px; }
  .product-info-column h1 { font-size: 1.5rem !important; }
  .product-info-column > [style*="background:var(--bg-subtle)"] {
    padding: 1rem !important;
    gap: 0.6rem !important;
  }
  #p-price { font-size: 1.65rem !important; }
  #p-base-price { font-size: 1rem !important; }
  .product-info-column > [style*="gap:1rem"][style*="flex-wrap:wrap"] > .quantity-control {
    width: 100%;
  }
  .product-info-column > [style*="gap:1rem"][style*="flex-wrap:wrap"] > .btn {
    flex: 1 1 140px !important;
  }
  .flash-deal-banner { padding: 1.5rem 1rem !important; }
  .flash-deal-banner h2 { font-size: 1.65rem !important; }
  .cart-card,
  .order-summary-box,
  .cart-layout .admin-card > [style*="padding: 1.5rem"] {
    padding: 0.875rem !important;
  }
  .cart-layout label[style*="padding:1.25rem"] {
    padding: 0.875rem !important;
    gap: 0.75rem !important;
  }
  #checkout-success-view { padding: 2rem 1rem !important; }
  #checkout-success-view > [style*="display:flex"] {
    flex-direction: column;
  }
  #checkout-success-view .btn { width: 100%; }
  .account-layout .admin-card > [style*="padding:1.5rem"] {
    padding: 1rem !important;
  }
  .account-layout [style*="font-family:monospace"] {
    overflow-wrap: anywhere;
  }
}
