/*
Theme Name: AutoVenta
Theme URI: https://autoventa.pk
Author: AutoVenta
Description: Custom WooCommerce theme for AutoVenta — car accessories, LED lights & auto parts.
Version: 1.0
Text Domain: autoventa
*/

/* ============================================
   DESIGN TOKENS
============================================ */
:root {
  --av-black: #0A0A0A;
  --av-black-soft: #1A1A1A;
  --av-red: #D91E18;
  --av-red-hover: #B5140F;
  --av-white: #FFFFFF;
  --av-offwhite: #F5F5F5;
  --av-grey: #8C8C8C;
  --av-grey-line: #2A2A2A;

  --av-font-display: 'Oswald', sans-serif;
  --av-font-body: 'Inter', sans-serif;

  --av-radius: 4px;
  --av-container: 1240px;
  --av-transition: 0.2s ease;
}

/* ============================================
   RESET
============================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--av-font-body);
  color: var(--av-black);
  background: var(--av-white);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--av-font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 0.5em;
  line-height: 1.15;
}
.av-container {
  max-width: var(--av-container);
  margin: 0 auto;
  padding: 0 24px;
}
button, input, select { font-family: inherit; }
:focus-visible { outline: 3px solid var(--av-red); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================
   BUTTONS
============================================ */
.av-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--av-font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 14px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: var(--av-radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--av-transition), color var(--av-transition), border-color var(--av-transition);
}
.av-btn--primary {
  background: var(--av-red);
  color: var(--av-white);
}
.av-btn--primary:hover { background: var(--av-red-hover); }
.av-btn--outline {
  background: transparent;
  color: var(--av-white);
  border-color: var(--av-white);
}
.av-btn--outline:hover {
  background: var(--av-white);
  color: var(--av-black);
}

/* ============================================
   HEADER
============================================ */
.av-header {
  background: var(--av-black);
  border-bottom: 1px solid var(--av-grey-line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.av-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}
.av-logo {
  display: flex;
  align-items: center;
  font-family: var(--av-font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--av-white);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.av-logo img { max-height: 46px; width: auto; }
.av-logo span { color: var(--av-red); }

.av-nav { display: flex; align-items: center; gap: 36px; }
.av-nav > a {
  color: var(--av-white);
  font-family: var(--av-font-display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: border-color var(--av-transition), color var(--av-transition);
}
.av-nav > a:hover, .av-nav > a.current-menu-item { border-color: var(--av-red); }

/* Categories mega menu */
.av-nav__item { position: relative; }
.av-mega-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--av-white);
  font-family: var(--av-font-display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}
.av-mega-toggle svg { transition: transform var(--av-transition); }
.av-mega-toggle[aria-expanded="true"] { border-color: var(--av-red); }
.av-mega-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.av-mega-panel {
  display: none;
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, 90vw);
  background: var(--av-black-soft);
  border: 1px solid var(--av-grey-line);
  border-radius: var(--av-radius);
  box-shadow: 0 24px 48px rgba(0,0,0,0.35);
  padding: 32px;
  z-index: 200;
}
.av-mega-panel.is-open { display: block; }
.av-mega-panel__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.av-mega-col__title {
  display: block;
  color: var(--av-white);
  font-family: var(--av-font-display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--av-red);
}
.av-mega-col ul li { margin-bottom: 8px; }
.av-mega-col ul li a {
  color: #B5B5B5;
  font-size: 13.5px;
  transition: color var(--av-transition);
}
.av-mega-col ul li a:hover { color: var(--av-red); }

@media (max-width: 860px) {
  .av-mega-panel {
    position: static;
    transform: none;
    width: 100%;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--av-grey-line);
    border-radius: 0;
    padding: 20px 24px;
  }
  .av-mega-panel__grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 480px) {
  .av-mega-panel__grid { grid-template-columns: 1fr; }
}

.av-header__actions { display: flex; align-items: center; gap: 20px; }
.av-icon-btn {
  color: var(--av-white);
  position: relative;
  display: inline-flex;
}
.av-cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--av-red);
  color: var(--av-white);
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.av-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--av-white);
  cursor: pointer;
}

@media (max-width: 860px) {
  .av-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--av-black);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-top: 1px solid var(--av-grey-line);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
  .av-nav.is-open { display: flex; }
  .av-nav > a { padding: 16px 24px; width: 100%; border-bottom: 1px solid var(--av-grey-line); }
  .av-nav__item { width: 100%; }
  .av-mega-toggle { width: 100%; padding: 16px 24px; justify-content: space-between; border-bottom: 1px solid var(--av-grey-line); }
  .av-menu-toggle { display: inline-flex; }
}

