/*
Theme Name: Galopi Neo V8.1
Theme URI: https://galopi.pl
Author: Dawid & AI
Description: Neo V8 z widoczną mądrą wyszukiwarką AJAX + poprawiona siatka produktów
Version: 8.1
*/

:root {
    --neo-bg: #FFFFFF;
    --neo-surface: #FAFAFA;
    --neo-text: #2D3748;
    --neo-text-light: #718096;
    --neo-primary: #1A202C;
    --neo-accent: #E2E8F0;
    --neo-border: #edf2f7;
    --neo-radius: 20px;
    --neo-shadow: 0 4px 24px -6px rgba(0,0,0,0.03);
    --neo-color: #cbd5e1;
    --neo-input-bg: #F7FAFC;
    --neo-blue: #0071e3;
}

body {
    font-family: 'Inter', sans-serif; color: var(--neo-text);
    background-color: var(--neo-bg); margin: 0; padding: 0;
    -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6 { font-family: 'Outfit', sans-serif; font-weight: 700; color: var(--neo-primary); }
a { text-decoration: none; color: var(--neo-primary); transition: color 0.3s; }
a:hover { opacity: 0.7; }
* { box-sizing: border-box; }

/* ----------------------
   HEADER & MEGA MENU
----------------------- */
.neo-header {
    position: sticky; top: 0; z-index: 9999; height: 90px; width: 100%;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--neo-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 5%;
}
.neo-logo {
    font-family: 'Outfit', sans-serif; font-weight: 900; font-size: 2rem;
    letter-spacing: -1px; color: var(--neo-primary) !important;
}

.neo-header-center {
    display: flex; flex: 1; align-items: center; justify-content: center; gap: 3rem; margin: 0 2rem;
}

/* Smart Dropdown Categories */
.neo-nav { display: flex; align-items: center; gap: 1.5rem; }
.neo-nav-item { font-size: 1rem; font-weight: 600; color: var(--neo-text); position: relative; cursor: pointer; padding: 15px 0; }
.neo-nav-item:hover { color: var(--neo-blue); }

.neo-mega-menu {
    position: absolute; top: 100%; left: -50px; min-width: 250px;
    background: rgba(255,255,255,0.98); backdrop-filter: blur(30px);
    border: 1px solid var(--neo-border); border-radius: 16px;
    padding: 1.5rem; box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    opacity: 0; visibility: hidden; transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); display:flex; flex-direction: column; gap: 0.8rem;
}
.neo-nav-item:hover .neo-mega-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.neo-mega-menu a {
    padding: 12px 18px; display:block; border-radius: 8px; font-weight: 500; font-size:0.95rem; background: var(--neo-surface);
}
.neo-mega-menu a:hover {
    background: var(--neo-blue); color: #fff; transform: translateX(5px); transition: all 0.2s;
}

