/*
Theme Name: End Loadshedding Storefront
Theme URI: https://new.endloadshedding.shop
Author: End Loadshedding
Description: Real-brand storefront theme for End Loadshedding — sage-green identity, best sellers and brand shelves on the homepage.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: els-storefront
*/

:root {
  --paper: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #e3e0d8;
  --ink: #14181f;
  --ink-soft: #1e2530;
  --ink-line: #2c3340;
  --text: #14181f;
  --text-on-dark: #f5f3ee;
  --text-muted: #6b6a62;
  --text-muted-on-dark: #9ba0ac;
  --accent: #96ab7d;
  --accent-deep: #87a06e;
  --accent-text: #51643c;
  --on-accent: #15160f;
  --ok: #3f6d99;
  --ok-tint: #e8eef5;
  --shadow: 0 10px 24px -14px rgba(20,24,31,0.28);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: 'Big Shoulders Display', 'Arial Narrow', sans-serif; text-wrap: balance; margin: 0; letter-spacing: 0.2px; }
.num { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Utility bar ---- */
.utility-bar { background: var(--ink); color: var(--text-muted-on-dark); font-size: 12px; border-bottom: 1px solid var(--ink-line); }
.utility-bar .wrap { display: flex; align-items: center; justify-content: space-between; height: 34px; gap: 14px; overflow-x: auto; }
.utility-bar a:hover { color: var(--text-on-dark); }
.utility-links { display: flex; gap: 16px; white-space: nowrap; }
.utility-tagline { white-space: nowrap; }

/* ---- Department mega-menu ---- */
.cat-nav-row { display: flex; align-items: center; gap: 16px; height: 42px; }
.dept-menu-wrap { position: relative; flex-shrink: 0; }
.dept-menu-trigger {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px;
  background: var(--accent); color: var(--on-accent); border: none; border-radius: 7px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.dept-menu-trigger:hover { background: var(--accent-deep); }
.dept-menu-panel {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  min-width: 260px; max-height: 70vh; overflow-y: auto; padding: 6px;
}
.dept-menu-panel.open { display: block; }
.dept-menu-panel a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 10px; border-radius: 7px; font-size: 13px; color: var(--text); font-weight: 500;
}
.dept-menu-panel a:hover { background: var(--surface-2); color: var(--accent-text); }
.dept-count { font-size: 11px; color: var(--text-muted); background: var(--surface-2); padding: 1px 7px; border-radius: 20px; }
.cat-nav-links { display: flex; gap: 2px; overflow-x: auto; flex: 1; min-width: 0; }

/* ---- Header ---- */
header.main { background: var(--ink); color: var(--text-on-dark); position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--ink-line); }
.header-row { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand-mark { display: inline-flex; align-items: center; flex-shrink: 0; background: #ffffff; padding: 7px 14px; border-radius: 10px; }
.brand-logo { height: 36px; width: auto; display: block; }
.search-form { flex: 1; display: flex; align-items: center; background: var(--ink-soft); border: 1px solid var(--ink-line); border-radius: 9px; padding: 0 6px 0 12px; height: 38px; max-width: 560px; }
.search-form input { flex: 1; background: transparent; border: none; color: var(--text-on-dark); font-size: 13.5px; font-family: inherit; }
.search-form input::placeholder { color: var(--text-muted-on-dark); }
.search-form input:focus { outline: none; }
.search-form button { background: none; border: none; color: var(--text-muted-on-dark); display: flex; padding: 6px; }
.header-icons { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn { position: relative; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px; background: none; border: none; color: var(--text-on-dark); }
.icon-btn:hover { background: var(--ink-soft); }
.cart-count { position: absolute; top: 2px; right: 2px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; min-width: 15px; height: 15px; border-radius: 20px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.menu-btn { display: none; }

/* ---- Category nav ---- */
nav.cat-nav { background: var(--ink-soft); border-bottom: 1px solid var(--ink-line); }
nav.cat-nav a { color: var(--text-muted-on-dark); font-size: 13px; font-weight: 500; padding: 9px 13px; border-radius: 6px; white-space: nowrap; }
nav.cat-nav a:hover { color: var(--text-on-dark); background: var(--ink-line); }
nav.cat-nav a.sale { color: var(--accent-deep); }

/* ---- Hero ---- */
.hero { background: linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 100%); color: var(--text-on-dark); padding: 40px 0 46px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 14px; }
.hero h1 { font-size: 44px; line-height: 1.02; font-weight: 900; }
.hero p.lede { font-size: 15px; color: var(--text-muted-on-dark); max-width: 46ch; margin: 16px 0 24px; line-height: 1.55; }
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13.5px; padding: 11px 18px; border-radius: 8px; border: 1px solid transparent; }
.btn-accent { background: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-deep); }
.btn-ghost { border-color: var(--ink-line); color: var(--text-on-dark); }
.btn-ghost:hover { border-color: var(--text-muted-on-dark); }
.hero-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hero-tile { background: var(--ink-soft); border: 1px solid var(--ink-line); border-radius: 12px; padding: 16px 12px; text-align: center; }
.hero-tile .ico { color: var(--accent); margin-bottom: 8px; }
.hero-tile .t { font-size: 12.5px; font-weight: 600; color: var(--text-on-dark); }
.hero-tile .s { font-size: 11px; color: var(--text-muted-on-dark); margin-top: 2px; }

/* ---- Section shell ---- */
section.shelf { padding: 30px 0; border-bottom: 1px solid var(--line); }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.shelf-head h2 { font-size: 26px; font-weight: 800; }
.shelf-head .view-all { font-size: 12.5px; font-weight: 600; color: var(--accent-text); white-space: nowrap; }
.shelf-head .view-all:hover { text-decoration: underline; }
.shelf-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.bestseller-flag { display: inline-flex; align-items: center; gap: 5px; background: var(--ok-tint); color: var(--ok); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; padding: 3px 8px; border-radius: 20px; margin-bottom: 8px; }

/* ---- Tab pills (Best sellers: All / Batteries / Inverters / Solar Panels) ---- */
.tab-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-pill { background: var(--surface-2); border: 1px solid var(--line); color: var(--text-muted); font-size: 12px; font-weight: 600; padding: 7px 13px; border-radius: 20px; white-space: nowrap; }
.tab-pill:hover { border-color: var(--accent); color: var(--accent-text); }
.tab-pill.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Grid shelf (wraps instead of scrolling — used for tabbed/on-sale sections) ---- */
.grid-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }

