:root {
  --bg-dark: #202020;
  --bg-light: #f4f3f0;
  --accent: #d85a30;
  --text-light: #ffffff;
  --text-dark: #1a1a1a;
  --text-muted: #6b6b68;
  --border: #2a2a2a;
  --header-height: 240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif; font-weight: 800; letter-spacing: -.3px; color: var(--text-dark); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Header - fixed at top; only the content below (main + footer) scrolls */
.site-header {
  background: var(--bg-dark); color: var(--text-light);
  position: fixed; top: 0; left: 0; right: 0; width: 100%;
  height: var(--header-height); z-index: 1000;
  box-shadow: 0 2px 14px rgba(0,0,0,.4);
}
.header-inner {
  max-width: 1400px; margin: 0 auto; height: 100%; padding: 0 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.logo img { height: 150px; width: auto; }
.main-nav { display: flex; gap: 34px; flex: 1; justify-content: center; }
.main-nav a {
  font-size: 16px; letter-spacing: 1px; font-weight: 600; color: #eee;
  padding: 8px 0; border-bottom: 2px solid transparent; transition: border-color .2s;
}
.main-nav a:hover, .main-nav a.active { border-color: var(--accent); }
.header-icons { display: flex; gap: 24px; align-items: center; }
.icon-link { position: relative; color: #fff; display: inline-flex; }
.cart-badge {
  position: absolute; top: -9px; right: -12px; background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 700; border-radius: 50%;
  min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.nav-toggle {
  display: none; background: none; border: none; color: #fff; cursor: pointer; padding: 4px;
}

/* Push page content below the fixed header, and leave room above the fixed cookie banner */
main.site-main { padding-top: var(--header-height); padding-bottom: 110px; }

/* Footer */
.site-footer { background: var(--bg-dark); color: #ccc; padding: 40px 40px 28px; margin-top: 64px; }
.footer-inner { max-width: 1400px; margin: 0 auto; }
.footer-top { text-align: left; margin-bottom: 28px; }
.footer-logo { height: 52px; margin: 0; }
.footer-divider { border-top: 1px solid #262626; margin-bottom: 20px; }
.footer-copy { text-align: center; font-size: 13px; color: #888; margin: 0; }

/* Back to top button */
.back-to-top {
  position: fixed; right: 24px; bottom: 90px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.35); z-index: 1100;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { opacity: .9; }

/* Cookie consent banner - hidden by default; JS adds .show to reveal it.
   (Do not rely on the HTML `hidden` attribute here: an author display:flex
   rule on the same element always wins over the UA [hidden] rule, so toggling
   .hidden in JS would have no visible effect.) */
.cookie-consent {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200;
  background: var(--bg-dark); color: #eee; padding: 16px 24px;
  align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  box-shadow: 0 -2px 14px rgba(0,0,0,.4);
}
.cookie-consent.show { display: flex; }
.cookie-consent p { margin: 0; font-size: 13px; max-width: 720px; color: #ccc; }
.cookie-consent .btn { flex-shrink: 0; }

/* Hero slider (home) */
.hero-slider { position: relative; overflow: hidden; height: 48vh; min-height: 304px; background: var(--bg-dark); }
.hero-slides { display: flex; height: 100%; transition: transform .7s ease; }
.hero-slide { flex: 0 0 100%; height: 100%; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-dots { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,.5); cursor: pointer; padding: 0; }
.hero-dot.active { background: #fff; }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(255,255,255,.85);
  color: var(--text-dark); display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.3); opacity: .85; transition: opacity .2s;
}
.hero-arrow:hover { opacity: 1; }
.hero-arrow-prev { left: 16px; }
.hero-arrow-next { right: 16px; }

/* Page content container */
.container { max-width: 1400px; margin: 0 auto; padding: 40px 32px; }
.page-content h1 {
  font-size: 34px; font-weight: 800; margin: 0 0 24px; padding-bottom: 20px;
  border-bottom: 1px solid #e2e0da;
}
.page-content { min-height: 40vh; }
.page-hero { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: start; margin-bottom: 40px; }
.page-hero .page-hero-img { border-radius: 8px; overflow: hidden; background: #eee; }
.page-hero .page-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.page-hero .page-hero-text { font-size: 15px; color: #656463; }
.page-hero .page-hero-text p { margin: 0 0 22px; line-height: 1.8; }
.page-hero .page-hero-text p:last-child { margin-bottom: 0; }
.page-hero.no-image { grid-template-columns: 1fr; }

/* Shop toolbar */
.shop-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1400px; margin: 0 auto; padding: 24px 32px 0; flex-wrap: wrap; gap: 12px;
}
.shop-toolbar label { color: #888; font-size: 13px; }
.shop-toolbar select, .shop-toolbar .view-toggle button {
  font-size: 13px; padding: 8px 12px; border: 1px solid #ccc; background: #fff; border-radius: 4px; color: #555;
}
.view-toggle { display: flex; gap: 6px; }
.view-toggle button.active { background: var(--bg-dark); color: #fff; border-color: var(--bg-dark); }

/* Product grid */
.product-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px;
  max-width: 1400px; margin: 0 auto; padding: 24px 32px 60px;
}
.product-grid.product-grid-4col { grid-template-columns: repeat(4, 1fr); }
.product-grid.list-view { grid-template-columns: 1fr; }
.product-card { background: #fff; }
.product-card .thumb-wrap { position: relative; }
.product-card .thumb-link { display: block; }
.product-card .meta-link { display: block; }
.product-card .thumb { aspect-ratio: 1/1; overflow: hidden; background: #111; position: relative; }
.product-card .thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .45s ease; }
.product-card .thumb-img-secondary { opacity: 0; }
.product-card:hover .thumb-img-primary { opacity: 0; }
.product-card:hover .thumb-img-secondary { opacity: 1; }
.cart-icon-btn {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.95); border: none; display: flex; align-items: center; justify-content: center;
  color: var(--text-dark); cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.25); opacity: .9; transition: opacity .2s, transform .15s;
}
.cart-icon-btn:hover { opacity: 1; transform: scale(1.08); }
.product-card .meta { padding: 12px 4px; }
.product-card .cat { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .8px; font-weight: 500; }
.product-card .name { font-size: 15px; font-weight: 500; margin: 4px 0; color: var(--text-dark); }
.product-card .price { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.list-add-btn {
  display: none; background: var(--bg-dark); color: #fff; border: none; padding: 10px 18px;
  font-size: 13px; font-weight: 600; letter-spacing: .5px; border-radius: 4px; cursor: pointer; margin-top: 10px;
}
.list-add-btn:hover { opacity: .9; }
.product-grid.list-view .product-card {
  display: flex; flex-wrap: wrap; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid #eee; align-items: flex-start;
}
.product-grid.list-view .product-card .thumb-wrap { width: 220px; flex-shrink: 0; }
.product-grid.list-view .product-card .meta-link { flex: 1; min-width: 180px; }
.product-grid.list-view .list-add-btn { display: inline-block; }

/* Forms */
.form-card { max-width: 480px; margin: 0 auto; background: #fff; padding: 32px; border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px;
}
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  padding: 12px 24px; font-size: 14px; font-weight: 600; border-radius: 4px; cursor: pointer;
}
.btn:hover { opacity: .9; }
.btn-dark { background: var(--bg-dark); }
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fdecea; color: #b3261e; }
.alert-success { background: #e6f4ea; color: #1e7a34; }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.product-detail .gallery img { border-radius: 6px; margin-bottom: 10px; }
.product-detail .price { font-size: 24px; font-weight: 700; margin: 12px 0; color: var(--accent); }
.spec-list { list-style: none; margin: 0 0 16px; padding: 0; }
.spec-list li { font-size: 14px; padding: 7px 0; border-bottom: 1px solid #f0f0ee; }
.spec-list li:last-child { border-bottom: none; }
.product-notes { font-size: 14px; color: #555; margin-bottom: 16px; }

/* Contact info list with icons - for use inside CMS page content (Admin > Page content) */
.contact-info-list { list-style: none; margin: 0; padding: 0; }
.contact-info-item { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.contact-info-icon {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--bg-dark); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.contact-info-text { font-size: 15px; color: #444; line-height: 1.6; padding-top: 7px; }
.contact-info-text a:hover { color: var(--accent); }

/* Hanging indent - for manually-numbered paragraphs in CMS content.
   Uses flexbox so the wrapped line after <br> aligns exactly under the
   text (not the number), based on the number's real rendered width -
   no guessing at font metrics needed. */
.hanging-indent { display: flex; gap: .4em; margin-bottom: 18px; line-height: 1.8; }
.hanging-indent .num { flex-shrink: 0; }

/* PayPal "Buy Now" style messaging banner shown under Add to Cart buttons */
.paypal-banner {
  background: #ffc439; border-radius: 6px; padding: 12px 16px; text-align: center;
  margin-top: 16px; font-size: 16px;
}
.paypal-banner .pp-pay { font-weight: 800; color: #003087; }
.paypal-banner .pp-pal { font-weight: 800; color: #009cde; }
.paypal-banner .pp-label { color: #2c2e2f; font-weight: 600; margin-left: 4px; }
.paypal-subtext { text-align: center; font-size: 12px; color: #888; margin: 6px 0 0; }

/* Quick view modal */
.quickview-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1300;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.quickview-overlay[hidden] { display: none; }
.quickview-modal {
  background: #fff; border-radius: 8px; max-width: 960px; width: 100%; max-height: 90vh;
  overflow-y: auto; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.quickview-close {
  position: absolute; top: 16px; right: 16px; background: none; border: none; cursor: pointer;
  color: var(--text-dark); z-index: 2; padding: 6px;
}
.quickview-body { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 32px; }
.quickview-main-img { aspect-ratio: 1/1; background: #111; border-radius: 6px; overflow: hidden; }
.quickview-main-img img { width: 100%; height: 100%; object-fit: cover; }
.quickview-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.quickview-thumbs img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 4px; cursor: pointer;
  border: 2px solid transparent; opacity: .7;
}
.quickview-thumbs img:hover, .quickview-thumbs img.active { border-color: var(--accent); opacity: 1; }
.quickview-info h2 { margin: 0 0 6px; font-size: 24px; }
.quickview-price { font-size: 22px; font-weight: 700; color: var(--accent); margin-bottom: 14px; }
.quickview-desc { font-size: 14px; color: #444; white-space: pre-line; margin-bottom: 14px; line-height: 1.7; }
.quickview-category { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.quickview-actions { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.qty-stepper { display: flex; align-items: center; border: 1px solid #ccc; border-radius: 4px; overflow: hidden; }
.qty-stepper button {
  width: 36px; height: 40px; border: none; background: #f4f3f0; font-size: 16px; cursor: pointer;
}
.qty-stepper input {
  width: 48px; height: 40px; border: none; border-left: 1px solid #ccc; border-right: 1px solid #ccc;
  text-align: center; font-size: 14px;
}
.quickview-share { display: flex; gap: 10px; }
.quickview-share a {
  width: 34px; height: 34px; border-radius: 50%; background: #f4f3f0; color: var(--text-dark);
  display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.quickview-share a:hover { background: #e4e2db; }

/* Checkout step breadcrumb (Shopping Cart > Checkout > Order Complete) */
.checkout-steps { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 32px; flex-wrap: wrap; }
.checkout-step { font-size: 15px; font-weight: 700; color: #bbb; }
.checkout-step.active { color: var(--text-dark); }
.checkout-step.done { color: var(--accent); }
.checkout-step-sep { color: #ccc; font-size: 18px; }

/* Cart / checkout table */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.cart-table { width: 100%; border-collapse: collapse; min-width: 560px; }
table.cart-table th, table.cart-table td { padding: 14px 12px; border-bottom: 1px solid #eee; text-align: left; font-size: 14px; }
table.cart-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); }

.cart-item-cell { display: flex; align-items: center; gap: 14px; }
.cart-item-thumb { position: relative; width: 64px; height: 64px; flex-shrink: 0; border-radius: 4px; overflow: hidden; background: #111; }
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-thumb form { position: absolute; top: -4px; right: -4px; margin: 0; }
.cart-item-remove {
  width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #333; border: 1px solid #ccc;
  font-size: 13px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.cart-item-remove:hover { background: #b3261e; color: #fff; border-color: #b3261e; }

.qty-stepper-sm { display: inline-flex; }
.qty-stepper-sm button { width: 30px; height: 34px; font-size: 14px; }
.qty-stepper-sm input { width: 40px; height: 34px; }

.coupon-row { margin-top: 20px; }
.coupon-form { display: flex; gap: 10px; max-width: 360px; flex-wrap: wrap; }
.coupon-form input { flex: 1; min-width: 160px; padding: 10px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
.coupon-applied { background: #e6f4ea; color: #1e7a34; padding: 12px 16px; border-radius: 4px; font-size: 14px; display: flex; align-items: center; gap: 12px; }
.coupon-remove-btn { background: none; border: none; color: #1e7a34; text-decoration: underline; cursor: pointer; font-size: 13px; padding: 0; }

/* Cart layout (items left, totals box right) */
.cart-layout { display: flex; gap: 40px; align-items: flex-start; flex-wrap: wrap; }
.cart-main { flex: 1 1 480px; min-width: 0; }
.cart-totals-box {
  flex: 0 1 340px; min-width: 280px; background: #fff; border-radius: 8px; padding: 26px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
}
.cart-totals-box h2 { font-size: 17px; margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid #eee; }
.cart-totals-row { display: flex; justify-content: space-between; font-size: 14px; padding: 9px 0; border-bottom: 1px solid #f2f1ee; }
.cart-totals-row span:first-child { color: var(--text-muted); }
.cart-totals-line-item span:first-child { color: #444; }
.cart-totals-discount span { color: #1e7a34 !important; }
.cart-totals-total { border-bottom: none; padding-top: 14px; font-size: 17px; font-weight: 700; }
.cart-totals-total span:first-child { color: var(--text-dark); }
.cart-checkout-btn { display: block; width: 100%; text-align: center; margin-top: 16px; }

.checkout-layout { display: flex; gap: 48px; flex-wrap: wrap; }
.checkout-layout .form-card { flex: 1 1 320px; margin: 0; }
.checkout-layout .cart-totals-box { flex: 0 1 360px; }

/* ============ Responsive breakpoints ============ */

/* Tablet */
@media (max-width: 1100px) {
  .product-grid, .product-grid.product-grid-4col { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
  .header-inner { padding: 0 24px; gap: 20px; }
  .main-nav { gap: 20px; }
  .product-detail { gap: 28px; }
}

/* Tablet and below (iPad portrait/landscape included): hamburger dropdown nav */
@media (max-width: 1024px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0;
    background: var(--bg-dark);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
    z-index: 999;
    box-shadow: 0 10px 24px rgba(0,0,0,.45);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    justify-content: flex-start;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid #1f1f1f; width: 100%; font-size: 15px; }
}

/* Phone-only: shrink header further + stack layouts */
@media (max-width: 700px) {
  :root { --header-height: 100px; }
  .logo img { height: 64px; }
  .header-inner { padding: 0 16px; gap: 12px; }
  .header-left { gap: 10px; }
  .header-icons { gap: 16px; }

  .container { padding: 28px 18px; }
  .page-content h1 { font-size: 24px; }

  .hero-slider { height: 34vh; min-height: 176px; }
  .hero-arrow { width: 34px; height: 34px; }

  .shop-toolbar { padding: 18px 18px 0; }
  .product-grid, .product-grid.product-grid-4col { grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 18px 18px 40px; }
  .product-grid.list-view .product-card { flex-direction: column; }
  .product-grid.list-view .product-card .thumb-wrap { width: 100%; }

  .product-detail { grid-template-columns: 1fr; gap: 24px; }
  .page-hero { grid-template-columns: 1fr; gap: 20px; }

  .quickview-body { grid-template-columns: 1fr; gap: 20px; padding: 24px 18px; }
  .quickview-modal { max-height: 92vh; }

  .form-card { padding: 22px; }

  .checkout-layout { gap: 24px; }
  .checkout-layout .form-card, .checkout-layout .cart-totals-box { flex: 1 1 100%; }
  .cart-layout { gap: 20px; }
  .cart-main, .cart-totals-box { flex: 1 1 100%; }
  .coupon-form { max-width: 100%; }

  .back-to-top { right: 16px; bottom: 130px; width: 42px; height: 42px; }
  .cookie-consent { padding: 14px 18px; flex-direction: column; align-items: flex-start; }
}

/* Small phones */
@media (max-width: 420px) {
  .product-grid, .product-grid.product-grid-4col { grid-template-columns: 1fr; }
  .logo img { height: 52px; }
  :root { --header-height: 84px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) { .product-detail { grid-template-columns: 1fr; } }
