/* ════════════════════════════════════════════════════════
 * Celtics Pharmaceuticals — Responsive & UI Components
 * Loaded after style.css
 * ════════════════════════════════════════════════════════ */

/* ── Topbar transition ── */
.site-topbar {
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.site-topbar.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

/* ── Header scrolled shadow ── */
.site-header.scrolled {
    box-shadow: 0 1px 12px rgba(0,0,0,0.07);
}

/* ── Body lock when overlay open ── */
body.overlay-open {
    overflow: hidden;
}

/* ── Cart label hide on small ── */
@media (max-width: 480px) {
    .cart-label { display: none; }
}

/* ══════════════════════════════════════════════════════
 * SEARCH OVERLAY
 * ══════════════════════════════════════════════════════ */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.search-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.search-overlay-inner {
    width: 100%;
    max-width: 600px;
    margin: 0 20px;
    transform: translateY(-16px);
    transition: transform 0.2s ease;
}
.search-overlay.open .search-overlay-inner {
    transform: translateY(0);
}
.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}
.search-form input[type="search"] {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: var(--text, #111);
    background: transparent;
    font-family: 'Inter', sans-serif;
    min-width: 0;
}
.search-form input[type="search"]::placeholder { color: #9CA3AF; }
.btn-search-go {
    background: var(--g, #1A6B3C);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    transition: background 0.15s;
}
.btn-search-go:hover { background: var(--gm, #2E8B57); }
.btn-search-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #9CA3AF;
    display: flex;
    align-items: center;
    padding: 4px;
    flex-shrink: 0;
    transition: color 0.15s;
}
.btn-search-close:hover { color: var(--text, #111); }

/* ══════════════════════════════════════════════════════
 * MINI CART SIDEBAR
 * ══════════════════════════════════════════════════════ */
.cart-overlay {
    position: fixed;
    inset: 0;
    z-index: 350;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.cart-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.cart-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 100vw;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 32px rgba(0,0,0,0.1);
}
.cart-overlay.open .cart-sidebar {
    transform: translateX(0);
}
.cs-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border, #E5E7EB);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.cs-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #111);
}
.cs-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted, #6B7280);
    display: flex;
    align-items: center;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.15s;
}
.cs-close:hover { background: #F3F4F6; color: var(--text, #111); }
.cs-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cs-body::-webkit-scrollbar { width: 3px; }
.cs-body::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 2px; }
.cs-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    text-align: center;
    color: var(--muted, #6B7280);
    font-size: 14px;
    flex: 1;
}
.cs-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border, #E5E7EB);
}
.cs-item:last-child { border-bottom: none; padding-bottom: 0; }
.cs-item-img {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 8px;
    overflow: hidden;
    background: var(--off, #FAFAF9);
}
.cs-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cs-item-info {
    flex: 1;
    min-width: 0;
}
.cs-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text, #111);
    margin-bottom: 4px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cs-item-meta {
    font-size: 12px;
    color: var(--muted, #6B7280);
    margin-bottom: 4px;
}
.cs-item-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #111);
}
.cs-remove {
    flex-shrink: 0;
    color: var(--light, #9CA3AF);
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s;
    text-decoration: none;
}
.cs-remove:hover { color: #EF4444; }
.cs-foot {
    padding: 16px 20px 20px;
    border-top: 1px solid var(--border, #E5E7EB);
    flex-shrink: 0;
}
.cs-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border, #E5E7EB);
}
.cs-total-price { color: var(--text, #111); }
.btn-checkout-go {
    display: block;
    width: 100%;
    background: var(--g, #1A6B3C);
    color: #fff;
    text-align: center;
    padding: 13px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 8px;
    transition: background 0.15s;
}
.btn-checkout-go:hover { background: var(--gm, #2E8B57); color: #fff; }
.btn-view-cart {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--muted, #6B7280);
    text-decoration: none;
    border: 1px solid var(--border, #E5E7EB);
    transition: all 0.15s;
}
.btn-view-cart:hover { color: var(--text, #111); border-color: #9CA3AF; }

/* ══════════════════════════════════════════════════════
 * MOBILE NAV DRAWER
 * ══════════════════════════════════════════════════════ */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 350;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.mobile-nav-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.mobile-nav-drawer {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-nav-overlay.open .mobile-nav-drawer {
    transform: translateX(0);
}
.mobile-nav-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border, #E5E7EB);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.mobile-nav-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}
.mobile-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mobile-menu li a {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
    color: var(--text, #111);
    text-decoration: none;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}
.mobile-menu li a:hover {
    background: var(--gl, #E8F5EE);
    border-left-color: var(--g, #1A6B3C);
    color: var(--g, #1A6B3C);
}
.mobile-menu-sep {
    height: 1px;
    background: var(--border, #E5E7EB);
    margin: 8px 20px;
}

/* ══════════════════════════════════════════════════════
 * CATEGORY BAR — icons
 * ══════════════════════════════════════════════════════ */
.cat-link {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cat-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: var(--muted, #6B7280);
    transition: color 0.15s;
}
.cat-link:hover .cat-icon,
.cat-link.current .cat-icon {
    color: var(--g, #1A6B3C);
}

/* ══════════════════════════════════════════════════════
 * RESPONSIVE — TABLET (≤ 1024px)
 * ══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .container,
    .nav-inner,
    .category-bar-inner,
    .trust-bar-inner,
    .shop-wrap,
    .pp-wrap,
    .co-wrap,
    .acc-wrap {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 24px !important;
    }
    .hero-grid {
        grid-template-columns: 1fr 340px !important;
        gap: 40px !important;
    }
}

/* ══════════════════════════════════════════════════════
 * RESPONSIVE — MOBILE (≤ 768px)
 * ══════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* Header */
    .main-navigation { display: none !important; }
    .btn-hamburger   { display: flex !important; }
    .nav-inner       { gap: 12px !important; padding: 0 16px !important; }
    .site-header     { height: 56px; }
    .nav-inner       { height: 56px; }
    .logo-main       { font-size: 14px !important; }

    /* Topbar */
    .site-topbar { font-size: 11px; }

    /* Category bar — horizontal scroll, no clipping */
    .category-bar-inner { padding: 0 16px !important; gap: 0; }
    .cat-link            { padding: 11px 14px; font-size: 12px; }
    .cat-name            { white-space: nowrap; }

    /* Hero */
    .hero-section  { padding: 40px 0 32px !important; }
    .hero-grid     { grid-template-columns: 1fr !important; gap: 32px !important; }
    .hero-stats    { display: none !important; }
    .hero-title    { font-size: 36px !important; }
    .hero-desc     { font-size: 14px !important; margin-bottom: 24px !important; }
    .hero-buttons  { flex-wrap: wrap; gap: 10px; }
    .btn-primary,
    .btn-outline   { width: 100%; text-align: center; padding: 13px 20px !important; font-size: 14px !important; }

    /* Product grid */
    .woocommerce ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 12px !important;
        padding: 10px 12px 0 !important;
    }
    .woocommerce ul.products li.product .price {
        font-size: 18px !important;
        padding: 4px 12px 0 !important;
    }
    .woocommerce ul.products li.product a img { height: 160px !important; }
    .woocommerce ul.products li.product .button {
        margin: 8px 12px 12px !important;
        font-size: 11px !important;
        padding: 7px 12px !important;
    }

    /* Spec badge smaller on mobile grid */
    .celtics-spec-badge { font-size: 9px !important; padding: 3px 7px !important; }

    /* Single product */
    .woocommerce div.product {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    .woocommerce div.product .product_title { font-size: 24px !important; }
    .woocommerce div.product p.price { font-size: 28px !important; }

    /* Cart */
    .woocommerce-cart .woocommerce {
        grid-template-columns: 1fr !important;
    }
    .woocommerce-cart table.cart th { display: none; }
    .woocommerce-cart table.cart td { display: block; padding: 8px 12px !important; }
    .woocommerce-cart table.cart td.product-remove { text-align: right; }

    /* Checkout */
    .woocommerce-checkout .woocommerce {
        grid-template-columns: 1fr !important;
    }
    .form-row { grid-template-columns: 1fr !important; }

    /* My account */
    .woocommerce-account .woocommerce {
        grid-template-columns: 1fr !important;
    }
    .woocommerce-MyAccount-navigation { position: static !important; }

    /* Trust bar */
    .trust-bar-inner {
        gap: 20px !important;
        justify-content: flex-start !important;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding: 16px !important;
        scrollbar-width: none;
    }
    .trust-bar-inner::-webkit-scrollbar { display: none; }
    .trust-item { flex-shrink: 0; }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 28px !important;
    }
    .footer-bottom {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    .footer-disclaimer { text-align: left !important; max-width: 100% !important; }

    /* Cart sidebar full width on mobile */
    .cart-sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Section header */
    .section-header { margin-bottom: 20px; }
    .section-title  { font-size: 22px !important; }

    /* Promo banner */
    .promo-banner {
        padding: 24px 20px !important;
        flex-direction: column;
        gap: 16px;
    }
    .promo-banner h3 { font-size: 22px !important; }
    .promo-banner svg { display: none; }

    /* Container padding */
    .container,
    .shop-wrap,
    .pp-wrap,
    .co-wrap {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* ══════════════════════════════════════════════════════
 * RESPONSIVE — SMALL MOBILE (≤ 400px)
 * ══════════════════════════════════════════════════════ */
@media (max-width: 400px) {
    .woocommerce ul.products {
        grid-template-columns: 1fr !important;
    }
    .hero-title { font-size: 30px !important; }
}

/* ══════════════════════════════════════════════════════
 * ADD TO CART button feedback
 * ══════════════════════════════════════════════════════ */
.btn-cart-header.cart-added {
    background: var(--gm, #2E8B57) !important;
}
.cart-count-badge:empty { display: none; }
