/* Store layout */
.store-layout{
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  padding: 22px 0 46px;
}

.store-filters .filter-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  padding: 14px;
  position: sticky;
  top: 92px;
}

.filter-title{
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.filter-group{
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 12px;
  margin-top: 12px;
}
.filter-group__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.filter-group h3{
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}
.btn-sm{
  padding: 0.45rem 0.7rem;
  font-weight: 650;
}

.filter-options{
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.check{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(15, 23, 42, 0.9);
  cursor: pointer;
}
.check input{
  width: 16px;
  height: 16px;
}

.filter-row{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.filter-label{
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: rgba(15, 23, 42, 0.75);
}
.filter-label input{
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 10px;
  background: #fff;
}

/* Top bar: title left, summary+pager right */
.store-topbar{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 6px 0 12px;
}
.store-title{
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.store-topbar-right{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.store-sub{
  margin: 0;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

/* Products grid: 4 per row */
/* Products grid + redesigned cards */
.products-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* Card */
.product-card{
  height: 100%;
  background: var(--card);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 16px;
  overflow: hidden;

  display: grid;
  grid-template-rows: auto 1fr;

  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.product-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.10);
  border-color: rgba(15, 23, 42, 0.18);
}

/* Media (bigger, clean banner area) */
.product-media{
  aspect-ratio: 16 / 9;
  background: transparent;              /* remove background color */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;                        /* a bit more breathing room */
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.product-media img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scale(1.08);               /* makes the icon a bit bigger */
  filter: none;                          /* remove drop shadow (optional) */
}

/* Body */
.product-body{
  padding: 14px 14px 16px;
  display: grid;
  gap: 10px;
}

/* Title */
.product-body h3,
.product-title{
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: rgba(15, 23, 42, 0.95);

  overflow: hidden;
  min-width: 0;

  /* Fallback for very old browsers: limit height to 3 lines */
  max-height: calc(1.25em * 3);

  /* Modern standard property (supported in newer browsers) */
  line-clamp: 3;

  /* WebKit/Blink (widest support today) */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Price block */
.price{
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 1);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.price-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.marked{
  text-decoration: line-through;
  color: rgba(15, 23, 42, 0.55);
  font-weight: 700;
  font-size: 11px; /* smaller than before */
}

.badge{
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(209, 250, 229, 1);
  border: 1px solid rgba(167, 243, 208, 1);
  color: rgba(6, 95, 70, 1);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.selling{
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: rgba(15, 23, 42, 0.95);
}

/* Actions */
.product-actions{
  margin-top: 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.product-actions .btn{
  width: 100%;
  justify-content: center;
  border-radius: 12px;
  white-space: nowrap;   /* keep text on one line */
  padding: 10px 10px;    /* slightly smaller horizontal padding */
}

/* Pagination */
.pager{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.pager-top{
  justify-content: flex-end; /* align right in topbar */
}
.pager-bottom{
  margin: 14px 0 0;
}
.pager-numbers{
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.page-btn{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 750;
}
.page-btn.active{
  background: rgba(63,114,166,0.12);
  border-color: rgba(63,114,166,0.35);
}

.empty-state{
  grid-column: 1 / -1;
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}

/* Floating cart button */
.floating-cart{
  position: fixed;
  right: 18px;
  bottom: 88px;
  top: auto;
  transform: translateX(140%);
  z-index: 9999;

  border: 0;
  border-radius: 999px;
  padding: 12px 14px;
  background: var(--accent);
  color: #1f2a37;
  font-weight: 850;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  transition: transform .18s ease;
}
.floating-cart.show{
  transform: translateX(0);
}
.floating-cart:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px rgba(244, 201, 44, 0.35), 0 18px 50px rgba(15, 23, 42, 0.22);
}

/* Modal */
.modal{
  border: 0;
  padding: 0;
  width: min(980px, 92vw);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
}
.modal::backdrop{
  background: rgba(2, 6, 23, 0.55);
}
.modal-inner{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.modal-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.modal-eyebrow{
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.55);
  font-weight: 800;
}
.modal-title{
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.modal-body{
  padding: 14px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
}
.modal-media{
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  place-items: center;
}
.modal-media img{
  width: 220px;
  height: auto;
  object-fit: contain;
}
.modal-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.modal-details{
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 10px;
}

/* Cart */
.cart-body{
  grid-template-columns: 1fr;
}
.cart-list{
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}
.cart-row{
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  background: rgba(255,255,255,0.75);
}
.cart-row__name{
  font-weight: 850;
}
.cart-row__meta{
  margin-top: 6px;
  color: rgba(15, 23, 42, 0.75);
}

.qty{
  display: grid;
  grid-template-columns: 32px 64px 32px;
  gap: 6px;
  align-items: center;
  justify-items: center;
  margin-bottom: 8px;
}
.qty-btn{
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}
.qty-input{
  width: 64px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  text-align: center;
}

.cart-totals{
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 10px;
  display: grid;
  gap: 8px;
}
.totals-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.totals-row--grand{
  font-size: 18px;
}

.cart-actions{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* =========================
   Checkout form (FIXED)
   - Better 2-col layout
   - Inputs won't overflow
   - Nice spacing & focus
   ========================= */
/* Checkout form (ORIGINAL / first draft) */
.checkout-form{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Make fields span both columns when needed */
.checkout-form .field--full{
  grid-column: 1 / -1;
}

/* Mobile: stack to one column */
@media (max-width: 720px){
  .checkout-form{
    grid-template-columns: 1fr;
  }
}

.field{
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.field input,
.field textarea{
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
}

.checkout-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 1100px){
  .products-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px){
  .store-layout{ grid-template-columns: 1fr; }
  .store-filters .filter-card{ position: relative; top: 0; }
  .products-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-body{ grid-template-columns: 1fr; }
  .store-topbar{ flex-direction: column; align-items: flex-start; }
  .store-topbar-right{ justify-items: start; }
  .store-sub{ text-align: left; }
  .pager-top{ justify-content: flex-start; }
}
@media (max-width: 520px){
  .products-grid{ grid-template-columns: 1fr; }
}