/*
 Theme Name: XYZ Fasteners Pro
 Template: popularis-ecommerce
 Description: Modern professional theme for XYZ Fasteners / Titan Fasteners
 Version: 1.0
*/

/* ── BRAND VARIABLES — change ONE line to rebrand ─── */
:root {
  /* BRAND: change these 3 lines to switch to Titan */
  --brand-name: "XYZ FASTENERS";
  --brand-primary: #0f2438;
  --brand-accent: #e8a820;

  /* Layout */
  --bg: #f0f4f8;
  --bg2: #ffffff;
  --bg3: #f7f9fc;
  --navy: #0f2438;
  --navyL: #1a3a5c;
  --gold: #e8a820;
  --goldL: #fbbf24;
  --green: #15803d;
  --red: #b91c1c;
  --blue: #1d6fa4;
  --t1: #0f2438;
  --t2: #3d5a78;
  --t3: #7a92aa;
  --b1: #dde3ec;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(15,36,56,.08);
  --shadow-lg: 0 8px 40px rgba(15,36,56,.12);
}

/* ── GLOBAL ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  color: var(--t1);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy); }
img { max-width: 100%; height: auto; }

/* ── TYPOGRAPHY ──────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: .5px;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.8rem); }

/* ── HEADER ─────────────────────────────────────────── */
.site-header, header.site-header {
  background: var(--navy) !important;
  border-bottom: 3px solid var(--gold) !important;
  padding: 0 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  box-shadow: 0 2px 20px rgba(0,0,0,.3) !important;
}
.site-header .container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* Logo */
.site-logo a, .custom-logo-link { display: flex; align-items: center; }
.site-logo img, .custom-logo { height: 44px !important; width: auto !important; }

/* Nav */
.main-navigation, nav.site-navigation {
  display: flex !important;
  align-items: center !important;
}
.main-navigation ul li a, nav ul li a {
  color: rgba(255,255,255,.85) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: .5px !important;
  padding: 20px 16px !important;
  transition: color .15s !important;
}
.main-navigation ul li a:hover, nav ul li a:hover,
.main-navigation ul li.current-menu-item > a { color: var(--gold) !important; }
.main-navigation ul li ul { background: var(--navyL) !important; border-top: 2px solid var(--gold) !important; }

/* Cart / search in header */
.header-cart-btn, .woocommerce-cart-count {
  background: var(--gold) !important;
  color: var(--navy) !important;
  border-radius: 6px !important;
  padding: 8px 16px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
}

/* ── TOP BAR ─────────────────────────────────────────── */
.topbar-strip {
  background: var(--navyL);
  color: rgba(255,255,255,.7);
  font-size: 12px;
  padding: 6px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.topbar-strip a { color: var(--gold); }

/* ── HERO SECTION ────────────────────────────────────── */
.xyz-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 60%, #0d1f30 100%);
  color: #fff;
  padding: 80px 24px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.xyz-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: .4;
}
.xyz-hero-inner { position: relative; max-width: 900px; margin: 0 auto; }
.xyz-hero h1 {
  color: #fff;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.xyz-hero h1 span { color: var(--gold); }
.xyz-hero p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: rgba(255,255,255,.8);
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.xyz-hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  background: var(--gold);
  color: var(--navy);
  padding: 14px 32px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .5px;
  transition: all .2s;
  display: inline-block;
}
.btn-primary:hover { background: var(--goldL); color: var(--navy); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(232,168,32,.4); }
.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,.4);
  padding: 14px 32px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  transition: all .2s;
  display: inline-block;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* Hero stats */
.xyz-hero-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  margin-top: 48px;
  flex-wrap: wrap;
}
.xyz-stat { text-align: center; }
.xyz-stat-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gold);
  display: block;
  line-height: 1;
}
.xyz-stat-label { font-size: 11px; letter-spacing: 2px; color: rgba(255,255,255,.6); text-transform: uppercase; margin-top: 4px; }

/* ── TRUST BAR ────────────────────────────────────────── */
.xyz-trust-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--b1);
  padding: 20px 24px;
}
.xyz-trust-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 32px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.xyz-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--t2);
  font-weight: 500;
}
.xyz-trust-item .icon { font-size: 20px; }

