/* ── Ecommerce Module CSS ── */

/* ── Store Header ── */
.store-header {
  padding: 3.5rem 0 2rem;
  border-bottom: 1px solid var(--color-border, rgba(255,255,255,.08));
  margin-bottom: 2.5rem;
}
.store-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.store-header-inner h1 {
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700; margin: 0 0 .25rem;
}
.store-header-inner p { opacity: .6; margin: 0; }

/* ── Cart badge ── */
.cart-badge {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border, rgba(255,255,255,.1));
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: transform .2s;
}
.cart-badge:hover { transform: scale(1.08); }
.cart-count {
  position: absolute; top: -.35rem; right: -.35rem;
  background: var(--color-primary, #6366f1);
  color: #fff; font-size: .65rem; font-weight: 700;
  width: 1.25rem; height: 1.25rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── Store Layout ── */
.store-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  padding-bottom: 4rem;
}
@media (max-width: 768px) { .store-layout { grid-template-columns: 1fr; } }

/* ── Sidebar ── */
.store-sidebar { min-width: 0; }
.sidebar-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .5; font-weight: 600; margin: 0 0 .75rem; }
.category-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .2rem; }
.category-list a {
  display: flex; align-items: center; justify-content: space-between;
  padding: .45rem .625rem; border-radius: .375rem;
  color: inherit; text-decoration: none; font-size: .9rem;
  transition: background .15s;
}
.category-list a:hover, .category-list a.active {
  background: rgba(255,255,255,.07);
  color: var(--color-primary, #6366f1);
}
.cat-count { font-size: .75rem; opacity: .45; }

/* ── Search bar ── */
.store-search { display: flex; gap: .5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }

/* ── Product Grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
@media (max-width: 640px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; } }

/* ── Product Card ── */
.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border, rgba(255,255,255,.07));
  border-radius: var(--radius-xl, 1rem);
  overflow: hidden;
  transition: var(--transition, 200ms ease);
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 20px 48px -8px rgba(0,0,0,.3); }

.product-card-img-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--color-bg);
  display: block;
}
.product-card-img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.product-card:hover .product-card-img { transform: scale(1.05); }
.product-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; opacity: .2;
}
.product-badge-sale, .product-badge-featured {
  position: absolute; top: .75rem; left: .75rem;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  padding: .2rem .55rem; border-radius: .25rem; letter-spacing: .04em;
}
.product-badge-sale     { background: #ef4444; color: #fff; }
.product-badge-featured { background: var(--color-primary, #6366f1); color: #fff; }

.product-card-body { padding: 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.product-cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; opacity: .5; font-weight: 600; }
.product-name { font-size: 1rem; font-weight: 600; margin: 0; line-height: 1.35; }
.product-name a { color: inherit; text-decoration: none; }
.product-name a:hover { color: var(--color-primary, #6366f1); }

.product-price { margin: .25rem 0 auto; }
.price-sale    { font-size: 1.125rem; font-weight: 700; color: var(--color-primary, #6366f1); }
.price-old     { font-size: .85rem; opacity: .45; text-decoration: line-through; margin-left: .4rem; }
.price-regular { font-size: 1.125rem; font-weight: 700; }
.product-card-body .btn { margin-top: .75rem; }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; gap: .5rem; padding: 2rem 0; flex-wrap: wrap; }
.page-link {
  display: flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: .5rem;
  border: 1px solid var(--color-border, rgba(255,255,255,.1));
  color: inherit; text-decoration: none; font-size: .875rem;
  transition: background .15s, border-color .15s;
}
.page-link:hover, .page-link.active {
  background: var(--color-primary, #6366f1);
  border-color: var(--color-primary, #6366f1);
  color: #fff;
}

/* ── Product Detail ── */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
@media (max-width: 768px) { .product-detail-grid { grid-template-columns: 1fr; gap: 2rem; } }

.product-main-img-wrap {
  aspect-ratio: 1; overflow: hidden; border-radius: 1rem;
  background: var(--color-surface); margin-bottom: .75rem;
}
.product-main-img { width: 100%; height: 100%; object-fit: cover; }
.product-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 5rem; opacity: .15; }

.product-thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.thumb-btn {
  width: 64px; height: 64px; border-radius: .5rem; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; padding: 0; background: none;
  transition: border-color .15s;
}
.thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-btn.active, .thumb-btn:hover { border-color: var(--color-primary, #6366f1); }

.product-title { font-family: var(--font-display, Georgia, serif); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin: .25rem 0 .75rem; line-height: 1.25; }

.product-price-large { margin-bottom: 1rem; }
.price-sale-lg    { font-size: 2rem; font-weight: 700; color: var(--color-primary, #6366f1); }
.price-old-lg     { font-size: 1.125rem; opacity: .4; text-decoration: line-through; margin-left: .5rem; }
.price-regular-lg { font-size: 2rem; font-weight: 700; }
.price-discount   { display: inline-block; background: #ef4444; color: #fff; font-size: .75rem; font-weight: 700; padding: .15rem .45rem; border-radius: .25rem; margin-left: .5rem; vertical-align: middle; }

.product-excerpt { opacity: .7; line-height: 1.65; margin: 0 0 1.25rem; font-size: .9375rem; }
.product-actions { margin: 1.25rem 0; }
.product-meta { font-size: .8rem; opacity: .45; margin-top: .5rem; }

.product-description { max-width: 720px; }
.product-description h2 { font-size: 1.25rem; font-weight: 600; margin: 0 0 1.25rem; border-bottom: 1px solid var(--color-border, rgba(255,255,255,.1)); padding-bottom: .75rem; }
.prose { line-height: 1.75; opacity: .85; }
.prose p  { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.5em; }

/* ── Buttons ── */
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-success { background: #22c55e; color: #fff; border: none; }
.btn-success:hover { background: #16a34a; }

/* ── Qty btn ── */
.qty-btn { background: none; border: none; cursor: pointer; color: inherit; padding: .4rem .625rem; font-size: 1.0625rem; line-height: 1; }
.qty-btn:hover { background: rgba(255,255,255,.08); }

@media (max-width: 500px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .product-card-body { padding: .75rem; }
  .product-name { font-size: .9rem; }
}
