/* =========================================================
   AutoGear - Car Accessories WooCommerce Theme
   Flipkart-inspired design system
   ========================================================= */

:root {
  --ag-blue: #2874f0;
  --ag-blue-dark: #1c5bc4;
  --ag-yellow: #ff9f00;
  --ag-orange: #fb641b;
  --ag-bg: #f1f3f6;
  --ag-white: #ffffff;
  --ag-text: #212121;
  --ag-text-light: #878787;
  --ag-border: #e0e0e0;
  --ag-green: #388e3c;
  --ag-red: #ff6161;
  --ag-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  --ag-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.14);
  --ag-radius: 4px;
  --ag-container: 1248px;
  --ag-font: 'Inter', 'Roboto', 'Segoe UI', Arial, sans-serif;
}

/* ---------- Reset & Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--ag-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ag-text);
  background: var(--ag-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ag-blue); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--ag-blue-dark); }

h1, h2, h3, h4, h5 { margin: 0 0 .5em; font-weight: 600; line-height: 1.25; }

ul { margin: 0; padding: 0; list-style: none; }

.ag-container {
  max-width: var(--ag-container);
  margin: 0 auto;
  padding: 0 16px;
}

.ag-section { margin: 16px 0; }

.ag-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Buttons ---------- */
.ag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .3px;
  transition: filter .15s ease, box-shadow .15s ease;
  box-shadow: var(--ag-shadow);
}
.ag-btn:hover { filter: brightness(1.05); box-shadow: var(--ag-shadow-hover); }
.ag-btn-primary { background: var(--ag-yellow); color: #fff; }
.ag-btn-buy { background: var(--ag-orange); color: #fff; }
.ag-btn-blue { background: var(--ag-blue); color: #fff; }
.ag-btn-outline { background: #fff; color: var(--ag-blue); border: 1px solid var(--ag-border); box-shadow: none; }

/* =========================================================
   HEADER
   ========================================================= */
.ag-header { position: sticky; top: 0; z-index: 100; }

.ag-header-main {
  background: var(--ag-blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.ag-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 16px;
  max-width: var(--ag-container);
  margin: 0 auto;
}
.ag-logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ag-logo a { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -.5px; display: flex; align-items: center; gap: 8px; }
.ag-logo .ag-logo-mark {
  background: var(--ag-yellow); color: #fff; width: 34px; height: 34px;
  border-radius: 8px; display: grid; place-items: center; font-size: 20px;
}
.ag-logo .ag-logo-sub { font-size: 11px; font-style: italic; color: var(--ag-yellow); font-weight: 400; }

/* Search */
.ag-search { flex: 1; max-width: 560px; }
.ag-search form { display: flex; background: #fff; border-radius: 2px; overflow: hidden; }
.ag-search input[type="search"],
.ag-search input[type="text"] {
  flex: 1; border: none; padding: 11px 14px; font-size: 14px; outline: none; color: var(--ag-text);
}
.ag-search button {
  background: #fff; border: none; color: var(--ag-blue); padding: 0 16px; cursor: pointer; font-size: 18px;
}

/* Header actions */
.ag-header-actions { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.ag-header-actions a { color: #fff; font-weight: 600; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.ag-header-actions a:hover { color: #fff; opacity: .9; }
.ag-cart-link { position: relative; }
.ag-cart-count {
  position: absolute; top: -8px; left: 14px; background: var(--ag-yellow);
  color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px;
  border-radius: 9px; display: grid; place-items: center; padding: 0 4px;
}

/* Category nav bar */
.ag-nav-bar { background: #fff; box-shadow: var(--ag-shadow); }
.ag-nav-inner {
  display: flex; align-items: center; gap: 6px; max-width: var(--ag-container);
  margin: 0 auto; padding: 0 16px; overflow-x: auto;
}
.ag-nav-inner > ul { display: flex; align-items: center; gap: 4px; }
.ag-nav-inner li { position: relative; }
.ag-nav-inner a {
  display: block; padding: 12px 16px; color: var(--ag-text); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.ag-nav-inner a:hover { color: var(--ag-blue); }
.ag-nav-inner .sub-menu {
  position: absolute; top: 100%; left: 0; background: #fff; min-width: 200px;
  box-shadow: var(--ag-shadow-hover); border-radius: 0 0 4px 4px; padding: 6px 0;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .15s ease; z-index: 50;
}
.ag-nav-inner li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.ag-nav-inner .sub-menu a { padding: 8px 18px; font-weight: 500; }

/* Mobile menu toggle */
.ag-menu-toggle { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }

/* =========================================================
   HERO / BANNERS
   ========================================================= */
.ag-hero { position: relative; margin-top: 8px; }
.ag-slider { position: relative; border-radius: var(--ag-radius); overflow: hidden; background: #fff; }
.ag-slides { display: flex; transition: transform .5s ease; }
.ag-slide { min-width: 100%; }
.ag-slide a { display: block; }
.ag-slide img { width: 100%; height: 320px; object-fit: cover; }
.ag-slide-content {
  position: absolute; top: 50%; left: 6%; transform: translateY(-50%);
  color: #fff; max-width: 440px; text-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.ag-slide-content h2 { font-size: 38px; margin-bottom: 10px; }
.ag-slide-content p { font-size: 18px; margin-bottom: 20px; }
.ag-slider-btn {
  position: absolute; top: 50%; transform: translateY(-50%); background: #fff; color: var(--ag-text);
  border: none; width: 44px; height: 44px; border-radius: 50%; font-size: 20px; cursor: pointer;
  box-shadow: var(--ag-shadow-hover); z-index: 5; display: grid; place-items: center;
}
.ag-slider-btn:hover { background: var(--ag-blue); color: #fff; }
.ag-slider-prev { left: 12px; }
.ag-slider-next { right: 12px; }
.ag-slider-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.ag-slider-dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.6); cursor: pointer; }
.ag-slider-dots span.active { background: #fff; }

/* =========================================================
   CATEGORY GRID
   ========================================================= */
.ag-card { background: #fff; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow); }

.ag-cat-strip {
  background: #fff; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow);
  display: flex; justify-content: space-between; padding: 14px 8px; overflow-x: auto;
}
.ag-cat-item { text-align: center; padding: 8px 16px; flex-shrink: 0; min-width: 110px; }
.ag-cat-item img, .ag-cat-item .ag-cat-icon {
  width: 72px; height: 72px; margin: 0 auto 8px; object-fit: contain;
  display: grid; place-items: center; font-size: 36px;
}
.ag-cat-item span { font-size: 14px; font-weight: 600; color: var(--ag-text); }
.ag-cat-item:hover span { color: var(--ag-blue); }

/* =========================================================
   SECTION HEADINGS + PRODUCT ROWS
   ========================================================= */
.ag-panel { background: #fff; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow); margin: 12px 0; }
.ag-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--ag-border);
}
.ag-panel-head h2 { font-size: 22px; margin: 0; }
.ag-panel-head .ag-viewall {
  background: var(--ag-blue); color: #fff; padding: 8px 20px; border-radius: 2px;
  font-size: 13px; font-weight: 600; text-transform: uppercase;
}
.ag-panel-body { padding: 16px 20px; }

/* Product grid */
.ag-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.ag-product {
  background: #fff; border: 1px solid transparent; border-radius: var(--ag-radius);
  padding: 14px; position: relative; transition: box-shadow .2s ease, border-color .2s ease;
}
.ag-product:hover { box-shadow: var(--ag-shadow-hover); border-color: var(--ag-border); }
.ag-product .ag-thumb { position: relative; margin-bottom: 12px; }
.ag-product .ag-thumb img { width: 100%; height: 200px; object-fit: contain; }
.ag-product .ag-badge {
  position: absolute; top: 6px; left: 6px; background: var(--ag-orange); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 2px; text-transform: uppercase;
}
.ag-wishlist {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%;
  background: #fff; box-shadow: var(--ag-shadow); display: grid; place-items: center;
  color: var(--ag-text-light); border: none; cursor: pointer; font-size: 16px;
}
.ag-wishlist:hover { color: var(--ag-red); }
.ag-product .ag-title {
  font-size: 14px; font-weight: 500; color: var(--ag-text); margin: 0 0 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 42px;
}
.ag-product .ag-rating {
  display: inline-flex; align-items: center; gap: 4px; background: var(--ag-green);
  color: #fff; font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 3px; margin-bottom: 8px;
}
.ag-product .ag-price { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ag-product .ag-price .amount { font-size: 17px; font-weight: 700; color: var(--ag-text); }
.ag-product .ag-price del { color: var(--ag-text-light); font-size: 13px; }
.ag-product .ag-price .ag-off { color: var(--ag-green); font-size: 13px; font-weight: 600; }
.ag-product .button, .ag-product .added_to_cart {
  display: block; text-align: center; margin-top: 12px; background: var(--ag-yellow);
  color: #fff; padding: 9px; border-radius: 2px; font-weight: 600; font-size: 13px;
  text-transform: uppercase; border: none; cursor: pointer; width: 100%;
}
.ag-product .button:hover { filter: brightness(1.05); color:#fff; }

/* Deal strip (horizontal scroll) */
.ag-deal-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.ag-deal-row .ag-product { min-width: 200px; }

/* =========================================================
   TRUST BADGES
   ========================================================= */
.ag-trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: center; padding: 24px; }
.ag-trust .ag-trust-item .ic { font-size: 34px; margin-bottom: 8px; }
.ag-trust .ag-trust-item h4 { margin: 0 0 4px; font-size: 15px; }
.ag-trust .ag-trust-item p { margin: 0; color: var(--ag-text-light); font-size: 13px; }

/* =========================================================
   NEWSLETTER
   ========================================================= */
.ag-newsletter {
  background: linear-gradient(135deg, var(--ag-blue), var(--ag-blue-dark));
  color: #fff; border-radius: var(--ag-radius); padding: 36px; text-align: center; margin: 16px 0;
}
.ag-newsletter h2 { color: #fff; font-size: 26px; }
.ag-newsletter p { opacity: .9; margin-bottom: 20px; }
.ag-newsletter form { display: flex; max-width: 480px; margin: 0 auto; gap: 8px; }
.ag-newsletter input { flex: 1; padding: 13px 16px; border: none; border-radius: 2px; font-size: 14px; }

/* =========================================================
   SHOP / ARCHIVE LAYOUT
   ========================================================= */
.ag-shop-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; margin: 12px 0; }
.ag-sidebar { background: #fff; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow); position: sticky; top: 130px; }
.ag-sidebar .ag-widget { padding: 16px; border-bottom: 1px solid var(--ag-border); }
.ag-sidebar .ag-widget:last-child { border-bottom: none; }
.ag-sidebar h3, .ag-sidebar .widget-title { font-size: 15px; text-transform: uppercase; margin-bottom: 12px; }
.ag-shop-main { min-width: 0; }
.ag-shop-toolbar {
  background: #fff; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow);
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 10px;
}
.ag-shop-toolbar .woocommerce-result-count { margin: 0; color: var(--ag-text-light); }
.ag-shop-main ul.products {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px; margin: 0; padding: 0; list-style: none;
}
.ag-shop-main ul.products li.product { background: #fff; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow); padding: 14px; margin: 0; width: auto; float: none; text-align: left; }
.ag-shop-main ul.products li.product:hover { box-shadow: var(--ag-shadow-hover); }
.ag-shop-main ul.products li.product img { height: 200px; object-fit: contain; }
.ag-shop-main ul.products li.product .woocommerce-loop-product__title { font-size: 14px; font-weight: 500; padding: 8px 0 4px; }
.ag-shop-main ul.products li.product .price { color: var(--ag-text); font-weight: 700; }
.ag-shop-main ul.products li.product .price del { color: var(--ag-text-light); font-weight: 400; }
.ag-shop-main ul.products li.product .button, 
.ag-shop-main ul.products li.product .added_to_cart {
  background: var(--ag-yellow); color: #fff; border-radius: 2px; text-transform: uppercase; font-weight: 600;
}

/* =========================================================
   SINGLE PRODUCT
   ========================================================= */
.single-product div.product { background: #fff; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow); padding: 24px; margin: 12px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.single-product div.product .woocommerce-product-gallery { width: 100% !important; }
.single-product div.product .product_title { font-size: 26px; }
.single-product div.product p.price,
.single-product div.product span.price { font-size: 26px; font-weight: 700; color: var(--ag-text); }
.single-product div.product p.price del { font-size: 16px; color: var(--ag-text-light); }
.single-product .single_add_to_cart_button {
  background: var(--ag-orange) !important; color: #fff !important; padding: 14px 32px !important;
  border-radius: 2px !important; text-transform: uppercase; font-weight: 700; font-size: 15px;
}
.single-product .quantity input { padding: 10px; border: 1px solid var(--ag-border); border-radius: 2px; }
.woocommerce-tabs { grid-column: 1 / -1; }
.woocommerce-tabs ul.tabs { border-bottom: 1px solid var(--ag-border); padding: 0; }
.woocommerce-tabs ul.tabs li { display: inline-block; margin-right: 8px; }
.woocommerce-tabs ul.tabs li a { padding: 10px 18px; font-weight: 600; }
.related.products { grid-column: 1 / -1; }

/* =========================================================
   CART & CHECKOUT
   ========================================================= */
.woocommerce-cart .ag-container,
.woocommerce-checkout .ag-container { padding-top: 12px; }
.woocommerce table.shop_table { background: #fff; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow); border: none; }
.woocommerce .cart-collaterals .cart_totals { background: #fff; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow); padding: 16px; }
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  background: var(--ag-yellow); color: #fff; border-radius: 2px; font-weight: 600; text-transform: uppercase;
}
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce #respond input#submit.alt {
  background: var(--ag-orange); color: #fff;
}
.woocommerce-checkout #payment { background: #fff; border-radius: var(--ag-radius); }
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select { padding: 11px; border: 1px solid var(--ag-border); border-radius: 2px; }

/* =========================================================
   FOOTER
   ========================================================= */
.ag-footer { background: #172337; color: #fff; margin-top: 24px; }
.ag-footer-top { padding: 40px 0; }
.ag-footer-cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; }
.ag-footer-cols h4 { color: var(--ag-text-light); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; }
.ag-footer-cols a { color: #fff; display: block; padding: 5px 0; font-size: 13px; }
.ag-footer-cols a:hover { color: var(--ag-yellow); }
.ag-footer-social { display: flex; gap: 12px; margin-top: 10px; }
.ag-footer-social a { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.1); display: grid; place-items: center; }
.ag-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; text-align: center; font-size: 13px; color: var(--ag-text-light); }
.ag-payment-icons { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.ag-payment-icons span { background: #fff; color: #172337; padding: 4px 8px; border-radius: 3px; font-size: 11px; font-weight: 700; }

/* =========================================================
   WOOCOMMERCE MESSAGES
   ========================================================= */
.woocommerce-message, .woocommerce-info, .woocommerce-error {
  border-top-color: var(--ag-blue); background: #fff; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow);
}
.woocommerce-message::before { color: var(--ag-green); }

/* =========================================================
   PAGE TITLE / BREADCRUMB
   ========================================================= */
.ag-page-head { background: #fff; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow); padding: 16px 20px; margin: 12px 0; }
.ag-page-head h1 { margin: 0 0 4px; font-size: 22px; }
.woocommerce-breadcrumb { color: var(--ag-text-light); font-size: 13px; }

/* Generic page content */
.ag-page-content { background: #fff; border-radius: var(--ag-radius); box-shadow: var(--ag-shadow); padding: 28px; margin: 12px 0; }
.ag-page-content img { border-radius: var(--ag-radius); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .ag-footer-cols { grid-template-columns: repeat(3, 1fr); }
  .ag-shop-wrap { grid-template-columns: 220px 1fr; }
  .single-product div.product { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .ag-header-inner { flex-wrap: wrap; gap: 12px; }
  .ag-search { order: 3; max-width: 100%; flex-basis: 100%; }
  .ag-header-actions { gap: 18px; }
  .ag-menu-toggle { display: block; }
  .ag-nav-bar { display: none; }
  .ag-nav-bar.ag-open { display: block; position: fixed; top: 0; left: 0; bottom: 0; width: 280px; z-index: 200; overflow-y: auto; }
  .ag-nav-bar.ag-open .ag-nav-inner { flex-direction: column; align-items: stretch; }
  .ag-nav-bar.ag-open .ag-nav-inner > ul { flex-direction: column; align-items: stretch; width: 100%; }
  .ag-nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 150; }
  .ag-nav-overlay.ag-open { display: block; }
  .ag-slide img { height: 180px; }
  .ag-slide-content h2 { font-size: 22px; }
  .ag-slide-content p { font-size: 14px; }
  .ag-trust { grid-template-columns: repeat(2, 1fr); }
  .ag-footer-cols { grid-template-columns: repeat(2, 1fr); }
  .ag-shop-wrap { grid-template-columns: 1fr; }
  .ag-sidebar { position: static; }
  .ag-products { grid-template-columns: repeat(2, 1fr); }
  .ag-shop-main ul.products { grid-template-columns: repeat(2, 1fr); }
  .ag-newsletter form { flex-direction: column; }
}

@media (max-width: 480px) {
  .ag-slide-content { display: none; }
  .ag-panel-head h2 { font-size: 18px; }
}