/* ── SECTION WRAPPER ─────────────────────────────────── */
.xyz-section { padding: 64px 24px; }
.xyz-section-inner { max-width: 1400px; margin: 0 auto; }
.xyz-section-title { text-align: center; margin-bottom: 48px; }
.xyz-section-title h2 { margin-bottom: 8px; }
.xyz-section-title p { color: var(--t3); font-size: 15px; }

/* ── CATEGORY GRID ───────────────────────────────────── */
.xyz-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.xyz-cat-card {
  background: var(--bg2);
  border: 1px solid var(--b1);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: var(--t1);
  border-top: 3px solid transparent;
}
.xyz-cat-card:hover {
  border-top-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: var(--navy);
}
.xyz-cat-icon { font-size: 36px; display: block; margin-bottom: 12px; }
.xyz-cat-name { font-weight: 700; font-size: 14px; letter-spacing: .5px; }
.xyz-cat-count { font-size: 12px; color: var(--t3); margin-top: 4px; }

/* ── PRODUCT GRID ────────────────────────────────────── */
ul.products, .products.columns-4, .products.columns-3 {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
  gap: 20px !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
ul.products li.product, .products li.product {
  background: var(--bg2) !important;
  border: 1px solid var(--b1) !important;
  border-radius: var(--radius) !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  transition: all .2s !important;
  box-shadow: var(--shadow) !important;
}
ul.products li.product:hover {
  transform: translateY(-4px) !important;
  box-shadow: var(--shadow-lg) !important;
  border-color: var(--gold) !important;
}
ul.products li.product a img {
  width: 100% !important;
  height: 200px !important;
  object-fit: contain !important;
  background: var(--bg3) !important;
  padding: 20px !important;
  border-bottom: 1px solid var(--b1) !important;
}
ul.products li.product .woocommerce-loop-product__title {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--navy) !important;
  padding: 12px 14px 4px !important;
  line-height: 1.4 !important;
}
ul.products li.product .price {
  padding: 4px 14px 12px !important;
  color: var(--blue) !important;
  font-weight: 700 !important;
  font-size: 15px !important;
}
ul.products li.product .button {
  display: block !important;
  margin: 0 14px 14px !important;
  background: var(--navy) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 5px !important;
  padding: 8px 16px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: .5px !important;
  text-align: center !important;
  transition: background .15s !important;
  cursor: pointer !important;
}
ul.products li.product .button:hover { background: var(--blue) !important; }

/* Stock badge */
ul.products li.product { position: relative !important; }
.xyz-stock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: .5px;
  z-index: 1;
}
.xyz-in-stock { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.xyz-out-stock { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── SINGLE PRODUCT PAGE ─────────────────────────────── */
.single-product div.product {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 48px !important;
  align-items: start !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 40px 24px !important;
}
@media (max-width: 768px) {
  .single-product div.product { grid-template-columns: 1fr !important; }
}
.single-product .woocommerce-product-gallery {
  background: var(--bg2);
  border: 1px solid var(--b1);
  border-radius: var(--radius);
  overflow: hidden;
}
.single-product .woocommerce-product-gallery img {
  padding: 32px !important;
  object-fit: contain !important;
}
.single-product .entry-summary {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}
.single-product .product_title {
  font-size: clamp(1.4rem, 3vw, 2rem) !important;
  color: var(--navy) !important;
  margin-bottom: 8px !important;
}
.single-product .price {
  font-size: 2rem !important;
  font-weight: 800 !important;
  color: var(--blue) !important;
  font-family: 'Barlow Condensed', sans-serif !important;
}
.single-product .login-required-notice {
  background: var(--bg3);
  border: 1px solid var(--b1);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--t2);
}
/* Stock */
.single-product .stock {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  padding: 6px 14px !important;
  border-radius: 5px !important;
}
.single-product .in-stock {
  background: #f0fdf4 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
}
.single-product .out-of-stock {
  background: #fef2f2 !important;
  color: #b91c1c !important;
  border: 1px solid #fecaca !important;
}
/* Add to cart */
.single-product .quantity input {
  border: 1px solid var(--b1) !important;
  border-radius: 5px !important;
  padding: 10px 14px !important;
  font-size: 16px !important;
  width: 80px !important;
}
.single-product .single_add_to_cart_button {
  background: var(--navy) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--radius) !important;
  padding: 12px 32px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: .5px !important;
  cursor: pointer !important;
  transition: all .2s !important;
  flex: 1 !important;
}
.single-product .single_add_to_cart_button:hover {
  background: var(--blue) !important;
  transform: translateY(-2px) !important;
}
/* SKU + meta */
.single-product .product_meta {
  background: var(--bg3);
  border: 1px solid var(--b1);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
}
.single-product .product_meta span { display: block; margin-bottom: 4px; }
.single-product .product_meta .label { color: var(--t3); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }

