/*
Theme Name: XFMR Direct
Theme URI: https://xfmrdirect.com
Author: XFMR Direct
Description: Industrial ecommerce theme for XFMR Direct — transformers in stock, direct. Light blue/white, AutomationDirect-density, WooCommerce-first.
Version: 0.1.0
Requires PHP: 8.0
Text Domain: xfmrdirect
*/

:root{
  --navy:#0d3b66; --blue:#1a7fc1; --sky:#56b3e4; --lightblue:#e9f4fb; --paleblue:#f4fafe;
  --orange:#f5821f; --orange-d:#d96f12; --orange-btn:#b5570c; --green:#1e8e3e; --amber:#b3690f;
  --ink:#1c2b36; --grey:#566875; --line:#d9e2ea; --bg:#ffffff;
}
*{box-sizing:border-box;}
body{font-family:"Segoe UI",system-ui,-apple-system,Arial,sans-serif; color:var(--ink); background:var(--bg); font-size:15px; line-height:1.5; margin:0;}
a{color:var(--blue); text-decoration:none;} a:hover{text-decoration:underline;}
img{max-width:100%; height:auto;}
.wrap{max-width:1180px; margin:0 auto; padding:0 24px;}
.woo-wrap{padding-top:6px; padding-bottom:34px;}
h1{font-size:27px; line-height:1.2; color:var(--navy);}
h2{font-size:20px; color:var(--navy);}