/* ============================================
   HERO — full-bleed photo, text grounded on its dark side
============================================ */
.av-hero {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center right;
  color: var(--av-white);
}
.av-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10,10,10,0.94) 0%, rgba(10,10,10,0.75) 38%, rgba(10,10,10,0.15) 65%, rgba(10,10,10,0.35) 100%);
}
.av-hero__inner {
  max-width: var(--av-container);
  margin: 0 auto;
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 90px 24px;
}
.av-hero__eyebrow {
  color: var(--av-red);
  font-family: var(--av-font-display);
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: block;
}
.av-hero h1 {
  font-size: clamp(38px, 5vw, 60px);
  margin-bottom: 20px;
  max-width: 640px;
}
.av-hero h1 em {
  font-style: normal;
  color: var(--av-red);
}
.av-hero p {
  font-size: 17px;
  color: #D9D9D9;
  max-width: 480px;
  margin-bottom: 34px;
}
.av-hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .av-hero { min-height: 460px; background-position: 65% center; }
  .av-hero__overlay { background: linear-gradient(180deg, rgba(10,10,10,0.55) 0%, rgba(10,10,10,0.92) 75%); }
  .av-hero__inner { padding: 60px 20px; }
}

/* ============================================
   SECTION HEADINGS (shared)
============================================ */
.av-section { padding: 80px 24px; }
.av-section--white { background: var(--av-white); }
.av-section--dark { background: var(--av-black); color: var(--av-white); }
.av-section--offwhite { background: var(--av-offwhite); }
.av-section__head {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 48px;
}
.av-section__eyebrow {
  font-family: var(--av-font-display);
  color: var(--av-red);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.av-section__head h2 { font-size: clamp(28px, 3.5vw, 40px); margin-top: 8px; }
.av-section--dark .av-section__head p,
.av-section--dark .av-section__head { color: #C9C9C9; }

/* ============================================
   CATEGORY GRID — 8 top-level categories
============================================ */
.av-categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: var(--av-container);
  margin: 0 auto;
}
.av-category-tile {
  background: var(--av-white);
  border: 1px solid #E5E5E5;
  border-radius: var(--av-radius);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  transition: border-color var(--av-transition), transform var(--av-transition), box-shadow var(--av-transition);
}
.av-category-tile:hover {
  border-color: var(--av-red);
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}
.av-category-tile__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--av-black);
  color: var(--av-red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.av-category-tile__name {
  font-family: var(--av-font-display);
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.av-category-tile__count {
  font-size: 12.5px;
  color: var(--av-grey);
}

@media (max-width: 1024px) {
  .av-categories { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .av-categories { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   PRODUCT GRID (shop + recommendations, shared w/ WooCommerce)
============================================ */
ul.products, .av-product-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 24px !important;
  max-width: var(--av-container);
  margin: 0 auto;
}
ul.products li.product, .av-product-card {
  background: var(--av-white);
  border: 1px solid #E5E5E5;
  border-radius: var(--av-radius);
  padding: 16px;
  list-style: none;
  transition: box-shadow var(--av-transition), border-color var(--av-transition);
}
ul.products li.product:hover, .av-product-card:hover {
  border-color: var(--av-red);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.av-section--dark ul.products li.product,
.av-section--dark .av-product-card {
  background: var(--av-black-soft);
  border-color: var(--av-grey-line);
}
ul.products li.product img { border-radius: var(--av-radius); margin-bottom: 12px; aspect-ratio: 1/1; object-fit: cover; }
ul.products li.product .woocommerce-loop-product__title, .av-product-card h3 {
  font-family: var(--av-font-display);
  font-size: 15px;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 4px;
}
.av-section--dark .woocommerce-loop-product__title { color: var(--av-white); }
ul.products li.product .price, .av-product-card .price {
  color: var(--av-red);
  font-weight: 700;
  font-family: var(--av-font-display);
}
ul.products li.product .button, .av-product-card .av-btn {
  margin-top: 12px;
  width: 100%;
  justify-content: center;
  background: var(--av-black);
  color: var(--av-white);
  font-size: 12px;
  padding: 10px 16px;
  border-radius: var(--av-radius);
  display: block;
  text-align: center;
}
ul.products li.product .button:hover { background: var(--av-red); }

@media (max-width: 1024px) {
  ul.products, .av-product-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 560px) {
  ul.products, .av-product-grid { grid-template-columns: 1fr !important; }
}

/* ============================================
   TRUST / INFO SECTION
============================================ */
.av-trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  max-width: var(--av-container);
  margin: 0 auto;
}
.av-trust-item { text-align: center; }
.av-trust-item .av-trust-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--av-black);
  color: var(--av-red);
  display: flex; align-items: center; justify-content: center;
}
.av-trust-item h4 { font-size: 16px; margin-bottom: 6px; }
.av-trust-item p { color: var(--av-grey); font-size: 14px; margin: 0; }

@media (max-width: 860px) {
  .av-trust { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   FOOTER
============================================ */
.av-footer {
  background: var(--av-black);
  color: #B5B5B5;
  padding: 64px 24px 24px;
}
.av-footer__grid {
  max-width: var(--av-container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--av-grey-line);
}
.av-footer h5 {
  color: var(--av-white);
  font-family: var(--av-font-display);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.av-footer ul li { margin-bottom: 10px; }
.av-footer a:hover { color: var(--av-red); }
.av-footer__bottom {
  max-width: var(--av-container);
  margin: 0 auto;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}
.av-footer__bottom span.av-red-dot { color: var(--av-red); }

@media (max-width: 860px) {
  .av-footer__grid { grid-template-columns: 1fr 1fr; }
}