/* ---- Special offer promo card ---- */
.offer-split { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.offer-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  border: 1px solid var(--accent); border-radius: 14px; padding: 20px 16px; position: relative;
  background: var(--surface);
}
.offer-badge {
  position: absolute; top: -14px; right: -10px; background: var(--accent); color: var(--on-accent);
  font-size: 11px; font-weight: 800; padding: 10px; border-radius: 50%; width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center; line-height: 1.15; box-shadow: var(--shadow);
}
.offer-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 10px; }
.offer-img { width: 100%; max-width: 160px; }
.offer-img img { width: 100%; height: auto; object-fit: contain; }
.offer-name { font-size: 13.5px; font-weight: 700; margin-top: 12px; color: var(--accent-text); }
.offer-shelf { min-width: 0; }

/* ---- Brand chips ---- */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 28px; }
.chip { flex-shrink: 0; background: var(--surface); border: 1px solid var(--line); padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip:hover { border-color: var(--accent); color: var(--accent-text); }

/* ---- Product row / cards ---- */
.row { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.card { scroll-snap-align: start; flex: 0 0 198px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card-img { aspect-ratio: 1; background: var(--surface-2); display: flex; align-items: center; justify-content: center; padding: 14px; position: relative; }
.card-img img { max-height: 100%; width: auto; object-fit: contain; }
.sale-badge { position: absolute; top: 8px; left: 8px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; }
.card-body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-name { font-size: 12.5px; font-weight: 600; line-height: 1.32; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 32px; }
.card-price { display: flex; align-items: baseline; gap: 6px; margin-top: auto; }
.price-now { font-size: 15px; font-weight: 600; color: var(--text); }
.price-was { font-size: 11px; color: var(--text-muted); text-decoration: line-through; }
.add-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 8px; border-radius: 7px; border: 1px solid var(--accent); color: var(--accent-text); background: transparent; font-size: 12px; font-weight: 600; }
.add-btn:hover { background: var(--accent); color: var(--on-accent); }
.empty-shelf { font-size: 13px; color: var(--text-muted); padding: 10px 0; }

/* ---- Footer ---- */
footer.site-footer { background: var(--ink); color: var(--text-muted-on-dark); padding: 34px 0 20px; margin-top: 10px; }
footer.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
footer .brand-mark { margin-bottom: 8px; }
footer .f-blurb { font-size: 12.5px; line-height: 1.6; margin-top: 8px; max-width: 32ch; }
footer h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-on-dark); font-weight: 600; margin-bottom: 10px; }
footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; }
footer ul a:hover { color: var(--text-on-dark); }
.f-bottom { border-top: 1px solid var(--ink-line); margin-top: 26px; padding-top: 16px; font-size: 11.5px; text-align: center; }