/* ---------- buttons ---------- */
.btn, .button, button.button, a.button,
.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.wc-block-components-button{
  display:inline-block; border-radius:4px; padding:10px 16px; font-weight:700; font-size:14px;
  cursor:pointer; border:none; text-align:center; background:var(--orange-btn); color:#fff; line-height:1.2;
}
.btn:hover, .button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover{background:#964808; color:#fff; text-decoration:none;}
.btn-ghost{background:#fff; color:var(--blue); border:2px solid var(--blue); padding:8px 14px;}
.btn-ghost:hover{background:var(--paleblue); color:var(--blue);}
.btn-navy{background:var(--navy);} .btn-navy:hover{background:#0a2f52;}
.woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt{background:var(--orange-btn); color:#fff;}
.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover{background:#964808;}

/* ---------- header ---------- */
.utility{background:var(--navy); color:#cfe5f5; font-size:12.5px;}
.utility .wrap{display:flex; justify-content:space-between; gap:12px; padding:5px 16px; flex-wrap:wrap;}
.utility a{color:#fff; font-weight:600;}
.mainbar .wrap{display:flex; align-items:center; gap:18px; padding:12px 16px; flex-wrap:wrap;}
.site-logo{font-weight:800; font-size:27px; letter-spacing:.5px; white-space:nowrap; line-height:1;}
.site-logo a{text-decoration:none;}
.site-logo .x1{color:var(--navy);} .site-logo .x2{color:var(--sky);}
.site-logo small{display:block; font-size:9.5px; font-weight:600; color:var(--grey); letter-spacing:2.1px; margin-top:2px;}
.hdr-search{flex:1; display:flex; min-width:200px;}
.hdr-search input[type=search]{flex:1; border:2px solid var(--blue); border-right:none; border-radius:4px 0 0 4px; padding:9px 12px; font-size:14px;}
.hdr-search button{background:var(--blue); color:#fff; border:none; padding:0 18px; border-radius:0 4px 4px 0; font-weight:700; cursor:pointer;}
.hdr-actions{display:flex; gap:14px; align-items:center;}
.cartbtn{position:relative; font-weight:700; color:var(--navy); text-decoration:none;}
.cartbtn:hover{text-decoration:none;}
.cartbtn .ct{background:var(--orange-btn); color:#fff; border-radius:10px; font-size:11px; padding:1px 6px; margin-left:4px;}
.nav-cats{background:var(--blue);}
.nav-cats ul{list-style:none; margin:0; padding:0; display:flex; gap:2px; flex-wrap:wrap;}
.nav-cats li a{color:#fff; font-size:13.5px; font-weight:600; padding:9px 13px; display:block;}
.nav-cats li a:hover{background:rgba(255,255,255,.14); text-decoration:none;}
.hamb{display:none; background:none; border:1px solid var(--line); border-radius:4px; padding:6px 10px; font-size:18px; cursor:pointer; color:var(--navy);}

/* ---------- home ---------- */
.hero{background:linear-gradient(135deg, var(--lightblue) 0%, #d4ebf9 100%); border-bottom:1px solid var(--line);}
.hero .wrap{display:grid; grid-template-columns:1.4fr 1fr; gap:30px; padding:34px 16px; align-items:center;}
.hero h1{font-size:31px; margin:0 0 10px;}
.hero p{font-size:16px; color:#33495a; margin:0 0 18px; max-width:520px;}
.hero .ctas{display:flex; gap:12px; flex-wrap:wrap;}
.scen{background:#fff; border:1px solid var(--line); border-radius:8px; padding:16px;}
.scen h2{font-size:14px; color:var(--grey); text-transform:uppercase; letter-spacing:1px; margin:0 0 10px;}
.scen a{display:flex; justify-content:space-between; border:1px solid var(--line); border-radius:5px; padding:10px 12px; margin-bottom:8px; font-weight:700; color:var(--navy);}
.scen a span{color:var(--sky);}
.scen a:hover{border-color:var(--sky); background:var(--paleblue); text-decoration:none;}
/* 2 rows of 4 — compact, centered tiles (not stretched to fill the row) */
.tiles{display:grid; grid-template-columns:repeat(4, minmax(120px,200px)); justify-content:center; gap:14px; padding:26px 0;}
.tile{border:1px solid var(--line); border-radius:6px; padding:14px 10px; text-align:center; font-weight:700; font-size:13.5px; color:var(--navy);}
.tile:hover{border-color:var(--sky); background:var(--paleblue); text-decoration:none;}
.tile .ic{font-size:22px; display:block; margin-bottom:6px;}
.tile em{display:block; font-style:normal; font-weight:400; font-size:11.5px; color:var(--grey); margin-top:3px;}
.sechead{display:flex; align-items:baseline; gap:12px; margin:8px 0 14px;}
.sechead .note{font-size:12px; color:var(--grey); background:var(--lightblue); border-radius:10px; padding:2px 10px;}
.pgrid{display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:30px;}
.pcard{border:1px solid var(--line); border-radius:6px; padding:14px; display:flex; flex-direction:column; gap:7px; background:#fff;}
.pcard:hover{box-shadow:0 2px 10px rgba(13,59,102,.10);}
.pcard .pimg{background:#fff; border:1px solid var(--line); border-radius:4px; height:170px; display:flex; align-items:center; justify-content:center; overflow:hidden;}
.pcard .pimg img{max-height:158px; max-width:100%; width:auto; object-fit:contain;}
/* Uniform product images in shop / category / search loops — letterboxed, never cropped */
.woocommerce ul.products li.product a img,
.woocommerce ul.products li.product img{
  height:210px; width:100%; object-fit:contain; background:#fff; margin:0 0 10px; border-radius:4px;
}
.pcard .nm{font-weight:700; font-size:14px; color:var(--navy); min-height:38px;}
.pcard .nm a{color:var(--navy);}
.pcard .sku{font-size:12px; color:var(--grey);}
.pcard .row{display:flex; gap:8px; align-items:center; margin-top:auto;}
.price, .woocommerce div.product p.price, .woocommerce ul.products li.product .price{font-size:21px; font-weight:800; color:var(--navy);}
.xfmr-stock{font-size:12.5px; font-weight:700; color:var(--green);}
.xfmr-stock.lead{color:var(--amber);}
.trust{display:grid; grid-template-columns:repeat(3,1fr); gap:12px; padding:4px 0 30px; text-align:center; font-size:13px; color:var(--grey);}
.trust b{display:block; color:var(--navy); font-size:13.5px;}

/* ---------- single product layout (image column capped, mock-style sections) ---------- */
.single-product div.product{display:grid !important; grid-template-columns:minmax(300px,400px) 1fr; gap:30px; align-items:start;}
.single-product div.product div.images{width:100% !important; float:none !important; margin:0 !important; grid-column:1;}
.single-product div.product div.summary{width:100% !important; float:none !important; margin:0 !important; grid-column:2;}
/* compare now renders INSIDE the right summary column (after the buy box + pay buttons), filling that gap */
.single-product div.product div.summary .xfmr-cmp{margin-top:18px; clear:both;}
/* reserve space for the Stripe express-pay buttons (Google Pay / Apple Pay / Link) on the cart page
   so they don't shift the page as they render in asynchronously */
.woocommerce-cart #wc-stripe-express-checkout-element{min-height:118px;}
.single-product div.product .xfmr-specs,
.single-product div.product .xfmr-desc{grid-column:1 / -1; width:100%;}
.single-product div.product .xfmr-specs{max-width:1000px;}
.single-product div.product .related.products,
.single-product div.product .up-sells{display:none !important;}
.single-product div.product div.images img{max-height:380px; width:auto; max-width:100%; margin:0 auto; display:block; background:var(--paleblue); border:1px solid var(--line); border-radius:6px; padding:10px;}
.single-product div.product div.images .woocommerce-product-gallery__wrapper{margin:0;}
.single-product div.product div.images .flex-control-thumbs{display:flex; gap:8px; margin:10px 0 0; padding:0;}
.single-product div.product div.images .flex-control-thumbs li{width:64px; list-style:none; float:none;}
.single-product div.product div.images .flex-control-thumbs img{max-height:64px; padding:4px; cursor:pointer; opacity:.65;}
.single-product div.product div.images .flex-control-thumbs img.flex-active{opacity:1; border-color:var(--blue);}
.single-product .xfmr-docs{margin-top:14px;}
.brandline{font-size:13.5px; color:var(--grey); margin:-4px 0 10px;}
.brandline a{color:var(--blue); font-weight:700;}
.brandline b{color:var(--navy);}
.xfmr-jump{display:inline-block; font-size:13px; font-weight:700; margin:8px 0 2px;}
.xfmr-quote-note{border:1px solid var(--line); border-left:4px solid var(--amber); border-radius:6px; background:#fdf8f0; padding:12px 14px; font-size:13.5px; color:#5a4a33; margin:10px 0; max-width:560px;}
.xfmr-rfq-btn{font-size:15px !important; padding:11px 20px !important;}
.xfmr-rfq-sub{font-size:12.5px; color:var(--grey); margin-top:-4px;}
.chip{display:inline-block; background:var(--lightblue); color:var(--navy); font-size:11.5px; font-weight:700; border-radius:10px; padding:2px 10px; margin-left:6px;}
.xfmr-specs{margin:6px 0 24px;}
.xfmr-specs h2{margin-bottom:10px;}
.xfmr-specs .cols{display:grid; grid-template-columns:1fr 1fr; gap:0 30px;}
.xfmr-specs table{border-collapse:collapse; width:100%; font-size:13.5px; margin:0;}
.xfmr-specs td{border-bottom:1px solid var(--line); padding:7px 8px;}
.xfmr-specs td:first-child{font-weight:700; color:var(--grey); width:46%; background:var(--paleblue);}
.xfmr-desc{max-width:860px; font-size:14.5px; color:#33495a; margin-bottom:26px;}
.xfmr-desc h2{margin-bottom:8px;}
@media (max-width:900px){
  /* single column: everything stacks in DOM order (image+docs, summary, compare, specs, desc) */
  .single-product div.product{grid-template-columns:1fr;}
  .single-product div.product div.images,
  .single-product div.product div.summary,
  .single-product div.product .xfmr-cmp,
  .single-product div.product .xfmr-specs,
  .single-product div.product .xfmr-desc{grid-column:1 !important; width:100% !important; max-width:100% !important;}
  .single-product div.product .xfmr-cmp{margin-top:18px;}
  .xfmr-specs .cols{grid-template-columns:1fr;}
  .single-product div.product div.images img{max-height:300px;}
}

/* ---------- woocommerce general ---------- */
.woocommerce .content-area{padding:10px 0 30px;}
.site-main{min-height:50vh;}
.woocommerce-breadcrumb{font-size:12.5px; color:var(--grey); padding:12px 0;}
.woocommerce ul.products li.product{border:1px solid var(--line); border-radius:6px; padding:14px; background:#fff;}
.woocommerce ul.products li.product:hover{box-shadow:0 2px 10px rgba(13,59,102,.10);}
.woocommerce ul.products li.product .woocommerce-loop-product__title{font-size:14px; font-weight:700; color:var(--navy);}
.woocommerce div.product .product_title{font-size:23px; color:var(--navy);}
.woocommerce div.product p.price{font-size:30px;}
.woocommerce div.product .woocommerce-product-details__short-description{font-size:14.5px; color:#33495a;}
.woocommerce div.product form.cart .quantity{display:inline-flex; align-items:stretch; border:1px solid var(--line); border-radius:4px; overflow:hidden;}
.woocommerce div.product form.cart .quantity .qty{border:none; padding:8px; width:54px; text-align:center;}
.qty-btn{width:34px; border:none; background:#f3f7fa; font-size:17px; font-weight:700; color:var(--navy); cursor:pointer;}
.qty-btn:hover{background:var(--lightblue);}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active{border-bottom-color:#fff;}
.woocommerce table.shop_attributes{border:1px solid var(--line); border-radius:6px; font-size:13.5px;}
.woocommerce table.shop_attributes th{background:var(--paleblue); font-weight:700; color:var(--grey); width:42%;}
.woocommerce .star-rating span:before{color:var(--orange);}
.woocommerce-message, .woocommerce-info{border-top-color:var(--blue);}
.woocommerce-message::before, .woocommerce-info::before{color:var(--blue);}
.onsale{display:none !important;}

/* availability strings */
.stock.in-stock, p.stock.in-stock{color:var(--green); font-weight:700;}
p.stock.out-of-stock, .stock.out-of-stock{color:var(--amber); font-weight:700;}

/* ---------- coming soon (empty categories) ---------- */
.xfmr-coming-soon{text-align:center; padding:60px 20px 70px; background:linear-gradient(135deg, var(--lightblue) 0%, #d4ebf9 100%); border:1px solid var(--line); border-radius:10px; margin:20px 0 40px;}
.xfmr-coming-soon h2{font-size:34px; color:var(--navy); letter-spacing:2px; text-transform:uppercase; margin:14px 0 10px;}
.xfmr-coming-soon p{max-width:480px; margin:0 auto 18px; color:#33495a; font-size:15px;}
.xfmr-bolts{display:flex; justify-content:center; gap:14px;}
.xfmr-bolt{width:38px; height:38px; color:#f5b51f; filter:drop-shadow(0 0 6px rgba(245,181,31,.55)); animation:xfmr-zap 1.6s ease-in-out infinite;}
.xfmr-bolt:nth-child(1){animation-delay:0s; width:28px; height:28px; margin-top:8px;}
.xfmr-bolt:nth-child(2){animation-delay:.25s;}
.xfmr-bolt:nth-child(3){animation-delay:.5s; width:28px; height:28px; margin-top:8px;}
@keyframes xfmr-zap{0%,100%{opacity:.45; transform:scale(.95);}50%{opacity:1; transform:scale(1.08);}}

/* checkout review table columns */
.woocommerce-checkout-review-order-table .product-sku{white-space:nowrap; font-size:13px; color:var(--grey);}
.woocommerce-checkout-review-order-table .product-qty{text-align:center;}

/* ---------- footer ---------- */
.site-footer{background:var(--navy); color:#bdd6e8; font-size:13px; margin-top:24px;}
.site-footer .wrap{display:grid; grid-template-columns:1.3fr 1fr 1fr 1.3fr; gap:24px; padding:28px 16px 20px;}
.site-footer h4{color:#fff; font-size:13px; text-transform:uppercase; letter-spacing:1px; margin:0 0 10px;}
.site-footer a{color:#bdd6e8; display:block; padding:2.5px 0;}
.site-footer ul{list-style:none; margin:0; padding:0;}
.copyright{border-top:1px solid rgba(255,255,255,.15); text-align:center; padding:12px; font-size:12px; color:#8fb3cd;}

/* ---------- funnel pages (selector/calculator placeholders + live) ---------- */
.sel-hero{background:var(--lightblue); border-bottom:1px solid var(--line); padding:26px 0; margin-bottom:8px;}
.sel-hero h1{font-size:28px; margin:0;}
.sel-hero p{color:#33495a; margin:6px 0 0; font-size:15.5px;}
.xfmr-tool-pending{border:1px solid var(--line); border-left:4px solid var(--sky); border-radius:6px; padding:16px; background:var(--paleblue); max-width:760px; margin:20px 0;}

/* ---------- responsive ---------- */
@media (max-width: 1100px){
  /* keep the category bar on one line until it truly can't fit */
  .nav-cats li a{padding:9px 10px; font-size:13px;}
}
@media (max-width: 900px){
  .hero .wrap{grid-template-columns:1fr;}
  .hero h1{font-size:26px;}
  .tiles{grid-template-columns:repeat(3,1fr);}
  .pgrid{grid-template-columns:repeat(2,1fr);}
  .trust{grid-template-columns:1fr;}
  .site-footer .wrap{grid-template-columns:1fr 1fr;}
  .nav-cats .wrap{padding:0;}
  .nav-cats ul{display:none; flex-direction:column;}
  .nav-cats ul.open{display:flex;}
  .nav-cats li a{padding:11px 16px; border-bottom:1px solid rgba(255,255,255,.12);}
  .hamb{display:block;}
  .mainbar .wrap{gap:10px;}
}
@media (max-width: 640px){
  /* phone header: logo + actions on row 1, full-width search on row 2 */
  .mainbar .wrap{flex-wrap:wrap; row-gap:8px;}
  .site-logo{font-size:22px;}
  .site-logo small{letter-spacing:1.4px;}
  .hdr-search{order:5; flex-basis:100%; min-width:0;}
  .hdr-actions{margin-left:auto;}
  .utility .wrap{justify-content:center; text-align:center; font-size:12px;}
  .tiles{grid-template-columns:repeat(2,1fr); gap:10px;}
  .pgrid{grid-template-columns:1fr;}
  .site-footer .wrap{grid-template-columns:1fr;}
  .sel-hero{padding:18px 0;}
  .sel-hero h1{font-size:22px;}
  .woo-wrap, .wrap{padding-left:14px; padding-right:14px;}
  .single-product div.product div.images img{max-height:240px;}
  .woocommerce div.product .product_title{font-size:20px;}
  .woocommerce div.product p.price, .price{font-size:24px;}
  /* horizontal-scroll genuinely-wide tables so they never blow out the layout */
  .woocommerce table.shop_attributes{display:block; overflow-x:auto;}
  /* keep the two spec tables full-width so they stack at equal widths on phones */
  .xfmr-specs .cols{grid-template-columns:1fr;}
  .xfmr-specs table{width:100%; display:table;}
  .xfmr-specs td:first-child{width:42%;}
}
@media (max-width: 400px){
  .tiles{grid-template-columns:1fr;}
  .site-logo{font-size:20px;}
}

/* ---------- accessibility (a11y) ---------- */
/* visible keyboard focus */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible,.xf-card:focus-visible,.tile:focus-visible{outline:3px solid #1a7fc1;outline-offset:2px;border-radius:4px;}

/* skip link */
.skip-link{position:absolute;left:-9999px;top:auto;}
.skip-link:focus{left:8px;top:8px;z-index:1000;background:#fff;color:#0d3b66;padding:8px 12px;border:2px solid #1a7fc1;border-radius:4px;}

/* mobile font size (no iOS auto-zoom) + >=44px tap targets */
@media (max-width:640px){
  input,select,textarea,.hdr-search input[type=search],.xfmr-filter select,.woocommerce div.product form.cart .quantity .qty{font-size:16px;}
  .xfmr-filter select{min-height:44px;padding:11px 10px;}
  .qty-btn{width:44px;min-height:44px;}
  .woocommerce div.product form.cart .quantity .qty{padding:11px;}
  .site-footer a{display:block;padding:8px 0;}
  .pcard .row a{padding:8px 4px;}
}
