/* =============================================================================
   KSK Store - Main Stylesheet
   Theme: KsK Racing (Red, Black, White)
   ============================================================================= */

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  --ksk-red:     #c8102e;
  --ksk-red-dk:  #9b0c22;
  --ksk-black:   #111;
  --ksk-dark:    #1a1a1a;
  --ksk-mid:     #2d2d2d;
  --ksk-grey:    #666;
  --ksk-light:   #f5f5f5;
  --ksk-white:   #fff;
  --ksk-border:  #ddd;
  --font-main:   'Segoe UI', Arial, sans-serif;
  --radius:      6px;
  --shadow:      0 2px 12px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.18);
  --transition:  .18s ease;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font-main); color: var(--ksk-black); background: var(--ksk-white); font-size: 16px; line-height: 1.6; }
img  { max-width: 100%; height: auto; display: block; }
a    { color: var(--ksk-red); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 640px; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .65rem 1.5rem; border-radius: var(--radius); font-size: .925rem; font-weight: 700; border: none; cursor: pointer; transition: background var(--transition), transform .1s; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ksk-red); color: var(--ksk-white); }
.btn-primary:hover { background: var(--ksk-red-dk); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--ksk-red); border: 2px solid var(--ksk-red); }
.btn-secondary:hover { background: var(--ksk-red); color: var(--ksk-white); text-decoration: none; }
.btn-hero { background: var(--ksk-red); color: var(--ksk-white); font-size: 1.1rem; padding: .85rem 2.2rem; }
.btn-hero:hover { background: var(--ksk-red-dk); text-decoration: none; }
.btn-block { width: 100%; display: flex; }

/* ── Header ──────────────────────────────────────────────────────────────────── */
.site-header { background: var(--ksk-black); color: var(--ksk-white); position: sticky; top: 0; z-index: 200; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; gap: 2rem; height: 64px; }
.header-brand { display: flex; align-items: center; }
.header-logo { height: 42px; width: auto; }
.header-nav { display: flex; gap: 1.5rem; flex: 1; }
.header-nav a { color: rgba(255,255,255,.85); font-weight: 600; font-size: .9rem; letter-spacing: .5px; text-transform: uppercase; transition: color var(--transition); }
.header-nav a:hover { color: var(--ksk-white); text-decoration: none; }
.cart-btn { background: var(--ksk-red); border: none; color: var(--ksk-white); border-radius: var(--radius); padding: .4rem .85rem; display: flex; align-items: center; gap: .4rem; cursor: pointer; font-size: .9rem; font-weight: 700; transition: background var(--transition); }
.cart-btn:hover { background: var(--ksk-red-dk); }
.cart-count { background: var(--ksk-white); color: var(--ksk-red); border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 900; }

/* ── Hero ────────────────────────────────────────────────────────────────────── */
/* Hero background-image is set via inline style (updated by Page Settings) */
/* Fallback: if no inline style is set the overlay still renders */
.hero { position: relative; min-height: 520px; display: flex; align-items: center; background-color: #111; background-size: cover; background-position: center; background-repeat: no-repeat; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,0,0,.72) 0%, rgba(180,10,30,.45) 100%); }
.hero-content { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 4rem 1.5rem; }
.hero-eyebrow { font-size: .85rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.7); margin-bottom: .5rem; }
.hero-title { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 900; color: var(--ksk-white); line-height: 1.1; margin-bottom: 1rem; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.hero-subtitle { font-size: 1.15rem; color: rgba(255,255,255,.85); margin-bottom: 2rem; max-width: 520px; }

/* ── Sections ────────────────────────────────────────────────────────────────── */
.section { padding: 4rem 0; }
.section-dark { background: var(--ksk-dark); color: var(--ksk-white); }
.section-dark .section-title { color: var(--ksk-white); }
.section-dark .section-lead { color: rgba(255,255,255,.75); }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; color: var(--ksk-black); margin-bottom: 1rem; position: relative; padding-bottom: .5rem; }
.section-title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 48px; height: 3px; background: var(--ksk-red); border-radius: 2px; }
.section-lead { color: var(--ksk-grey); margin-bottom: 2rem; font-size: 1.05rem; }