/* ----------------------
   AJAX SEARCH BAR V8 (Exposed)
----------------------- */
.neo-search-container { position: relative; width: 600px; max-width: 100%; }
.neo-search-input-wrapper {
    position: relative; display: flex; align-items: center;
    background: #fff; border-radius: 12px; padding: 5px 25px;
    border: 2px solid var(--neo-primary); transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.neo-search-input-wrapper:focus-within { border-color: var(--neo-blue); box-shadow: 0 4px 15px rgba(0,113,227,0.2); transform: translateY(-1px); }
.neo-search-input-wrapper svg { width: 22px; height: 22px; color: var(--neo-primary); font-weight:bold; }
.neo-search-input-wrapper input {
    background: none; border: none; outline: none; padding: 15px 15px; width: 100%;
    font-family: inherit; font-size: 1.1rem; color: var(--neo-text); font-weight:500;
}
.neo-search-input-wrapper input::placeholder { color: #a0aec0; font-weight:400; }

/* Dropdown Results */
.neo-search-dropdown {
    position: absolute; top: calc(100% + 15px); left: 0; right: 0;
    background: #fff; border: 1px solid var(--neo-border); border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12); overflow: hidden;
    z-index: 10000; display: none; flex-direction: column; max-height: max-content;
}
.neo-search-dropdown.active { display: flex; }
.neo-search-item {
    display: flex; align-items: center; gap: 18px; padding: 15px 25px; border-bottom: 1px solid var(--neo-surface);
    transition: background 0.2s;
}
.neo-search-item:hover { background: var(--neo-surface); }
.neo-search-item img {
    width: 50px; height: 50px; border-radius: 10px; object-fit: contain; background: #fafafa; border:1px solid #eee;
}
.neo-search-item div { display: flex; flex-direction: column; }
.neo-search-item strong { font-size: 1rem; color: var(--neo-primary); margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp:1; overflow:hidden; font-weight:600;}
.neo-search-item span { font-size: 0.9rem; font-weight: 700; color: var(--neo-blue); }
.neo-search-empty { padding: 30px; text-align: center; color: var(--neo-text-light); font-size: 1rem; }
.neo-search-loading { padding: 30px; text-align: center; }

.neo-search-more {
    display: block; text-align: center; padding: 18px; background: var(--neo-surface);
    color: var(--neo-blue); font-weight: 700; border-top: 1px solid var(--neo-border);
    transition: background 0.2s; text-decoration:none;
}
.neo-search-more:hover { background: var(--neo-primary); color: #fff; }

/* ----------------------
   WOOCOMMERCE OVERRIDES
----------------------- */
.neo-wc-wrap { max-width: 1400px; margin: 40px auto; padding: 0 5%; min-height: 60vh; }
.woocommerce div.product { display: flex; flex-wrap: wrap; gap: 4rem; justify-content: space-between; }
.woocommerce div.product div.images { width: 48%; border-radius: var(--neo-radius); overflow: hidden; background: var(--neo-surface); padding: 2rem; border: 1px solid var(--neo-border); }
.woocommerce div.product div.summary { width: 45%; padding-top: 1rem; }

.product_title { font-size: 2.5rem !important; letter-spacing: -1px; margin-bottom: 1rem !important; }
.woocommerce-product-details__short-description { color: var(--neo-text-light); line-height: 1.6; font-size: 1.1rem; margin-bottom: 2rem; }
.price { font-family: 'Outfit'; font-size: 1.8rem; font-weight: 800; color: var(--neo-primary) !important; margin-bottom: 1.5rem !important; }

.woocommerce button.button.alt { background: var(--neo-primary) !important; color: #fff !important; padding: 18px 36px !important; border-radius: 100px !important; font-family: 'Outfit'; font-weight: 700; font-size: 1.1rem; transition: all 0.3s; }
.woocommerce button.button.alt:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); background: #000 !important; }
.woocommerce .quantity .qty { border: 1px solid var(--neo-border); border-radius: 50px; padding: 16px; background: var(--neo-input-bg); width: 80px; text-align: center; margin-right: 1rem; font-size: 1.1rem; font-family: 'Inter'; font-weight: 600; }

.woocommerce input[type="text"], .woocommerce input[type="email"], .woocommerce input[type="password"], .woocommerce input[type="tel"], .woocommerce textarea { width: 100%; padding: 16px; font-size: 1rem; border: 1px solid var(--neo-border) !important; border-radius: 12px !important; background: var(--neo-input-bg) !important; margin-bottom: 1rem; transition: border-color 0.3s; }
.woocommerce input:focus, .woocommerce textarea:focus { border-color: var(--neo-blue) !important; outline: none; }

.woocommerce-cart .cart-collaterals, .woocommerce-checkout #order_review { background: var(--neo-surface); padding: 3rem; border-radius: var(--neo-radius); border: 1px solid var(--neo-border); }
.woocommerce-checkout #payment { background: #fff; border-radius: 12px; border: 1px solid var(--neo-border); }
.woocommerce table.shop_table { border: none; border-collapse: separate; border-spacing: 0 1rem; }
.woocommerce table.shop_table th { border: none; text-transform: uppercase; font-size: 0.8rem; color: var(--neo-text-light); }
.woocommerce table.shop_table td { border-top: 1px solid var(--neo-border); border-bottom: 1px solid var(--neo-border); padding: 1.5rem 1rem; background: #fff; }
.woocommerce table.shop_table td.product-thumbnail { border-left: 1px solid var(--neo-border); border-radius: 12px 0 0 12px; }
.woocommerce table.shop_table td.product-subtotal { border-right: 1px solid var(--neo-border); border-radius: 0 12px 12px 0; }
.woocommerce-message, .woocommerce-error, .woocommerce-info { background: var(--neo-surface); border-top-color: var(--neo-primary); color: var(--neo-text); border-radius: 12px; }

ul.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; align-items: stretch; }
ul.products li.product { width: 100% !important; margin: 0 !important; background: #fff; border-radius: var(--neo-radius); padding: 1.5rem; border: 1px solid var(--neo-border); transition: transform 0.4s ease; text-align: center; }
ul.products li.product:hover { transform: translateY(-8px); box-shadow: var(--neo-shadow); border-color: transparent; }
ul.products li.product img { width: 100%; aspect-ratio: 1; object-fit: contain; margin-bottom: 1.5rem; }
ul.products li.product h2 { font-size: 1.1rem; color: var(--neo-text); margin-bottom: 0.5rem; display: -webkit-box; -webkit-line-clamp: 2; overflow: hidden; }
ul.products li.product .price { font-size: 1.2rem; font-weight: 700; color: var(--neo-primary); }

/* FOOTER */
.neo-footer { background: var(--neo-surface); color: var(--neo-text-light); padding: 5rem 5% 3rem; border-top: 1px solid var(--neo-border); margin-top: 5rem; }
.neo-footer-inner { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 3rem; }
.neo-footer h4 { font-family: 'Outfit', sans-serif; font-size: 1.2rem; color: var(--neo-primary); margin-bottom: 1.5rem; }
.neo-footer ul { list-style: none; padding: 0; margin: 0; }
.neo-footer ul li { margin-bottom: 0.8rem; }

@media(max-width: 1024px) {
    .neo-header-center { width:100%; justify-content:center; }
    .neo-nav { display: none; }
    .neo-search-container { width: 100%; margin: 0 1rem; }
    .woocommerce div.product div.images, .woocommerce div.product div.summary { width: 100%; }
    ul.products { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}

@media(max-width: 600px) {
    .neo-header { height: auto; padding: 15px 5%; flex-wrap: wrap; gap: 15px; }
    ul.products { grid-template-columns: 1fr; }
}