/* ── CROSS-REF BOX (injected by plugin) ──────────────── */
.xyz-cross-refs {
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }

/* ── SHOP PAGE LAYOUT ────────────────────────────────── */
.woocommerce .woocommerce-notices-wrapper { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.woocommerce-page .site-main, .shop-main { max-width: 1400px !important; margin: 0 auto !important; padding: 32px 24px !important; }
.woocommerce-result-count { font-size: 13px !important; color: var(--t3) !important; }
.woocommerce-ordering select {
  border: 1px solid var(--b1) !important;
  border-radius: 5px !important;
  padding: 8px 14px !important;
  font-size: 13px !important;
  background: var(--bg2) !important;
  color: var(--t1) !important;
}

/* ── SIDEBAR ─────────────────────────────────────────── */
.widget_product_categories ul {
  list-style: none !important;
  padding: 0 !important;
}
.widget_product_categories ul li a {
  display: block !important;
  padding: 8px 12px !important;
  color: var(--t2) !important;
  font-size: 13px !important;
  border-radius: 5px !important;
  transition: all .15s !important;
}
.widget_product_categories ul li a:hover,
.widget_product_categories ul li.current-cat > a {
  background: var(--bluebg, #eff6ff) !important;
  color: var(--blue) !important;
}

/* Search box */
.widget_product_search .search-field {
  border: 1px solid var(--b1) !important;
  border-radius: 5px !important;
  padding: 10px 14px !important;
  width: 100% !important;
  font-size: 13px !important;
}
.widget_product_search .search-submit {
  background: var(--navy) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 5px !important;
  padding: 10px 20px !important;
  cursor: pointer !important;
  font-weight: 700 !important;
  margin-top: 8px !important;
  width: 100% !important;
}

/* ── CART PAGE ───────────────────────────────────────── */
.woocommerce-cart table.cart { border-collapse: collapse !important; }
.woocommerce-cart table.cart td, .woocommerce-cart table.cart th {
  border: 1px solid var(--b1) !important;
  padding: 12px !important;
  font-size: 13px !important;
}
.woocommerce-cart table.cart th { background: var(--bg3) !important; font-weight: 700 !important; color: var(--t3) !important; font-size: 11px !important; letter-spacing: 1px !important; text-transform: uppercase !important; }
.woocommerce-cart .cart_totals { background: var(--bg2) !important; border: 1px solid var(--b1) !important; border-radius: var(--radius) !important; padding: 24px !important; }
.woocommerce-cart .wc-proceed-to-checkout .button {
  background: var(--green) !important;
  color: #fff !important;
  border-radius: var(--radius) !important;
  padding: 14px 32px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}

/* ── CHECKOUT ────────────────────────────────────────── */
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout #order_review_heading {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--navy) !important;
  padding-bottom: 10px !important;
  border-bottom: 2px solid var(--gold) !important;
  margin-bottom: 20px !important;
}
.woocommerce-checkout .woocommerce-input-wrapper input,
.woocommerce-checkout .woocommerce-input-wrapper select {
  border: 1px solid var(--b1) !important;
  border-radius: 5px !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  width: 100% !important;
}
.woocommerce-checkout #place_order {
  background: var(--green) !important;
  color: #fff !important;
  border-radius: var(--radius) !important;
  padding: 16px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  width: 100% !important;
}

