/* Modern Header Layout - Giftly Style */

/* Base Variables specific to header */
:root {
    --header-height-top: 70px;
    --header-height-nav: 45px;
    --header-border-color: #e0e0e0;
    --header-text-color: #333;
    --header-icon-color: #555;
    --header-primary-color: #C30101;
    --header-icon-size: 26px;
    /* Increased size */
    --header-icon-circle-size: 32px;
    /* Increased circle size */
    --accent-color: #e11d48;
}

/* Cart Count Badge */
.cart-count-badge {
    position: absolute;
    top: -5px;
    right: 5px;
    background: var(--accent-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 2px solid white;
}

.site-header {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    /* Not fixed for now, unless requested */
    z-index: 100;
}

/* TOP ROW */
.header-top {
    border-bottom: 1px solid var(--header-border-color);
    padding: 0.5rem 0;
}

.header-top .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 98%;
    padding: 12px 18px;
    /* Wider container for header elements */
}

.header-left-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Logo */
.header-logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-right: 1rem;
    border-right: 1px solid var(--header-border-color);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--header-primary-color);
    letter-spacing: -0.5px;
}

/* Location Selector */
.header-location {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 160px;
    cursor: pointer;
}

.loc-flag {
    width: 24px;
    height: 16px;
    background: linear-gradient(#FF9933 33%, #FFFFFF 33%, #FFFFFF 66%, #138808 66%);
    /* India Flag CSS */
    border: 1px solid #eee;
}

.loc-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.loc-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #111;
}

.loc-status {
    font-size: 0.75rem;
    color: #e11d48;
    /* Redish color for 'missing' */
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Search Bar */
.header-search {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 0 1rem;
    height: 44px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.search-wrapper:focus-within {
    background: #fff;
    border-color: var(--header-primary-color);
    box-shadow: 0 0 0 3px rgba(108, 140, 54, 0.1);
}

.search-wrapper input {
    border: none;
    background: transparent;
    flex: 1;
    height: 100%;
    font-size: 0.9rem;
    color: #333;
    outline: none;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #777;
    display: flex;
    align-items: center;
}

/* Right Icons */
.header-icons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-decoration: none;
    color: var(--header-text-color);
    font-size: 0.75rem;
    cursor: pointer;
    min-width: 40px;
}

.icon-link .icon {
    /* Base wrapper if needed, or target svg directly */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    color: var(--header-icon-color);
    /* Override main.css .icon styles that cause the 'block' issue */
    background: transparent !important;
    mask: none !important;
    -webkit-mask: none !important;
    width: auto;
    /* Let svg determine size via child classes */
    height: auto;
}

.icon-filled {
    width: var(--header-icon-size);
    height: var(--header-icon-size);
    fill: #444;
    /* Dark filled icons */
    transition: fill 0.2s;
}

.icon-line {
    width: var(--header-icon-size);
    height: var(--header-icon-size);
    stroke: #555;
    /* Use #555 to match other icons, previously #444 */
    fill: none;
    /* Crucial: prevent default black fill */
    transition: stroke 0.2s;
}

.icon-line * {
    fill: none;
    /* Ensure all child paths/rects have no fill */
    vector-effect: non-scaling-stroke;
    /* Optional: helps with scaling */
}

.icon-link:hover .icon-filled {
    fill: var(--header-primary-color);
}

.icon-link:hover .icon-line {
    stroke: var(--header-primary-color);
}

.icon-circled-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #999;
    /* Thin grey border */
    border-radius: 50%;
    width: var(--header-icon-circle-size);
    height: var(--header-icon-circle-size);
    margin-bottom: 2px;
    transition: all 0.2s;
}

.icon-link:hover .icon-circled-wrap {
    border-color: var(--header-primary-color);
    color: var(--header-primary-color);
}

.icon-circled-wrap svg {
    /* Icons inside circle */
    width: 16px;
    height: 16px;
    fill: #444;
    /* Fill inside the circle */
}

.icon-link:hover .icon-circled-wrap svg {
    fill: var(--header-primary-color);
}

.icon-link .label {
    white-space: nowrap;
    font-weight: 500;
}

/* NAVIGATION ROW */
.header-nav {
    border-bottom: 1px solid var(--header-border-color);
    background: #fff;
    height: var(--header-height-nav);
}

.header-nav .container {
    height: 100%;
    max-width: 98%;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-list::-webkit-scrollbar {
    display: none;
}

.nav-list li {
    height: 100%;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-list a {
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.nav-list a:hover {
    color: var(--header-primary-color);
}

.nav-arrow {
    font-size: 0.6rem;
    opacity: 0.6;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {

    .header-location,
    .header-icons .icon-link:nth-child(2),
    /* INR */
    .header-icons .icon-link:nth-child(3) {
        /* Corporate */
        display: none;
    }

    .header-top .container {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .header-logo-section {
        border-right: none;
        padding-right: 0;
    }

    .header-search {
        display: none;
        /* Often hidden or moved to a toggle on mobile */
    }

    .header-icons {
        gap: 1rem;
    }

    .header-nav {
        display: none;
        /* Needs a mobile menu implementation */
    }
}

/* Location Modal Styles */
.location-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
    /* JS toggles flex */
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(2px);
}

.location-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.location-modal {
    background: #fff;
    width: 100%;
    max-width: 480px;
    border-radius: 12px;
    padding: 24px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-header-content {
    margin-bottom: 24px;
}

.modal-icon-top {
    margin-bottom: 12px;
}

.modal-header-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 4px 0;
}

.modal-header-content p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.modal-body-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Country Preview Box */
.country-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.country-preview:hover {
    border-color: #bbb;
}

.country-flag-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.country-flag-wrap img {
    width: 24px;
    height: auto;
    border-radius: 2px;
}

.country-flag-wrap span {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

/* One Input Group */
.one-input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #333;
    outline: none;
    transition: all 0.2s;
}

.one-input-group input:focus {
    border-color: var(--header-primary-color);
    box-shadow: 0 0 0 3px rgba(108, 140, 54, 0.1);
}

.btn-location-continue {
    background: var(--header-primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.btn-location-continue:hover {
    background: #5a752d;
    /* Slightly darker shade */
}