/* ============================================================
   LEGO FIFA World Cup 2026 — Loja (Store) Stylesheet
   Fonts: Nunito + Fredoka One (via Google Fonts)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Fredoka+One&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: #fff;
  color: #1a1d26;
}

h1, h2, h3, .font-display {
  font-family: 'Fredoka One', cursive;
}

/* ── Header ─────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 50;
  background: #f5c518;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
}
.logo img { height: 38px; }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: #1a1d26; text-decoration: none;
  font-weight: 700; font-size: .9rem; transition: opacity .2s;
}
.nav-links a:hover { opacity: .7; }

/* cart button */
.btn-cart-header {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: rgba(26,29,38,.1); color: #1a1d26;
  border: none; border-radius: 12px; cursor: pointer; position: relative;
  transition: background .2s, transform .12s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.btn-cart-header:hover { background: rgba(26,29,38,.18); }
.btn-cart-header:active { transform: scale(.96); }
.cart-icon { width: 22px; height: 22px; display: block; }
.cart-count {
  position: absolute; top: -4px; right: -4px;
  background: #dc2626; color: #fff;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: .75rem; display: flex; align-items: center; justify-content: center;
  font-weight: 800;
}

/* ── Hero ────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; }
.hero img { width: 100%; height: 320px; object-fit: cover; display: block; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,29,38,.6), transparent);
  display: flex; align-items: flex-end;
}
.hero-content { max-width: 1200px; margin: 0 auto; padding: 24px 23px; width: 100%; }
.hero h2 { font-size: 2.5rem; color: #fff; text-shadow: 2px 2px 4px rgba(0,0,0,.4); }
.hero p { color: rgba(255,255,255,.9); margin-top: 4px; max-width: 500px; }
.btn-hero {
  display: inline-block; margin-top: 16px;
  background: #f5c518; color: #1a1d26;
  padding: 12px 24px; border-radius: 8px;
  font-weight: 800; text-decoration: none; font-size: 1rem;
}
.btn-hero:hover { filter: brightness(1.1); }

/* ── Countdown ───────────────────────────────────── */
.promo-wrapper {
  background: #1a1d26; color: #fff;
  text-align: center; padding: 20px 16px;
}
.promo-wrapper h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem; margin-bottom: 12px; color: #f5c518;
}
.timer-box { display: flex; justify-content: center; gap: 10px; }
.box {
  background: #f5c518; color: #1a1d26;
  padding: 12px 16px; border-radius: 10px; min-width: 64px;
}
.box span { font-size: 1.6rem; font-weight: 900; display: block; line-height: 1; }
.box p { margin: 4px 0 0; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

/* ── Layout ──────────────────────────────────────── */
.main {
  max-width: 1200px; margin: 0 auto;
  padding: 32px 16px; display: flex; gap: 32px;
}
.sidebar { width: 220px; flex-shrink: 0; }
.sidebar h4 {
  font-weight: 800; font-size: .75rem; text-transform: uppercase;
  letter-spacing: 1px; color: #6b7280; margin-bottom: 12px;
}
.sidebar .section { margin-bottom: 24px; }
.filter-btn, .age-btn {
  display: block; width: 100%; text-align: left;
  padding: 8px 12px; border: none; background: none;
  border-radius: 8px; font-size: .9rem; font-weight: 600;
  cursor: pointer; color: #1a1d26; transition: all .2s;
}
.filter-btn:hover, .age-btn:hover { background: #f0fdf4; }
.filter-btn.active { background: #22965c; color: #fff; }
.age-btn {
  display: inline-block; width: auto;
  padding: 6px 12px; border-radius: 999px; font-size: .75rem;
  font-weight: 800; background: #f0fdf4; color: #6b7280;
  margin: 0 4px 4px 0;
}
.age-btn.active { background: #f5c518; color: #1a1d26; }
.content { flex: 1; }
.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.content-header h2 { font-size: 1.5rem; margin-top: 35px; }
.content-header span { font-size: .9rem; color: #6b7280; }

/* ── Product Grid ────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.product-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  overflow: hidden; transition: all .3s;
  display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: 0 12px 32px rgba(0,0,0,.12); transform: translateY(-4px); }
.product-image-wrap { position: relative; overflow: hidden; background: #f0fdf4; }
.product-image-wrap img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .5s; }
.product-card:hover .product-image-wrap img { transform: scale(1.1); }
.badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 4px 12px; border-radius: 999px;
  font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
}
.product-overlay {
  position: absolute; inset: 0; background: rgba(26,29,38,0);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: all .3s;
}
.product-card:hover .product-overlay { background: rgba(26,29,38,.2); opacity: 1; }
.btn-details {
  background: #fff; color: #1a1d26; border: none;
  padding: 8px 16px; border-radius: 8px; font-weight: 800; font-size: .85rem; cursor: pointer;
}
.btn-details:hover { background: #f5c518; }
.product-info { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.product-cat { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #6b7280; }
.product-info h3 { font-family: 'Fredoka One', cursive; font-size: 1.1rem; margin-top: 4px; line-height: 1.3; }
.product-desc {
  font-size: .85rem; color: #6b7280; margin-top: 8px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-meta { font-size: .75rem; color: #6b7280; margin-top: 8px; }
.product-bottom { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 12px; }
.old-price { font-size: .85rem; color: #6b7280; text-decoration: line-through; margin-right: 8px; }
.price { font-size: 1.25rem; font-weight: 800; color: #dc2626; }
.btn-cart {
  background: #22965c; color: #fff; border: none;
  padding: 8px 12px; border-radius: 8px; font-weight: 800; font-size: .8rem;
  cursor: pointer; transition: all .2s;
}
.btn-cart:hover { filter: brightness(1.1); }
.btn-cart:active { transform: scale(.95); }

/* ── Product Modal ───────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 60;
  background: rgba(26,29,38,.5); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 16px; max-width: 640px; width: 100%;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 48px rgba(0,0,0,.2);
}
.modal-body { display: flex; }
.modal-img { width: 50%; background: #f0fdf4; }
.modal-img img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.modal-content { width: 50%; padding: 24px; display: flex; flex-direction: column; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: #fff; border: none; border-radius: 50%;
  width: 36px; height: 36px; font-size: 1.2rem; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.modal-content h2 { font-family: 'Fredoka One', cursive; font-size: 1.5rem; }
.modal-content .desc { color: #6b7280; font-size: .9rem; line-height: 1.6; margin-top: 12px; }
.modal-tags { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.modal-tag { background: #f0fdf4; color: #6b7280; padding: 6px 12px; border-radius: 999px; font-size: .8rem; }
.modal-price-area { margin-top: auto; padding-top: 24px; }
.modal-price-area .price { font-size: 2rem; }
.btn-cart-modal {
  width: 100%; margin-top: 16px;
  background: #22965c; color: #fff; border: none;
  padding: 14px; border-radius: 12px; font-weight: 800; font-size: 1rem; cursor: pointer; transition: all .2s;
}
.btn-cart-modal:hover { filter: brightness(1.1); }

/* ── Cart Drawer ─────────────────────────────────── */
.cart-overlay {
  display: none; position: fixed; inset: 0; z-index: 55;
  background: rgba(26,29,38,.4); backdrop-filter: blur(4px);
}
.cart-overlay.open { display: block; }
.cart-drawer {
  position: fixed; top: 0; right: 0; z-index: 56;
  height: 100%; width: 100%; max-width: 400px;
  background: #fff; box-shadow: -8px 0 32px rgba(0,0,0,.2);
  transform: translateX(100%); transition: transform .3s;
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid #e5e7eb;
}
.cart-header h2 { font-family: 'Fredoka One', cursive; font-size: 1.25rem; }
.cart-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; padding: 4px; }
.cart-items { flex: 1; overflow-y: auto; padding: 16px; }
.cart-empty { text-align: center; color: #6b7280; margin-top: 48px; }
.cart-item {
  display: flex; gap: 12px; background: #f0fdf4;
  border-radius: 12px; padding: 12px; margin-bottom: 12px;
}
.cart-item img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h4 { font-weight: 800; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-info .price { color: #dc2626; font-weight: 800; font-size: .85rem; margin-top: 4px; }
.cart-qty { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cart-qty button {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 4px;
  width: 28px; height: 28px; cursor: pointer; font-weight: 800;
}
.cart-qty span { font-weight: 800; font-size: .85rem; width: 24px; text-align: center; }
.cart-remove {
  margin-left: auto; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: #fff; border: 1px solid #fecaca; border-radius: 8px;
  color: #dc2626; cursor: pointer; transition: background .15s, border-color .15s;
}
.cart-remove:hover { background: #fef2f2; border-color: #f87171; }
.cart-remove svg { display: block; width: 18px; height: 18px; }
.cart-bump-wrap {
  margin: 0 12px 8px;
  max-height: 220px;
  overflow-y: auto;
}
.cart-footer { border-top: 1px solid #e5e7eb; padding: 16px; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: 800; }
.cart-total .price { color: #dc2626; }
.btn-checkout {
  width: 100%; margin-top: 12px;
  background: #22965c; color: #fff; border: none;
  padding: 14px; border-radius: 12px; font-weight: 800; font-size: 1rem; cursor: pointer;
  transition: background .2s;
}
.btn-checkout:hover { background: #1a7a4a; }

/* ── Toast ───────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 16px; z-index: 70;
  background: #22965c; color: #fff;
  padding: 12px 18px; border-radius: 12px;
  font-weight: 700; font-size: .9rem; line-height: 1.35;
  transform: translateY(80px); opacity: 0; transition: transform .3s, opacity .3s;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  max-width: min(420px, calc(100vw - 32px));
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── Checkout Modal ──────────────────────────────── */
.checkout-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 200;
  align-items: center; justify-content: center;
  padding: 12px; box-sizing: border-box;
}
.checkout-overlay.open { display: flex; }
.checkout-modal {
  background: #fff; border-radius: 20px; box-sizing: border-box;
  width: 100%; max-width: min(460px, 100%);
  margin: 8px 0; padding: 28px 20px 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  max-height: 90vh; overflow-y: auto; overflow-x: hidden;
}
.checkout-modal h2 { font-family: 'Fredoka One', cursive; font-size: 1.4rem; color: #1a1d26; margin-bottom: 4px; }
.checkout-modal .checkout-subtitle { font-size: .85rem; color: #888; margin-bottom: 20px; }
.checkout-close { float: right; background: none; border: none; font-size: 1.3rem; cursor: pointer; color: #888; line-height: 1; }
.checkout-field { margin-bottom: 14px; }
.checkout-field label { display: block; font-size: .8rem; font-weight: 700; color: #1a1d26; margin-bottom: 5px; }
.checkout-field input,
.checkout-field select {
  width: 100%; padding: 11px 14px; border: 2px solid #e5e7eb;
  border-radius: 10px; font-size: .95rem; font-family: 'Nunito', sans-serif;
  outline: none; transition: border-color .2s; background: #fff;
}
.checkout-field input:focus,
.checkout-field select:focus { border-color: #f5c518; }
.checkout-field select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.checkout-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkout-section-title {
  font-size: .8rem; font-weight: 700; color: #1a1d26;
  margin: 16px 0 10px; padding-top: 14px; border-top: 1.5px solid #f0f0f0;
}
/* payment methods */
.checkout-methods { display: flex; gap: 10px; margin-bottom: 20px; }
.method-card {
  flex: 1; border: 2px solid #e5e7eb; border-radius: 12px;
  padding: 14px 10px; cursor: pointer; text-align: center;
  transition: border-color .2s, background .2s;
  display: flex; align-items: center; justify-content: center; min-height: 56px;
}
.method-card.selected { border-color: #f5c518; background: #fffbea; }
.method-card .method-logo { display: block; max-height: 40px; width: auto; max-width: 100%; object-fit: contain; }
/* order bump */
.order-bump-section {
  background: linear-gradient(135deg,#fff8e1 0%,#fffde7 100%);
  border: 2px dashed #f5c518; border-radius: 14px;
  padding: 12px 10px; margin: 16px 0; overflow: hidden;
}
.order-bump-title {
  font-family: 'Fredoka One', cursive; font-size: .92rem; color: #b45309;
  text-align: center; margin-bottom: 10px; line-height: 1.35;
}
.order-bump-title span {
  background: #f5c518; color: #1a1d26;
  padding: 1px 8px; border-radius: 20px; font-size: .75rem; margin-left: 4px;
}
.bump-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.bump-card {
  background: #fff; border: 2px solid #e5e7eb; border-radius: 10px;
  padding: 6px; cursor: pointer; transition: border-color .2s, box-shadow .2s;
  display: flex; align-items: center; gap: 6px; overflow: hidden;
}
.bump-card:hover { border-color: #f5c518; }
.bump-card.selected { border-color: #16a34a; background: #f0fdf4; box-shadow: 0 0 0 2px #bbf7d0; }
.bump-card img { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; flex-shrink: 0; }
.bump-info { flex: 1; min-width: 0; }
.bump-name { font-size: .7rem; font-weight: 700; color: #1a1d26; line-height: 1.2; margin-bottom: 2px; }
.bump-price { font-size: .85rem; font-weight: 800; color: #16a34a; }
.bump-check {
  width: 18px; height: 18px; border: 2px solid #d1d5db; border-radius: 50%;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: .7rem; color: #fff; background: #fff; transition: background .2s, border-color .2s;
}
.bump-card.selected .bump-check { background: #16a34a; border-color: #16a34a; }
/* totals + pay button */
.checkout-total {
  display: flex; justify-content: space-between; align-items: center;
  background: #f9f9f9; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 18px; font-weight: 700;
}
.checkout-total .total-value { color: #e63946; font-size: 1.2rem; }
.btn-pay {
  width: 100%; background: #22965c; color: #fff; border: none;
  padding: 15px; border-radius: 12px; font-size: 1rem; font-weight: 800;
  cursor: pointer; transition: background .2s;
}
.btn-pay:disabled { background: #aaa; cursor: not-allowed; }
.btn-pay:not(:disabled):hover { background: #1a7a4a; }
/* checkout error */
.checkout-error {
  display: none; background: #fff0f0; border: 1.5px solid #e63946;
  color: #c0392b; border-radius: 10px; padding: 10px 14px;
  font-size: .85rem; font-weight: 700; margin-bottom: 14px;
}
.checkout-error.show { display: block; }
/* pay result */
.pay-result { display: none; text-align: center; padding: 12px 0; }
.pay-result.show { display: block; }
.pay-result .result-icon { font-size: 3rem; margin-bottom: 10px; }
.pay-result h3 { font-family: 'Fredoka One', cursive; font-size: 1.3rem; margin-bottom: 8px; }
.pay-result p { font-size: .9rem; color: #555; }
.ref-box {
  background: #f0faf4; border: 2px solid #22965c;
  border-radius: 12px; padding: 14px; margin-top: 14px; text-align: left;
}
.ref-box .ref-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: .9rem; }
.ref-box .ref-row:last-child { margin-bottom: 0; }
.ref-box .ref-label { color: #555; }
.ref-box .ref-val { font-weight: 800; color: #1a1d26; }

/* ── Footer ──────────────────────────────────────── */
.footer {
  background: #1a1d26; color: #fff;
  padding: 32px 16px; margin-top: 48px; text-align: center;
}
.footer h3 { font-family: 'Fredoka One', cursive; color: #f5c518; }
.footer p { color: rgba(255,255,255,.6); font-size: .85rem; margin-top: 8px; }
.footer .copy { color: rgba(255,255,255,.4); font-size: .75rem; margin-top: 16px; }

/* Grade vazia / esgotado */
.grid-soldout {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  background: linear-gradient(135deg, #fef3c7 0%, #fff7ed 100%);
  border: 2px dashed #f59e0b;
  border-radius: 16px;
  max-width: 520px;
  margin: 0 auto;
}
.grid-soldout__title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.5rem;
  color: #b45309;
  margin: 0 0 12px;
}
.grid-soldout__text { color: #78716c; font-size: 0.95rem; margin: 0; line-height: 1.5; }

/* ── Responsive ──────────────────────────────────── */
@media(max-width:1024px) { .grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width:768px) {
  .nav-links, .sidebar { display: none; }
  .main { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
  .hero img { height: 200px; }
  .hero h2 { font-size: 1.5rem; }
  .modal-body { flex-direction: column; }
  .modal-img, .modal-content { width: 100%; }
  .modal { max-height: 88dvh; }
  .modal-img { flex-shrink: 0; max-height: min(32vh,220px); display: flex; align-items: center; justify-content: center; }
  .modal-img img { aspect-ratio: unset; max-height: min(32vh,220px); width: 100%; height: auto; object-fit: contain; }
  .modal-content { padding: 12px 14px 14px; }
  .modal-content h2 { font-size: 1.15rem; }
  .modal-content .desc { font-size: .8rem; -webkit-line-clamp: 5; }
  .modal-price-area { margin-top: 10px; padding-top: 10px; }
  .box { min-width: 52px; padding: 10px; }
  .box span { font-size: 1.3rem; }
}