/* ---- Mobile drawer ---- */
.drawer-backdrop { display: none; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 24px; }
  .hero h1 { font-size: 32px; }
  footer.site-footer .wrap { grid-template-columns: 1fr 1fr; }
  .offer-split { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .search-form { display: none; }
  nav.cat-nav { display: none; }
  .menu-btn { display: flex; }
  .header-row { height: 58px; }
  .brand-logo { height: 28px; }
  .hero { padding: 26px 0 30px; }
  .hero h1 { font-size: 27px; }
  .shelf-head h2 { font-size: 21px; }
  .card { flex: 0 0 148px; }
  .card-name { font-size: 11.5px; min-height: 29px; }
  footer.site-footer .wrap { grid-template-columns: 1fr; gap: 20px; }

  .drawer-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(12,14,18,0.55); z-index: 60; }
  .drawer { position: fixed; top: 0; bottom: 0; left: 0; width: 82%; max-width: 320px; background: var(--ink); color: var(--text-on-dark); z-index: 61; transform: translateX(-100%); transition: transform 0.25s ease; overflow-y: auto; }
  .drawer.open { transform: translateX(0); }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--ink-line); }
  .drawer-close { background: none; border: none; color: var(--text-on-dark); padding: 6px; }
  .drawer nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
  .drawer nav a { padding: 13px 12px; font-size: 14.5px; font-weight: 500; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; }
  .drawer nav a:hover, .drawer nav a:active { background: var(--ink-soft); }
  .drawer nav a.sale { color: var(--accent); }
  .drawer-divider { padding: 14px 12px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted-on-dark); border-top: 1px solid var(--ink-line); margin-top: 8px; }
  .drawer nav .dept-count { background: var(--ink-line); color: var(--text-muted-on-dark); }
}

/* ---- WooCommerce shop/archive grid (getpower-style wrapping grid, our card system) ---- */
.woocommerce-page main, .woocommerce-page .content-area { max-width: 1280px; margin: 0 auto; padding: 30px 20px; }
.woocommerce-breadcrumb { font-size: 12.5px; color: var(--text-muted); margin-bottom: 18px; }
.woocommerce-breadcrumb a:hover { color: var(--accent-text); text-decoration: underline; }
.woocommerce ul.products {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px;
  list-style: none; margin: 0 0 30px; padding: 0;
}
.woocommerce ul.products li.product.card {
  flex: none; margin: 0; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow);
}
.woocommerce ul.products li.product.card .card-img-link { display: block; }
.woocommerce ul.products li.product.card .card-img { aspect-ratio: 1; background: var(--surface-2); display: flex; align-items: center; justify-content: center; padding: 14px; position: relative; }
.woocommerce ul.products li.product.card .card-img img { max-height: 100%; width: auto; object-fit: contain; margin: 0 auto; }
.woocommerce ul.products li.product.card .card-body { padding: 11px 12px 4px; display: flex; flex-direction: column; gap: 7px; }
.woocommerce ul.products li.product.card .card-cta { padding: 4px 12px 13px; margin-top: auto; }
.woocommerce ul.products li.product.card .card-cta a.button {
  display: flex; align-items: center; justify-content: center; width: 100%; padding: 8px;
  border-radius: 7px; border: 1px solid var(--accent); color: var(--accent-text); background: transparent; font-size: 12px; font-weight: 600;
}
.woocommerce ul.products li.product.card .card-cta a.button:hover { background: var(--accent); color: var(--on-accent); }
.woocommerce nav.woocommerce-pagination ul { border: none; display: flex; gap: 6px; }
.woocommerce nav.woocommerce-pagination ul li { border: none; }
.woocommerce nav.woocommerce-pagination ul li a, .woocommerce nav.woocommerce-pagination ul li span {
  border: 1px solid var(--line); border-radius: 7px; padding: 7px 12px; color: var(--text);
}
.woocommerce nav.woocommerce-pagination ul li span.current { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ---- Single product page ---- */
.woocommerce div.product .product_title { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--text); font-size: 22px; font-weight: 700; }
.woocommerce div.product p.price del, .woocommerce div.product span.price del { font-size: 15px; opacity: 0.6; }
.els-meta-line { font-size: 12.5px; color: var(--text-muted); margin: 4px 0 12px; }
.els-meta-line a { color: var(--accent-text); font-weight: 600; }
.els-vat-note { font-size: 11.5px; color: var(--text-muted); margin: -8px 0 16px; }
.woocommerce div.product .woocommerce-tabs ul.tabs li { border-radius: 8px 8px 0 0; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active { background: var(--surface); border-bottom-color: var(--surface); }
.woocommerce #reviews #comments ol.commentlist li .comment-text { border-radius: 10px; border-color: var(--line); }
.woocommerce div.product div.images .flex-control-thumbs li { border-radius: 8px; overflow: hidden; }

/* ---- Minimal WooCommerce button polish ---- */
.woocommerce ul.products li.product .price ins { text-decoration: none; }
.woocommerce a.button, .woocommerce button.button, .woocommerce #respond input#submit {
  background: var(--accent); color: var(--on-accent); border-radius: 8px; font-weight: 600;
}
.woocommerce a.button:hover, .woocommerce button.button:hover { background: var(--accent-deep); color: var(--on-accent); }