/* ── ACCOUNT PAGE ────────────────────────────────────── */
.woocommerce-account .woocommerce-MyAccount-navigation ul {
  list-style: none !important;
  padding: 0 !important;
  background: var(--bg2) !important;
  border: 1px solid var(--b1) !important;
  border-radius: var(--radius) !important;
  overflow: hidden !important;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
  display: block !important;
  padding: 12px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--t2) !important;
  border-bottom: 1px solid var(--b1) !important;
  transition: all .15s !important;
}
.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover,
.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
  background: var(--navy) !important;
  color: #fff !important;
}

/* ── FOOTER ──────────────────────────────────────────── */
.site-footer {
  background: var(--navy) !important;
  color: rgba(255,255,255,.7) !important;
  padding: 60px 24px 24px !important;
}
.xyz-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto 40px;
}
@media (max-width: 900px) { .xyz-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .xyz-footer-grid { grid-template-columns: 1fr; } }
.xyz-footer-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 8px;
  margin-bottom: 12px;
}
.xyz-footer-logo span { color: var(--gold); }
.xyz-footer-desc { font-size: 13px; line-height: 1.7; margin-bottom: 20px; }
.xyz-footer-contact a { color: var(--gold); display: block; margin-bottom: 6px; font-size: 13px; }
.xyz-footer-col h4 { color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 16px; }
.xyz-footer-col ul { list-style: none; padding: 0; }
.xyz-footer-col ul li { margin-bottom: 8px; }
.xyz-footer-col ul li a { color: rgba(255,255,255,.6); font-size: 13px; transition: color .15s; }
.xyz-footer-col ul li a:hover { color: var(--gold); }
.xyz-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px;
  text-align: center;
  font-size: 12px;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.xyz-footer-bottom a { color: var(--gold); }

/* ── NOTIFICATIONS ───────────────────────────────────── */
.woocommerce-message, .woocommerce-info {
  background: #eff6ff !important;
  border-color: var(--blue) !important;
  color: var(--navy) !important;
  border-radius: var(--radius) !important;
}
.woocommerce-error {
  background: #fef2f2 !important;
  border-color: var(--red) !important;
  color: var(--red) !important;
  border-radius: var(--radius) !important;
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
  .xyz-hero { padding: 48px 20px; }
  .xyz-hero-stats { gap: 24px; }
  ul.products { grid-template-columns: repeat(2, 1fr) !important; }
  .xyz-cat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  ul.products { grid-template-columns: 1fr !important; }
  .xyz-cat-grid { grid-template-columns: 1fr; }
}

/* ── WHOLESALE LOGIN NOTICE ──────────────────────────── */
.woocommerce-variation-price .xyz-login-notice,
.xyz-wholesale-note {
  background: var(--bg3);
  border: 1px solid var(--b1);
  border-left: 3px solid var(--gold);
  padding: 12px 16px;
  font-size: 13px;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--t2);
}
.xyz-wholesale-note a { color: var(--blue); font-weight: 600; }
.xyz-wholesale-note a:hover { color: var(--navy); }

/* ── QUICK SEARCH ENHANCEMENTS ───────────────────────── */
.xyz-search-bar {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 16px;
  max-width: 360px;
}
.xyz-search-bar input {
  background: transparent !important;
  border: none !important;
  color: #fff !important;
  font-size: 13px !important;
  flex: 1 !important;
  outline: none !important;
  padding: 0 !important;
}
.xyz-search-bar input::placeholder { color: rgba(255,255,255,.5) !important; }
.xyz-search-bar button {
  background: var(--gold) !important;
  color: var(--navy) !important;
  border: none !important;
  border-radius: 5px !important;
  padding: 8px 16px !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  cursor: pointer !important;
  letter-spacing: .5px !important;
}

/* ── LOADING ANIMATION ───────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.xyz-loading {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg) 50%, var(--bg3) 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
  border-radius: var(--radius);
  height: 200px;
}
