:root {
  --brand: #111;
  --accent: #c8102e;
}

body { font-family: 'Poppins', sans-serif; color: #222; }
a { text-decoration: none; }

.topbar { background: var(--brand); color: #fff; }
.brand { font-weight: 700; letter-spacing: 6px; font-size: 1.7rem; color: var(--brand); }

/* Navigation */
.navbar-nav .nav-link { font-size: .85rem; font-weight: 500; text-transform: uppercase; padding: .9rem .9rem; color: #222; }
.navbar-nav .nav-link:hover { color: var(--accent); }
.nav-sale { color: var(--accent) !important; font-weight: 600; }
@media (min-width: 992px) {
  .navbar .dropdown:hover > .dropdown-menu { display: block; margin-top: 0; }
}
.dropdown-menu { border: 0; border-radius: 0; box-shadow: 0 8px 20px rgba(0,0,0,.1); }
.dropdown-item { font-size: .85rem; padding: .45rem 1.2rem; }
.dropdown-item:hover { background: #f5f5f5; color: var(--accent); }

/* Hero */
.carousel-item img { object-fit: cover; min-height: 220px; max-height: 650px; }
.hero-caption {
  position: absolute; left: 8%; top: 50%; transform: translateY(-50%);
  color: #fff; max-width: 440px; text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.hero-caption h2 { font-weight: 700; font-size: clamp(1.4rem, 4vw, 3rem); }
.hero-caption p { font-size: clamp(.8rem, 1.6vw, 1.1rem); }
@media (max-width: 575px) { .hero-caption .btn { padding: .25rem .7rem; font-size: .8rem; } }

/* Sections */
.section-title { font-weight: 600; text-transform: uppercase; letter-spacing: 2px; font-size: 1.4rem; margin-bottom: 1.5rem; position: relative; }
.section-title::after { content: ''; display: block; width: 50px; height: 3px; background: var(--accent); margin: .6rem auto 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 1.5rem; }
.section-head .section-title { margin: 0; }
.section-head .section-title::after { margin-left: 0; }
.more-link { font-size: .85rem; color: var(--brand); font-weight: 500; border-bottom: 1px solid var(--brand); }

/* Product card */
.product-card { border: 0; transition: transform .25s; }
.product-card:hover { transform: translateY(-4px); }
.product-card .img-wrap { position: relative; overflow: hidden; background: #f3f3f3; aspect-ratio: 3 / 4; }
.product-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover img { transform: scale(1.06); }
.sale-badge { position: absolute; top: 10px; left: 10px; background: var(--accent); color: #fff; font-size: .7rem; padding: 2px 8px; border-radius: 2px; z-index: 1; }
.product-card .card-title { font-size: .85rem; font-weight: 500; margin: .7rem 0 .2rem; color: #222; }
.price { font-weight: 600; }
.price del { color: #999; font-weight: 400; font-size: .85rem; margin-left: 6px; }
.product-card .btn { font-size: .8rem; }

/* Outlets */
.outlet-card { background: #fff; border-left: 3px solid var(--accent); padding: 1rem; height: 100%; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.outlet-card i { color: var(--accent); }

/* Footer */
.footer-links li { margin-bottom: .4rem; }
.footer-links a, footer a { color: rgba(255,255,255,.6); }
.footer-links a:hover, footer a:hover { color: #fff; }

/* Cart */
.cart-item img { width: 64px; height: 80px; object-fit: cover; }
#cartCount { font-size: .6rem; }

/* Extra space kept free at the bottom on phones. Fixed bars already sit above browser toolbars, so this stays 0;
   raise it only if a toolbar covers the bottom of the page. --app-h is the visible height, set by layout.js */
:root { --bottom-ui: 0px; }

#toTop { position: fixed; right: 18px; bottom: 18px; width: 42px; height: 42px; display: none; z-index: 1030; }

/* ---------- Inner pages ---------- */
.page-hero { background: #f5f5f5; padding: 1.6rem 0; border-bottom: 1px solid #eee; }
.page-hero h1 { font-size: 1.6rem; font-weight: 600; margin: 0; }
.page-hero .breadcrumb { font-size: .8rem; }
.page-hero .breadcrumb a { color: #666; }

a.img-wrap { display: block; }
.main-img { position: relative; background: #f3f3f3; aspect-ratio: 3 / 4; overflow: hidden; }
.main-img img { width: 100%; height: 100%; object-fit: cover; }
.thumb { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; cursor: pointer; border: 2px solid transparent; }
.thumb.active, .thumb:hover { border-color: var(--brand); }
.qty-group { max-width: 150px; }
.btn-check:checked + .btn-outline-dark { background: var(--brand); color: #fff; }
#sizeList .btn.active { background: var(--brand); color: #fff; }

.filter-title { text-transform: uppercase; letter-spacing: 1px; font-size: .8rem; border-bottom: 1px solid #ddd; padding-bottom: .5rem; margin-bottom: .8rem; }

.summary-box { background: #f8f8f8; border-radius: 6px; padding: 1.5rem; }
.stat { font-size: 2.2rem; font-weight: 700; color: var(--accent); }
.doc h5 { margin-top: 1.5rem; font-weight: 600; }
.doc { max-width: 820px; }

.track-steps { display: flex; justify-content: space-between; position: relative; }
.track-steps::before { content: ''; position: absolute; top: 20px; left: 10%; right: 10%; height: 3px; background: #ddd; }
.track-steps .step { flex: 1; text-align: center; position: relative; color: #999; }
.track-steps .dot { width: 42px; height: 42px; border-radius: 50%; background: #ddd; display: inline-flex; align-items: center; justify-content: center; margin-bottom: .3rem; color: #fff; }
.track-steps .done { color: var(--brand); }
.track-steps .done .dot { background: var(--brand); }

/* ---------- Variants, filters, pagination ---------- */
.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); margin-right: 6px; vertical-align: -1px; }
.btn-check:disabled + .btn { opacity: .45; }
#colorList .btn.active, #sizeList .btn.active { background: var(--brand); color: #fff; }
.pagination .page-link { color: var(--brand); }
.pagination .page-item.active .page-link { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Product gallery (swipe on mobile, thumbnails on desktop) ---------- */
.gallery-track { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-y: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.gallery-count { position: absolute; right: 10px; bottom: 10px; z-index: 1; background: rgba(0,0,0,.55); color: #fff; font-size: .72rem; padding: 2px 9px; border-radius: 10px; }
@media (min-width: 768px) { .gallery-track { overflow: hidden; } }
/* Hover zoom (desktop mouse): image scales up inside its box, clipped by the track */
@media (hover: hover) and (pointer: fine) {
  .gallery-track img { transition: transform .2s ease-out; cursor: zoom-in; }
  .gallery-track img.zoomed { transform: scale(2.2); }
}

/* ---------- App-style bottom nav (phones) ---------- */
.app-nav { display: none; }
@media (max-width: 767.98px) {
  :root { --nav-h: 58px; }
  .app-nav {
    position: fixed; left: 0; right: 0; bottom: var(--bottom-ui); z-index: 1036; background: #fff;
    display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid #e5e5e5; box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  }
  .app-nav > a, .app-nav > button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: none; border: 0; padding: 0; color: #6c757d; font-size: .68rem; text-decoration: none;
  }
  .app-nav i { font-size: 1.3rem; line-height: 1; }
  .app-nav .active { color: #000; font-weight: 600; }
  .app-nav-badge { position: absolute; top: 6px; left: calc(50% + 4px); font-size: .6rem; padding: .25em .45em; }
  body { padding-bottom: calc(var(--nav-h) + var(--bottom-ui) + env(safe-area-inset-bottom)); }
}

/* ---------- Mobile product page: shorter image, sticky buy bar ---------- */
.mobile-buy {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h, 0px) + var(--bottom-ui) + env(safe-area-inset-bottom)); z-index: 1035; background: #fff;
  display: flex; align-items: center; gap: .5rem;
  padding: .6rem 16px;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08); transform: translateY(110%); transition: transform .25s ease;
}
.mobile-buy.show { transform: none; }
.mobile-buy .btn { padding: .5rem .75rem; font-size: .82rem; white-space: nowrap; }
@media (max-width: 767.98px) {
  .main-img { aspect-ratio: 1 / 1; }
  /* thumbnail strip: small, one scrolling row */
  #thumbs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; position: relative; }
  #thumbs::-webkit-scrollbar { display: none; }
  #thumbs .thumb { flex: 0 0 64px; width: 64px; }
  #thumbs .thumb { border-width: 2px; }
  .product-hero-title { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body.has-mobile-buy { padding-bottom: calc(72px + var(--nav-h) + var(--bottom-ui) + env(safe-area-inset-bottom)); }
  #toTop { bottom: calc(var(--nav-h) + 14px + var(--bottom-ui) + env(safe-area-inset-bottom)); }
  body.has-mobile-buy #toTop { bottom: calc(var(--nav-h) + 82px + var(--bottom-ui) + env(safe-area-inset-bottom)); }
  .toast-container { bottom: calc(var(--nav-h) + var(--bottom-ui) + env(safe-area-inset-bottom)) !important; }
  body.has-mobile-buy .toast-container { bottom: calc(var(--nav-h) + 70px + var(--bottom-ui) + env(safe-area-inset-bottom)) !important; }
}
@media (max-width: 767.98px) {
  #productWrap .nav-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  #productWrap .nav-tabs .nav-link { white-space: nowrap; }
}

/* ---------- Drawers on mobile: fit the visible screen (browser toolbars), pin the cart summary ---------- */
.offcanvas-start, .offcanvas-end { height: 100vh; height: 100dvh; height: var(--app-h, 100dvh); bottom: auto; }
#cartCanvas .offcanvas-body { overflow: hidden; padding-bottom: 0; }
#cartCanvas #cartItems { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
#cartCanvas .offcanvas-body > .border-top { flex: 0 0 auto; padding-bottom: calc(1rem + var(--bottom-ui) + env(safe-area-inset-bottom)); background: #fff; }
@media (max-width: 575.98px) {
  #cartCanvas { --bs-offcanvas-width: min(92vw, 400px); }
}

/* Cart drawer buttons: View Cart + Checkout side by side on phones to save height */
@media (max-width: 575.98px) {
  #cartCanvas .cart-actions { display: flex; gap: .5rem; margin-bottom: .25rem; }
  #cartCanvas .cart-actions .btn { flex: 1; margin: 0 !important; width: auto !important; }
  #cartCanvas .offcanvas-body > .border-top > .btn-link { padding-top: .25rem; padding-bottom: .25rem; }
}
footer.bg-dark { padding-bottom: var(--bottom-ui); }

/* ---------- Customer account ---------- */
/* .outlet-card is height:100% for card grids; inside the account columns that would stretch every card to the column height */
.account-page .outlet-card { height: auto; }
.account-nav .list-group-item { color: var(--brand); }
.account-nav .list-group-item.active { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (max-width: 991.98px) {
  /* phones/tablets: the account menu becomes one scrollable row so the content starts higher */
  .account-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; border-radius: 6px; }
  .account-nav::-webkit-scrollbar { display: none; }
  .account-nav .list-group-item { flex: 0 0 auto; width: auto; white-space: nowrap; border-radius: 0; border-width: 0 1px 0 0; }
  .account-nav .list-group-item:last-child { border-right-width: 0; }
}

/* Developer credit (footer) */
.dev-credit a {
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(90deg, #f6d365, #fda085, #ff5f6d, #f6d365);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: devCreditShine 3s linear infinite;
  display: inline-block;
  transition: transform .25s ease;
}
.dev-credit a::before { content: "\2665\00a0"; display: inline-block; animation: devCreditBeat 1.4s ease-in-out infinite; }
.dev-credit a:hover { transform: scale(1.08); }
@keyframes devCreditShine { to { background-position: -300% 0; } }
@keyframes devCreditBeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
@media (prefers-reduced-motion: reduce) { .dev-credit a, .dev-credit a::before { animation: none; } }

/* Footer social icons */
.footer-social { display: flex; flex-wrap: wrap; gap: .6rem; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: rgba(255,255,255,.1); font-size: 1.1rem;
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}
.footer-social a:hover { transform: translateY(-4px) scale(1.1); background: #ff5f6d; box-shadow: 0 6px 14px rgba(255,95,109,.4); }
.footer-social a:has(.bi-facebook):hover { background: #1877f2; box-shadow: 0 6px 14px rgba(24,119,242,.4); }
.footer-social a:has(.bi-instagram):hover { background: #e1306c; box-shadow: 0 6px 14px rgba(225,48,108,.4); }
.footer-social a:has(.bi-youtube):hover { background: #f00; box-shadow: 0 6px 14px rgba(255,0,0,.4); }
.footer-social a:has(.bi-linkedin):hover { background: #0a66c2; box-shadow: 0 6px 14px rgba(10,102,194,.4); }

/* ---------- Product page (pdp) ---------- */
.pdp { font-family: 'Jost', 'Poppins', sans-serif; color: #222; padding-top: 14px; padding-bottom: 2rem; }
.pdp-crumbs { text-align: center; font-size: .68rem; text-transform: uppercase; letter-spacing: .02em; color: #777; margin-bottom: 14px; }
.pdp-crumbs a { color: #777; text-decoration: none; }
.pdp-crumbs a:hover { color: #111; }
.pdp-crumbs span { margin: 0 4px; }
.pdp-crumbs .current { margin: 0; }
.pdp .main-img { aspect-ratio: 1 / 1; background: #f6f6f6; border: 1px solid #eee; }
.pdp .main-img .sale-badge { top: 12px; left: 12px; border-radius: 0; }
.zoom-btn { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #fff; color: #111; display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.zoom-btn:hover { background: #111; color: #fff; }
.pdp #thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; position: relative; }
.pdp #thumbs .thumb { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid transparent; cursor: pointer; }
.pdp #thumbs .thumb.active { border-color: #111; }
.pdp #thumbs .thumb:not(.active) { opacity: .85; }

.pdp-title { font-size: 1.35rem; font-weight: 500; text-transform: uppercase; letter-spacing: -.01em; line-height: 1.2; color: #111; margin: 6px 0 12px; }
.pdp-price { font-size: 1rem; color: #444; margin-bottom: 14px; }
.pdp-price del { color: #999; font-size: .85rem; margin-left: 8px; }
.pdp-short { font-size: .82rem; line-height: 1.5; color: #333; margin-bottom: 18px; }
.pdp-row { display: flex; gap: 12px; margin-bottom: 14px; }
.pdp-label { flex: 0 0 82px; font-size: .8rem; font-weight: 500; color: #111; padding-top: 9px; }
.pdp-row.align-items-center .pdp-label { padding-top: 0; }
.pdp-options { flex: 1; min-width: 0; }
.pdp .pdp-opt { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 2px; border: 1px solid #111; font-size: .75rem; font-weight: 500; color: #111; background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.pdp .pdp-opt:hover { background: #f1f1f1; color: #111; }
.pdp .btn-check:checked + .pdp-opt { background: #111; color: #fff; }
.pdp .btn-check:focus-visible + .pdp-opt { outline: 2px solid #727cf5; outline-offset: 2px; }
.pdp-guide { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; margin: 6px 0 10px; font-size: .75rem; font-weight: 500; text-transform: uppercase; color: #111; }
.pdp-guide i { font-size: 1.1rem; }
.pdp-guide span { text-decoration: underline; text-underline-offset: 2px; }
.pdp-perks { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 0 0 16px; font-size: .75rem; color: #333; }
.pdp-perks i { margin-right: 4px; }
.pdp-qty { display: inline-flex; border: 1px solid #111; height: 36px; }
.pdp-qty button { width: 34px; border: 0; background: #fff; font-size: 1.1rem; line-height: 1; color: #111; }
.pdp-qty button:hover { background: #f1f1f1; }
.pdp-qty input { width: 46px; border: 0; border-left: 1px solid #ddd; border-right: 1px solid #ddd; text-align: center; font-size: .85rem; outline: 0; }
.pdp-buttons { display: grid; gap: 8px; margin-bottom: 26px; }
.pdp-btn { width: 100%; height: 42px; border: 1px solid #7d7d7d; background: #7d7d7d; color: #fff; text-transform: uppercase; font-weight: 600; font-size: .8rem; letter-spacing: .03em; transition: background .2s, color .2s, border-color .2s; }
.pdp-btn-buy { background: #fff; color: #555; }
.pdp-btn.is-ready { background: #111; border-color: #111; color: #fff; }
.pdp-btn-buy.is-ready { background: #fff; color: #111; }
.pdp-btn-buy.is-ready:hover { background: #111; color: #fff; }
.pdp-btn:disabled { opacity: .5; cursor: not-allowed; }

.pdp-tabs .nav { gap: 18px; margin-bottom: 8px; flex-wrap: wrap; }
.pdp-tabs .nav-link { padding: 0; border: 0; background: none; font-size: .78rem; font-weight: 600; text-transform: uppercase; color: #111; border-radius: 0; display: inline-flex; align-items: center; gap: 4px; }
.pdp-tabs .nav-link i { font-size: .6rem; }
.pdp-tabs .nav-link.active { text-decoration: underline; text-underline-offset: 3px; background: none; color: #111; }
.pdp-tabs .tab-content { font-size: .8rem; color: #333; }
.pdp-table, .pdp-description table { width: 100%; font-size: .8rem; border-collapse: collapse; }
.pdp-table td, .pdp-description td, .pdp-description th { padding: 9px 7px; border-bottom: 1px solid #eee; vertical-align: top; }
.pdp-table td:first-child { width: 130px; color: #333; }
.pdp-description { margin-top: 10px; line-height: 1.55; }
.pdp-meta { margin-top: 22px; font-size: .78rem; display: grid; gap: 6px; }
.pdp-meta a { color: #333; text-decoration: none; font-size: .72rem; }
.pdp-meta a:hover { text-decoration: underline; }
@media (max-width: 767.98px) {
  .pdp-crumbs { text-align: left; }
  .pdp-label { flex-basis: 66px; }
  .pdp .main-img { border: 0; }
  .pdp #thumbs { display: flex; overflow-x: auto; scrollbar-width: none; }
  .pdp #thumbs .thumb { flex: 0 0 64px; width: 64px; }
}

/* ---------- Cart page on phones: one card per item instead of a squeezed table ---------- */
.cart-table .cart-qty .input-group { width: 112px; }
.cart-table .cart-qty .form-control { min-width: 0; padding-left: 0; padding-right: 0; }
.cart-table .cart-qty .btn { width: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 767.98px) {
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody { display: block; }
  .cart-table tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "prod remove" "qty total"; gap: .5rem 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid #e5e5e5; }
  .cart-table td { display: block; border: 0; padding: 0; }
  .cart-table td:first-child { grid-area: prod; }
  .cart-table .cart-remove { grid-area: remove; align-self: start; }
  .cart-table .cart-qty { grid-area: qty; }
  .cart-table .cart-total { grid-area: total; }
}
