/* ===========================================================
   AYURCALL LAYOUT — Unified Coral 2025 · Pure White
   Header, Footer & Core Layout Styles
=========================================================== */

/* ===========================================================
   HEADER
=========================================================== */
.ayurcall-header {
    position: sticky;
    top: 0;
    width: 100%;
    background: var(--brand-white);
    box-shadow: var(--shadow-header);
    z-index: var(--z-header);
    font-family: var(--font-heading);
    transition: box-shadow var(--transition-base);
}

.header-container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-logo img {
    display: block;
    max-height: 42px;
    width: auto;
}

/* Desktop search */
.header-search {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 420px;
    position: relative;
}

.header-search-input {
    width: 100%;
    padding: 0.55rem 2.25rem 0.55rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

    .header-search-input:focus {
        outline: none;
        border-color: var(--coral-500);
        box-shadow: 0 0 0 3px var(--coral-light);
    }

input[type="search"] {
    -webkit-appearance: none;
    outline: none;
    box-shadow: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

    input[type="search"]:focus {
        border-color: var(--coral-500);
        box-shadow: 0 0 0 3px var(--coral-light);
        outline: none;
    }

.header-search-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .header-search-btn img {
        width: 20px;
        height: 20px;
    }

/* ===========================================================
   ICONS
=========================================================== */
.header-icons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--brand-white);
    transition: background var(--transition-fast), transform var(--transition-fast);
}


    .icon-link img {
        width: 20px;
        height: 20px;
    }

.cart-total-amount {
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.25rem;
    color: var(--coral-600);
}

/* ===========================================================
   MOBILE SEARCH BAR
=========================================================== */
.mobile-header-search {
    display: none;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
}

.mobile-header-input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* ===========================================================
   MOBILE OVERLAY
=========================================================== */
.mobile-search-overlay {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    background: var(--overlay-bg);
    z-index: var(--z-overlay);
    overflow-y: auto;
    transition: opacity var(--transition-base);
}

    .mobile-search-overlay.active {
        display: flex;
        animation: fadeIn 0.25s ease forwards;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    background: var(--brand-white);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-header);
    display: flex;
    flex-direction: column;
}

.overlay-search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .overlay-search-form input {
        flex: 1;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
        color: var(--text-dark);
    }

        .overlay-search-form input:focus {
            outline: none;
            border-color: var(--coral-500);
            box-shadow: 0 0 0 3px var(--coral-light);
        }

.back-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.overlay-results {
    padding: 1rem;
    font-family: var(--font-body);
    color: var(--text-dark);
}

/* ===========================================================
   MINI CART DROPDOWN
=========================================================== */
.mini-cart-body {
    max-height: 260px;
    overflow-y: auto;
    padding: 10px 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

.mini-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

    .mini-cart-item img {
        width: 60px;
        height: 60px;
        object-fit: contain;
        border-radius: 6px;
        background: #fff;
    }

.mini-cart-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mini-cart-name {
    font-size: 14px;
    color: var(--neutral-900);
    font-weight: 500;
    line-height: 1.3;
    flex: 1;
    margin-right: 8px;
}

.mini-cart-price {
    font-size: 14px;
    color: var(--coral-600);
    font-weight: 600;
}

/* --- Scrollbar (WebKit browsers) --- */
.mini-cart-body::-webkit-scrollbar {
    width: 6px;
}

.mini-cart-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 3px;
}

.mini-cart-body::-webkit-scrollbar-track {
    background: transparent;
}

/* --- Footer with Total + Button --- */
.mini-cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding: 10px 14px;
    background: #fff9f8;
}
.mini-cart-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.mini-cart-label {
    color: var(--neutral-900);
    font-weight: 500;
}

.mini-cart-total {
    color: var(--coral-600);
    font-weight: 600;
}

.view-cart-btn {
    background: var(--coral-500);
    color: #fff;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s ease;
}


.mini-cart-dropdown {
    position: absolute;
    right: 1rem;
    top: calc(var(--header-height) + 2px);
    width: 320px;
    background: var(--brand-white);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    display: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    z-index: var(--z-dropdown);
}

    .mini-cart-dropdown.active {
        display: block;
        opacity: 1;
        transform: translateY(0);
    }

.mini-cart-loading {
    padding: 1rem;
    text-align: center;
    font-family: var(--font-body);
    color: var(--neutral-600);
}

/* ===========================================================
   RESPONSIVE
=========================================================== */
@media (max-width: 768px) {
    .desktop-search {
        display: none;
    }

    .mobile-header-search {
        display: block;
    }

    .header-container {
        padding: 0.5rem 0.75rem;
    }

    .header-icons {
        gap: 0.75rem;
    }

    .icon-link {
        width: 34px;
        height: 34px;
    }
}

/* ===========================================================
   AYURCALL — FOOTER (Unified Coral 2025 · Pure White)
   Optimized for accessibility, mobile, and brand coherence
=========================================================== */

.ayurcall-footer {
    background: var(--coral-600);
    color: var(--brand-white) !important;
    font-family: var(--font-body);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* ===============================
   MAIN SECTION
================================= */
.footer-main {
    padding: 2rem 0;
}

.footer-container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.75rem;
}

