/*
Theme Name: Estoril Performance
Template: twentytwentyfive
Description: Dark motorsport theme for Estoril Performance, built on Twenty Twenty-Five with WooCommerce.
Version: 1.0.10
Requires at least: 6.7
Text Domain: estoril-performance
*/

:root {
  --ep-bg: #070b16;
  --ep-bg-2: #0c1222;
  --ep-card: #121a2e;
  --ep-line: #222c46;
  --ep-text: #e8ecf5;
  --ep-muted: #8b95ad;
  --ep-blue: #0a5ce8;
  --ep-blue-2: #3d82ff;
  --ep-navy: #0a2a78;
  --ep-display: "Barlow Condensed", "Arial Narrow", sans-serif;
}

/* ---------- Header (white, so the logo sits on its own background) ---------- */
.ep-header { background: #fff; border-bottom: 1px solid #dfe5f2; box-shadow: 0 4px 24px rgba(0,0,0,.25); position: sticky; top: 0; z-index: 40; }
.ep-header-inner { min-height: 72px; gap: 1.5rem; }
.ep-header, .ep-header a, .ep-header .wp-block-navigation-item__content { color: #1a2440; }
.ep-header .wp-block-navigation a:hover { color: var(--ep-blue); }
.ep-header .wp-block-navigation { font-weight: 600; font-size: .95rem; }
.ep-header .wp-block-navigation__responsive-container.is-menu-open { background: #fff; color: #1a2440; }
.ep-header .wc-block-mini-cart__button, .ep-header .wc-block-customer-account a { color: var(--ep-navy); }
.ep-header .wc-block-mini-cart__badge { background: var(--ep-blue); color: #fff; }
.ep-logo { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none !important; }
/* The logo file has a lot of white space around it; this crops to just the emblem. */
.ep-logo-img { display: block; height: 56px; aspect-ratio: 430 / 520; background: url("assets/logo.webp") 50% 49.4% / 465% auto no-repeat; }
.ep-logo-text { font-family: var(--ep-display); font-weight: 800; font-style: italic; font-size: 1.4rem; letter-spacing: .04em; color: var(--ep-navy); }
.ep-logo-text em { font-weight: 600; color: var(--ep-blue); margin-left: .3em; }

/* ---------- Shared bits ---------- */
.ep-wrap { width: min(1440px, 100% - 32px); margin-inline: auto; }
.ep-eyebrow { color: var(--ep-blue-2); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; margin: 0 0 .75rem; }
.ep-section { padding: clamp(3rem, 7vw, 5rem) 16px; }
.ep-section-alt { background: var(--ep-bg-2); border-block: 1px solid var(--ep-line); }
.ep-h2 { font-size: clamp(2rem, 4vw, 2.75rem) !important; margin: 0 0 1.5rem; }
.ep-btn { display: inline-flex; align-items: center; justify-content: center; padding: .85rem 1.5rem; border-radius: 6px; font-weight: 600; text-decoration: none !important; border: 1px solid transparent; cursor: pointer; font-size: 1rem; }
.ep-btn-primary { background: var(--ep-blue); color: #fff !important; }
.ep-btn-primary:hover { background: var(--ep-blue-2); }
.ep-btn-ghost { border-color: var(--ep-line); color: var(--ep-text) !important; }

/* ---------- Hero ---------- */
.ep-hero { position: relative; overflow: hidden; padding: clamp(4rem, 9vw, 7rem) 0 clamp(3rem, 6vw, 4.5rem); border-bottom: 1px solid var(--ep-line);
  background: radial-gradient(ellipse 70% 70% at 80% 45%, rgba(10,92,232,.28), transparent 60%), var(--ep-bg); }
.ep-hero::before { content: ""; position: absolute; right: -10%; top: 0; bottom: 0; width: 55%;
  background: repeating-linear-gradient(115deg, transparent 0 40px, rgba(42,109,244,.08) 40px 44px);
  -webkit-mask-image: linear-gradient(to left, #000 30%, transparent); mask-image: linear-gradient(to left, #000 30%, transparent); }
.ep-hero-inner { position: relative; display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center; }
.ep-hero h1 { font-size: clamp(3rem, 8vw, 6rem); font-style: italic; margin: 0 0 1.5rem; }
.ep-hero h1 span { color: var(--ep-blue); }
.ep-lede { font-size: 1.15rem; color: #c3c8d4; max-width: 560px; }
.ep-badge { justify-self: center; width: min(380px, 100%); aspect-ratio: 1; border-radius: 50%; background: #fff; display: grid; place-items: center;
  box-shadow: 0 0 0 10px rgba(10,92,232,.18), 0 0 0 22px rgba(10,92,232,.08), 0 30px 80px rgba(10,92,232,.45); }
.ep-badge .ep-logo-img { height: 76%; }
.ep-finder { margin: 2rem 0 2.5rem; max-width: 560px; }
.ep-finder label, .ep-finder-title { display: block; font-size: .85rem; font-weight: 600; color: var(--ep-muted); margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .08em; }
.ep-finder-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.ep-finder select { flex: 1 1 240px; background: var(--ep-card); border: 1px solid var(--ep-line); border-radius: 6px; padding: .85rem .9rem; color: var(--ep-text); font: inherit; }
.ep-trust { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 1rem 3rem; }
.ep-trust li { display: flex; flex-direction: column; border-left: 3px solid var(--ep-blue); padding-left: .8rem; }
.ep-trust strong { font-family: var(--ep-display); font-size: 1.2rem; text-transform: uppercase; letter-spacing: .03em; }
.ep-trust span { color: var(--ep-muted); font-size: .88rem; }

/* ---------- Category chips (Product Categories block) ---------- */
.ep-cats ul.wc-block-product-categories-list { list-style: none; padding: 0; margin: 0 0 3rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.ep-cats .wc-block-product-categories-list-item a { display: inline-block; padding: .55rem 1.1rem; border: 1px solid var(--ep-line); border-radius: 999px; background: var(--ep-card); color: var(--ep-text); text-decoration: none; font-weight: 500; }
.ep-cats .wc-block-product-categories-list-item a:hover { border-color: var(--ep-blue); color: #fff; }
.ep-cats .wc-block-product-categories-list-item-count { color: var(--ep-muted); margin-left: .25rem; }

/* ---------- Product cards (shop, categories, home page) ---------- */
.woocommerce ul.products li.product,
.wc-block-product-template .wc-block-product,
.wc-block-grid__product {
  background: var(--ep-card); border: 1px solid var(--ep-line); border-radius: 10px; padding: 0 0 1.1rem; overflow: hidden; text-align: left;
  transition: border-color .15s, transform .15s;
}
.woocommerce ul.products li.product:hover,
.wc-block-product-template .wc-block-product:hover { border-color: #3a4459; transform: translateY(-2px); }
.woocommerce ul.products li.product a img,
.wc-block-product-template .wc-block-components-product-image img {
  aspect-ratio: 4 / 3; width: 100%; height: auto; box-sizing: border-box; object-fit: contain !important; background: #fff; padding: 6%; margin: 0 0 1rem !important; border-radius: 0;
  /* !important beats the inline object-fit:cover WooCommerce adds on the shop/filter pages; border-box keeps the padding inside the card */
}
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.wc-block-product-template .wp-block-post-title { font-family: Inter, system-ui, sans-serif !important; text-transform: none; font-size: 1.02rem !important; font-weight: 600; line-height: 1.3; padding: 0 1.1rem !important; color: var(--ep-text); }
.woocommerce ul.products li.product .price,
.wc-block-product-template .wc-block-components-product-price { font-family: var(--ep-display); font-size: 1.5rem !important; font-weight: 800; color: var(--ep-text) !important; padding: 0 1.1rem; display: block; }
.woocommerce ul.products li.product .button,
.wc-block-product-template .wp-block-button__link { margin: .5rem 1.1rem 0 !important; background: var(--ep-blue) !important; color: #fff !important; border-radius: 6px; font-weight: 600; }
.woocommerce span.onsale, .wc-block-components-product-sale-badge { background: #e5383b; color: #fff; border-radius: 4px; }

/* ---------- Product page, cart, checkout, account ---------- */
.woocommerce div.product .product_title { font-size: clamp(2rem, 4vw, 2.75rem); }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--ep-text); font-family: var(--ep-display); font-weight: 800; font-size: 2rem; }
.woocommerce div.product div.images img, .wc-block-components-product-image img { background: #fff; }
.woocommerce table.variations select,
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce form .form-row select,
.wc-block-components-text-input input, .wc-block-components-textarea, .wc-blocks-components-select select {
  background: var(--ep-bg) !important; color: var(--ep-text) !important; border: 1px solid var(--ep-line) !important; border-radius: 6px !important;
}
.wc-block-components-text-input label, .wc-blocks-components-select label { color: var(--ep-muted) !important; }
.woocommerce-info, .woocommerce-message, .woocommerce-error, .wc-block-components-notice-banner { background: var(--ep-card) !important; color: var(--ep-text) !important; border-color: var(--ep-blue) !important; }
.woocommerce-tabs, .woocommerce table.shop_attributes th, .woocommerce table.shop_attributes td { color: var(--ep-text); }

/* ---------- Stages, about, FAQ ---------- */
.ep-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.ep-stage { position: relative; background: var(--ep-card); border: 1px solid var(--ep-line); border-top: 4px solid var(--ep-blue); border-radius: 10px; padding: 1.5rem; overflow: hidden; }
.ep-stage-num { position: absolute; right: 1rem; top: .25rem; font-family: var(--ep-display); font-weight: 800; font-style: italic; font-size: 4.5rem; color: rgba(61,130,255,.12); line-height: 1; }
.ep-stage h3 { font-size: 1.8rem; font-style: italic; margin: 0 0 .5rem; }
.ep-stage p, .ep-about p, .ep-faq p { color: #c3c8d4; }
.ep-about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: center; }
.ep-stats { display: grid; gap: 1rem; }
.ep-stats div { background: var(--ep-card); border: 1px solid var(--ep-line); border-left: 4px solid var(--ep-blue); border-radius: 10px; padding: 1.1rem 1.4rem; }
.ep-stats strong { display: block; font-family: var(--ep-display); font-size: 2.4rem; line-height: 1; }
.ep-stats span { color: var(--ep-muted); font-size: .9rem; }
.ep-faq { display: grid; gap: .75rem; max-width: 820px; }
.ep-faq details { background: var(--ep-card); border: 1px solid var(--ep-line); border-radius: 10px; padding: 0 1.25rem; }
.ep-faq summary { cursor: pointer; padding: 1.1rem 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.ep-faq summary::-webkit-details-marker { display: none; }
.ep-faq summary::after { content: "+"; color: var(--ep-blue-2); font-size: 1.3rem; line-height: 1; }
.ep-faq details[open] summary::after { content: "–"; }
.ep-cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---------- Footer ---------- */
.ep-footer { border-top: 1px solid var(--ep-line); padding: 3rem 16px 2rem; }
.ep-footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-bottom: 2rem; }
.ep-footer-brand { display: flex; align-items: center; gap: 1rem; }
.ep-footer-brand .ep-logo-text { color: var(--ep-text); }
.ep-footer-brand p { margin: .25rem 0 0; color: var(--ep-muted); }
.ep-logo-badge { width: 76px; height: 76px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.ep-logo-badge .ep-logo-img { height: 60px; }
.ep-footer-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.ep-footer-nav a { color: var(--ep-muted); }
.ep-fine { font-size: .8rem; color: var(--ep-muted); }

/* ---------- Phones ---------- */
@media (max-width: 860px) {
  .ep-hero-inner, .ep-about { grid-template-columns: 1fr; }
  .ep-badge { order: -1; width: 200px; }
}
@media (max-width: 520px) {
  .ep-logo-text { font-size: 1.1rem; }
  .ep-header .ep-logo-img { height: 46px; }
  .ep-badge { width: 160px; }
}

/* ---------- Checkout: Ship / Local pickup toggle ---------- */
.wc-block-checkout__shipping-method-option--selected { background: #fff !important; border-color: #fff !important; color: #000 !important; }
.wc-block-checkout__shipping-method-option--selected * { color: #000 !important; fill: currentColor; }
.wc-block-checkout__shipping-method-option:not(.wc-block-checkout__shipping-method-option--selected):hover { border-color: var(--ep-blue-2) !important; }

/* ---------- Mobile header: keep everything inside the screen ---------- */
.wp-site-blocks { overflow-x: clip; }
@media (max-width: 600px) {
  .ep-header { padding-left: 16px !important; padding-right: 16px !important; }
  .ep-header-inner { gap: .75rem !important; }
  .ep-header-inner > .wp-block-group { gap: .75rem !important; }
  .ep-header .wp-block-woocommerce-customer-account .label { display: none; }
  .ep-logo-text { font-size: 1rem; }
}
@media (max-width: 380px) {
  .ep-logo-text { font-size: .8rem; }
  .ep-logo-img { width: 30px !important; height: 30px !important; }
  .ep-header-inner, .ep-header-inner > .wp-block-group { gap: .5rem !important; }
}

/* ---------- Product grids: 5 per row on computers, fewer on smaller screens ---------- */
.woocommerce ul.products, .wc-block-product-template__responsive { display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)) !important; gap: 1.5rem !important; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }
.woocommerce ul.products li.product, .wc-block-product-template__responsive > li { width: auto !important; margin: 0 !important; float: none !important; box-sizing: border-box; min-width: 0; }
@media (max-width: 1199px) { .woocommerce ul.products, .wc-block-product-template__responsive { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; } }
@media (max-width: 899px) { .woocommerce ul.products, .wc-block-product-template__responsive { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 600px) { .woocommerce ul.products, .wc-block-product-template__responsive { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .75rem !important; } }

/* Vehicle finder: Make / Model / Year / Engine */
.ep-finder { max-width: 600px; }
.ep-finder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: .75rem; }
.ep-finder-field { display: flex; flex-direction: column; min-width: 0; }
.ep-finder .ep-finder-field label { font-size: .72rem; margin-bottom: .3rem; }
.ep-finder .ep-finder-field select { flex: none; width: 100%; }
.ep-finder select:disabled { opacity: .45; cursor: not-allowed; }
.ep-finder > .ep-btn { width: 100%; }
@media (max-width: 520px) { .ep-finder-grid { grid-template-columns: 1fr; } }

/* Product card buttons on phones: keep "Add to cart" / "Read more" on one line */
@media (max-width: 600px) {
  .woocommerce ul.products li.product .button,
  .wc-block-product-template .wp-block-button__link {
    display: block; box-sizing: border-box; white-space: nowrap; text-align: center;
    font-size: .9rem; line-height: 1.2; padding: .75rem .5rem !important; margin: .5rem .75rem 0 !important;
  }
}

/* Contact form (/contact/) */
.ep-contact { max-width: 720px; }
.ep-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.ep-contact p { margin: 0 0 1rem; }
.ep-contact label { display: block; font-size: .85rem; font-weight: 600; color: var(--ep-muted); margin-bottom: .35rem; }
.ep-contact input, .ep-contact textarea { width: 100%; box-sizing: border-box; background: var(--ep-card); border: 1px solid var(--ep-line); border-radius: 6px; padding: .8rem .9rem; color: var(--ep-text); font: inherit; }
.ep-contact input:focus, .ep-contact textarea:focus { outline: 2px solid var(--ep-blue-2); outline-offset: 1px; }
.ep-contact-about { background: var(--ep-card); border-left: 3px solid var(--ep-blue); padding: .75rem 1rem; }
.ep-contact .ep-btn { margin-bottom: 1rem; }
.ep-contact-alt { color: var(--ep-muted); font-size: .9rem; }
.ep-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ep-notice { max-width: 720px; box-sizing: border-box; padding: .9rem 1rem; border-radius: 6px; margin: 0 0 1.25rem; border: 1px solid var(--ep-line); border-left-width: 4px; background: var(--ep-card); color: var(--ep-text); }
.ep-notice-ok { border-left-color: #22a35a; }
.ep-notice-err { border-left-color: #e0443a; }
@media (max-width: 600px) { .ep-contact-grid { grid-template-columns: 1fr; } }