/* ── Filter Bar ──────────────────────────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.filter-btn { padding: .4rem 1rem; border: 2px solid var(--ksk-border); border-radius: 20px; background: transparent; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--ksk-grey); transition: all var(--transition); }
.filter-btn.active, .filter-btn:hover { background: var(--ksk-red); color: var(--ksk-white); border-color: var(--ksk-red); }

/* Product Grid */
.product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:1.5rem}
.product-card{background:var(--ksk-white);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;transition:transform var(--transition),box-shadow var(--transition);cursor:pointer}
.product-card:hover{transform:translateY(-4px);box-shadow:var(--shadow-lg)}
.product-img-wrap{aspect-ratio:1;overflow:hidden;background:var(--ksk-light);background-size:100%;background-position:50% 50%;background-repeat:no-repeat;transition:background-size .3s}
.product-img-wrap img{width:100%;height:100%;object-fit:cover;transition:transform .3s}
.product-card:hover .product-img-wrap img{transform:scale(1.05)}
.product-info{padding:1rem}
.product-category{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.8px;color:var(--ksk-red);margin-bottom:.25rem}
.product-name{font-size:.975rem;font-weight:700;color:var(--ksk-black);margin-bottom:.3rem;line-height:1.3}
.product-price{font-size:1.05rem;font-weight:900;color:var(--ksk-red)}
.product-actions{padding:0 1rem 1rem}
.product-actions .btn{width:100%}
/* Cart Drawer */
.cart-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:299;opacity:0;pointer-events:none;transition:opacity var(--transition)}
.cart-overlay.open{opacity:1;pointer-events:all}
.cart-drawer{position:fixed;top:0;right:-420px;width:420px;max-width:100vw;height:100vh;background:var(--ksk-white);z-index:300;display:flex;flex-direction:column;box-shadow:-4px 0 24px rgba(0,0,0,.15);transition:right .28s ease}
.cart-drawer.open{right:0}
.cart-header{display:flex;align-items:center;justify-content:space-between;padding:1.25rem 1.5rem;border-bottom:1px solid var(--ksk-border);background:var(--ksk-black);color:var(--ksk-white)}
.cart-header h3{font-size:1.1rem;font-weight:700}
.cart-close{background:none;border:none;color:var(--ksk-white);font-size:1.5rem;cursor:pointer;line-height:1}
.cart-items{flex:1;overflow-y:auto;padding:1rem 1.5rem}
.cart-empty{color:var(--ksk-grey);text-align:center;padding:2rem 0}
.cart-item{display:flex;gap:.75rem;align-items:flex-start;padding:.75rem 0;border-bottom:1px solid var(--ksk-border)}
.cart-item-img{width:64px;height:64px;object-fit:cover;border-radius:4px;background:var(--ksk-light);flex-shrink:0}
.cart-item-details{flex:1;min-width:0}
.cart-item-name{font-weight:700;font-size:.9rem}
.cart-item-variant{font-size:.8rem;color:var(--ksk-grey)}
.cart-item-price{font-size:.9rem;color:var(--ksk-red);font-weight:700}
.cart-item-controls{display:flex;align-items:center;gap:.5rem;margin-top:.4rem}
.cart-qty-btn{width:26px;height:26px;border:1px solid var(--ksk-border);background:var(--ksk-light);cursor:pointer;border-radius:4px;font-size:1rem;font-weight:700;display:flex;align-items:center;justify-content:center}
.cart-qty-btn:hover{background:var(--ksk-red);color:var(--ksk-white);border-color:var(--ksk-red)}
.cart-qty{font-weight:700;min-width:20px;text-align:center}
.cart-remove{background:none;border:none;color:var(--ksk-grey);cursor:pointer;font-size:.8rem;padding:.2rem .4rem;border-radius:3px}
.cart-remove:hover{background:#fee2e2;color:#b91c1c}
.cart-footer{padding:1.25rem 1.5rem;border-top:1px solid var(--ksk-border);background:var(--ksk-light)}
.cart-total{display:flex;justify-content:space-between;font-size:1.05rem;margin-bottom:1rem}
.cart-total strong{color:var(--ksk-red);font-size:1.2rem}

/* Modals */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:400;display:flex;align-items:center;justify-content:center;padding:1rem;opacity:0;pointer-events:none;transition:opacity var(--transition)}
.modal-overlay.open{opacity:1;pointer-events:all}
.product-modal{background:var(--ksk-white);border-radius:10px;max-width:780px;width:100%;max-height:90vh;overflow-y:auto;position:relative;box-shadow:var(--shadow-lg)}
.modal-close{position:absolute;top:.75rem;right:.75rem;background:var(--ksk-black);color:var(--ksk-white);border:none;border-radius:50%;width:32px;height:32px;font-size:1.2rem;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:1}
.product-modal-inner{display:grid;grid-template-columns:1fr 1fr;gap:0}
.product-modal-img{aspect-ratio:1;overflow:hidden;border-radius:10px 0 0 10px;background:var(--ksk-light)}
.product-modal-img img{width:100%;height:100%;object-fit:cover}
.product-modal-img[style]{background-color:var(--ksk-light)}
.product-modal-details{padding:2rem}
.product-modal-category{font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.8px;color:var(--ksk-red);margin-bottom:.4rem}
.product-modal-name{font-size:1.4rem;font-weight:900;margin-bottom:.5rem}
.product-modal-price{font-size:1.4rem;font-weight:900;color:var(--ksk-red);margin-bottom:1rem}
.product-modal-desc{color:var(--ksk-grey);font-size:.9rem;line-height:1.6;margin-bottom:1.5rem}
.variant-label{font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--ksk-black);margin-bottom:.4rem}
.size-grid{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:1.5rem}
.size-btn{padding:.35rem .7rem;border:2px solid var(--ksk-border);border-radius:4px;background:transparent;cursor:pointer;font-size:.85rem;font-weight:600;transition:all var(--transition)}
.size-btn.selected{background:var(--ksk-black);color:var(--ksk-white);border-color:var(--ksk-black)}
.size-btn:hover{border-color:var(--ksk-black)}
/* Out-of-stock size button */
.size-btn--oos{opacity:.42;cursor:not-allowed!important;text-decoration:line-through;color:var(--ksk-grey)!important;border-color:#e2e6ea!important;background:#f8f9fa!important}
.size-btn--oos:hover{border-color:#e2e6ea!important;background:#f8f9fa!important;transform:none!important}
.qty-row{display:flex;align-items:center;gap:1rem;margin-bottom:1.5rem}
.qty-ctrl{display:flex;align-items:center;gap:.5rem}
.qty-btn{width:32px;height:32px;border:2px solid var(--ksk-border);background:var(--ksk-white);cursor:pointer;border-radius:4px;font-size:1.1rem;font-weight:700}
.qty-btn:hover{background:var(--ksk-black);color:var(--ksk-white);border-color:var(--ksk-black)}
.qty-val{font-size:1.1rem;font-weight:700;min-width:24px;text-align:center}
/* Checkout */
.checkout-modal{background:var(--ksk-white);border-radius:10px;max-width:520px;width:100%;max-height:90vh;overflow-y:auto;padding:2rem;position:relative}
.checkout-modal h3{font-size:1.4rem;font-weight:900;margin-bottom:1.5rem}
.form-group{margin-bottom:1.1rem}
.form-group label{display:block;font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--ksk-black);margin-bottom:.35rem}
.form-group input,.form-group textarea,.form-group select{width:100%;padding:.6rem .85rem;border:1.5px solid var(--ksk-border);border-radius:var(--radius);font-size:.9rem;font-family:inherit;color:var(--ksk-black);transition:border-color var(--transition);background:var(--ksk-white);resize:vertical}
.form-group input:focus,.form-group textarea:focus{outline:none;border-color:var(--ksk-red);box-shadow:0 0 0 3px rgba(200,16,46,.12)}
.checkout-summary{background:var(--ksk-light);border-radius:var(--radius);padding:.85rem 1rem;margin-bottom:1.1rem;font-size:.9rem}
.checkout-summary-item{display:flex;justify-content:space-between;padding:.25rem 0;border-bottom:1px solid var(--ksk-border)}
.checkout-summary-item:last-child{border-bottom:none}
.checkout-summary-total{display:flex;justify-content:space-between;font-weight:700;padding-top:.4rem;font-size:.95rem}
.checkout-note{text-align:center;color:var(--ksk-grey);font-size:.82rem;margin-top:.75rem}
.recaptcha-wrap{display:flex;justify-content:center}
.alert{padding:.75rem 1rem;border-radius:var(--radius);font-size:.875rem;margin-bottom:1rem}
.alert-success{background:#d1fae5;color:#065f46;border:1px solid #a7f3d0}
.alert-error{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}
.order-success-modal{background:var(--ksk-white);border-radius:10px;max-width:440px;width:100%;padding:2.5rem 2rem;text-align:center}
.success-icon{font-size:3rem;margin-bottom:1rem}
.order-success-modal h3{font-size:1.5rem;font-weight:900;margin-bottom:.5rem}
.order-success-modal p{color:var(--ksk-grey);margin-bottom:.75rem}
.order-number-display{font-size:1.5rem;font-weight:900;color:var(--ksk-red);letter-spacing:2px;background:var(--ksk-light);padding:.75rem 1rem;border-radius:var(--radius);margin:.5rem 0 1rem}

/* Events */
.events-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1.5rem}
.event-card{background:var(--ksk-mid);border-radius:var(--radius);padding:1.5rem;border-left:4px solid var(--ksk-red)}
.event-date-label{font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.8px;color:var(--ksk-red);margin-bottom:.3rem}
.event-title{font-size:1.1rem;font-weight:700;color:var(--ksk-white);margin-bottom:.25rem}
.event-venue{font-size:.9rem;color:rgba(255,255,255,.7);margin-bottom:.5rem}
.event-desc{font-size:.85rem;color:rgba(255,255,255,.6);line-height:1.5}
/* Order Lookup */
.lookup-form{display:flex;gap:1rem;margin-bottom:1.5rem;flex-wrap:wrap;align-items:flex-end}
.lookup-form .form-group{flex:1;min-width:260px;margin-bottom:0}
.lookup-result{background:var(--ksk-light);border-radius:var(--radius);padding:1.5rem;margin-top:1rem}
.lookup-result h4{font-size:1rem;font-weight:700;margin-bottom:.75rem}
.order-result-row{display:flex;justify-content:space-between;padding:.3rem 0;border-bottom:1px solid var(--ksk-border);font-size:.9rem}
.order-result-row:last-child{border-bottom:none}
.order-items-list{margin:.5rem 0;padding-left:1.2rem;font-size:.85rem;color:var(--ksk-grey)}
.status-badge{display:inline-block;padding:.2rem .6rem;border-radius:12px;font-size:.75rem;font-weight:700;text-transform:uppercase}
.status-Pending{background:#fef3c7;color:#92400e}
.status-Preparing{background:#dbeafe;color:#1e40af}
.status-Ready{background:#d1fae5;color:#065f46}
.status-Delivered{background:#e0e7ff;color:#3730a3}
.status-Cancelled{background:#fee2e2;color:#991b1b}
/* Footer */
.site-footer{background:var(--ksk-black);color:rgba(255,255,255,.8);padding:3rem 0 1.5rem}
.footer-inner{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:2rem;margin-bottom:2rem}
.footer-brand img{height:48px;width:auto;margin-bottom:.75rem}
.footer-brand p{font-size:.85rem;color:rgba(255,255,255,.6);line-height:1.5}
.footer-links h4,.footer-info h4{font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.8px;color:var(--ksk-red);margin-bottom:.75rem}
.footer-links a{display:block;color:rgba(255,255,255,.7);font-size:.875rem;margin-bottom:.35rem;text-decoration:none}
.footer-links a:hover{color:var(--ksk-white)}
.footer-info p,.footer-info li{font-size:.85rem;color:rgba(255,255,255,.6);margin-bottom:.3rem}
.footer-info ol{padding-left:1.2rem}
.footer-bottom{border-top:1px solid rgba(255,255,255,.1);padding-top:1.5rem;text-align:center;font-size:.82rem;color:rgba(255,255,255,.4)}
/* Misc */
.loading-msg{color:var(--ksk-grey);padding:2rem;text-align:center;font-style:italic;grid-column:1/-1}
.no-results{color:var(--ksk-grey);padding:2rem;text-align:center;grid-column:1/-1}
/* Responsive */
@media(max-width:768px){
  .header-nav{display:none}
  .product-modal-inner{grid-template-columns:1fr}
  .product-modal-img{border-radius:10px 10px 0 0}
  .lookup-form{flex-direction:column}
}
@media(max-width:480px){
  .hero-title{font-size:1.9rem}
  .section{padding:2.5rem 0}
  .cart-drawer{width:100vw}
  .checkout-modal{padding:1.25rem}
}