/* --- Brand Column --- */
.footer-brand .footer-logo {
    display: block;
    max-width: 150px;
    margin-bottom: 1rem;
}

.social-icons {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

    .social-icons a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: var(--brand-white);
        box-shadow: var(--shadow-xs);
        transition: transform var(--transition-fast), background var(--transition-fast);
    }

        .social-icons a:hover {
            background: var(--coral-500);
            transform: translateY(-2px);
        }

    .social-icons img {
        width: 18px;
        height: 18px;
        display: block;
    }

/* --- Column Titles --- */
.footer-col h4 {
    color: var(--brand-white);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* --- Links --- */
.footer-col ul {
    color: var(--brand-white);
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col li {
    margin-bottom: 0.4rem;
}

.footer a {
    color: var(--neutral-700);
    text-decoration: none;
    transition: color var(--transition-fast);
}

    .footer a:hover {
        color: var(--coral-500);
    }

/* --- Contact Column --- */
.footer-contact a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-contact img {
    width: 18px;
    height: 18px;
    display: inline-block;
}

/* ===============================
   BOTTOM DISCLAIMER
================================= */
.footer-bottom {
    background: var(--coral-600);
    padding: 1rem 0;
    text-align: center;
}

    .footer-bottom p {
        color: var(--brand-white);
        font-size: 0.85rem;
        line-height: 1.4;
        max-width: var(--content-max);
        margin: 0 auto;
        opacity: 0.95;
    }

/* ===============================
   RESPONSIVE TWEAKS
================================= */
@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand .footer-logo {
        margin: 0 auto 1rem;
    }

    .social-icons {
        justify-content: center;
    }

    .footer-col {
        margin-bottom: 1rem;
    }

    .footer-bottom p {
        padding: 0 1rem;
        font-size: 0.8rem;
    }
}

.icon-link,
.header-search-btn,
.back-btn,
button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
@media (min-width: 1400px) {
    .header-container,
    .footer-container {
        max-width: 1440px;
    }
}

/* ===========================================================
   AYURCALL — INSTANT SEARCH RESULTS
   Unified Coral 2025 · Pure White
=========================================================== */

.overlay-results {
    display: none;
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.5rem 0;
    background: var(--brand-white);
    border-top: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    animation: fadeIn 0.25s var(--transition-base);
}

/* Each result item */
.instant-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

    .instant-item:hover {
        background: var(--coral-light);
        transform: translateX(2px);
    }

/* Thumbnail */
.instant-thumb {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .instant-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* Info block */
.instant-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    color: var(--text-dark);
    font-family: var(--font-body);
}

.instant-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.instant-brand {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.instant-price {
    margin-top: 0.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--coral-600);
}

    .instant-price .mrp {
        font-weight: 400;
        font-size: 0.85rem;
        color: var(--text-muted);
        text-decoration: line-through;
        margin-left: 0.25rem;
    }

/* Scrollbar aesthetics */
.overlay-results::-webkit-scrollbar {
    width: 6px;
}

.overlay-results::-webkit-scrollbar-thumb {
    background: var(--neutral-300);
    border-radius: 3px;
}

    .overlay-results::-webkit-scrollbar-thumb:hover {
        background: var(--neutral-400);
    }

/* Fade animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive tweak for mobile overlay */
@media (max-width: 768px) {
    .overlay-results {
        max-height: calc(100vh - 160px);
        box-shadow: none;
        border-radius: 0;
        padding-bottom: 1rem;
    }

    .instant-item {
        padding: 0.75rem 1rem;
    }

    .instant-thumb {
        width: 54px;
        height: 54px;
    }
}

.instant-item,
a,
input[type="button"],
input[type="submit"] {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Prevent any card/slider from overlapping */
.banner-slider,
.product-carousel,
.cart-container {
    position: relative;
    z-index: 1;
}

/* --- Ensure overlay floats above everything, even sticky header --- */
.ayurcall-header,
.header-container {
    position: relative;
    z-index: var(--z-header);
}

#mobileSearchOverlay {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-overlay) + 100); /* override all */
}


/* iOS auto-zoom prevention */
@supports (-webkit-touch-callout:none) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Accessibility utility so label text never shows visually */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

#mobileSearchOverlay.active {
    outline: 4px solid teal !important;
}

/* ==============================================
   FIX — Force mobile overlay to top of all layers
============================================== */
#mobileSearchOverlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    display: none;
    background: rgba(255, 255, 255, 0.98);
}

    #mobileSearchOverlay.active {
        display: flex !important;
        flex-direction: column;
        animation: fadeIn 0.25s ease forwards;
        outline: 3px solid limegreen !important; /* temporary debug */
    }


        /* ==========================================================
   FIX — Ensure instant results show inside mobile overlay
========================================================== */
        #mobileSearchOverlay.active .overlay-results {
            display: block !important;
            opacity: 1;
            animation: fadeIn 0.25s ease forwards;
        }

            #mobileSearchOverlay.active .overlay-results:empty {
                display: none !important; /* hide if no results */
            }
