/* ========================================
   Birman Vet Header Styles
   Brand Colors: Red #de2829 | Black #1a1a1a | Gray #666666
   ======================================== */

:root {
    --brand-green: #de2829;
    --brand-green-dark: #b91c1c;
    --brand-green-light: #ef4444;
    --brand-red: #de2829;
    --brand-red-dark: #b91c1c;
    --brand-gray: #666666;
    --header-bg: #f5f5f5;
    --header-border: #e0e0e0;
}

/* Global overflow fix */
html {
    overflow-x: hidden;
}

/* ========================================
   Top Bar
   ======================================== */
.top-bar {
    background: var(--brand-green);
    padding: 6px 0;
    font-size: 12px;
    color: #fff;
    overflow: hidden;
}

.top-bar a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.top-bar a:hover {
    opacity: 0.8;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
}

.top-bar-info {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
    overflow: hidden;
    flex: 1;
}

.top-bar-info span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-bar-info i {
    margin-inline-start: 6px;
    font-size: 11px;
}

.top-bar-links {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

.top-bar-links a {
    font-size: 13px;
}

/* ========================================
   Main Header - Light Gray Background
   ======================================== */
header {
    background: #f5f5f5 !important;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 1050;
    width: 100%;
}

header .container {
    max-width: 100%;
}

header .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    max-width: 100%;
    gap: 10px;
}

/* ========================================
   Logo Only - No Text
   ======================================== */
header .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

header .logo:hover {
    transform: scale(1.02);
}

header .logo img {
    height: 44px;
    max-height: 44px;
    width: auto;
    transition: all 0.3s ease;
}

header .logo:hover img {
    filter: drop-shadow(0 2px 8px rgba(222, 40, 41, 0.3));
}

/* ========================================
   Navigation
   ======================================== */
header nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px;
}

header nav .nav-link {
    color: var(--brand-gray);
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
    min-width: 0;
}

header nav .nav-link:hover {
    color: var(--brand-green);
    background: rgba(222, 40, 41, 0.08);
}

header nav .nav-link.active {
    color: #fff;
    background: var(--brand-green);
}

/* ========================================
   Search Bar
   ======================================== */
.header-search {
    flex: 1;
    max-width: 400px;
    min-width: 0;
    margin-inline: 10px;
}

.header-search .search-box {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--header-border);
    background: #fff;
}

.header-search input {
    flex: 1;
    border: none;
    padding: 10px 14px;
    font-size: 13px;
    background: transparent;
    color: #333;
}

.header-search input:focus {
    outline: none;
}

.header-search input::placeholder {
    color: #999;
}

.header-search button {
    background: var(--brand-green);
    border: none;
    padding: 0 16px;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
    transition: background 0.3s ease;
}

.header-search button:hover {
    background: var(--brand-green-dark);
}

/* ========================================
   Header Icons
   ======================================== */
.header-icons-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    margin-inline-end: 0;
}

.header-icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--brand-gray);
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.header-icon-link:hover {
    background: rgba(222, 40, 41, 0.08);
    color: var(--brand-green);
}

.header-icon-link i {
    font-size: 18px;
    margin-bottom: 2px;
}

.header-icon-link .icon-label {
    font-size: 10px;
    font-weight: 500;
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -2px;
    inset-inline-start: 4px;
    background: var(--brand-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   User Dropdown
   ======================================== */
.user-dropdown .dropdown-toggle {
    background: transparent;
    border: none;
    color: var(--brand-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.user-dropdown .dropdown-toggle:hover {
    background: rgba(222, 40, 41, 0.08);
    color: var(--brand-green);
}

.user-dropdown .dropdown-toggle::after {
    display: none;
}

.user-dropdown .dropdown-toggle i {
    font-size: 18px;
    margin-bottom: 2px;
}

.user-dropdown .dropdown-toggle .icon-label {
    font-size: 10px;
    font-weight: 500;
}

.user-dropdown .dropdown-menu {
    min-width: 180px;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.12);
    border: 1px solid #eee;
    padding: 8px;
    margin-top: 5px;
    z-index: 1060;
}

.user-dropdown .dropdown-item {
    padding: 10px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--brand-gray);
    transition: all 0.3s ease;
}

.user-dropdown .dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 13px;
}

.user-dropdown .dropdown-item:hover {
    background: rgba(222, 40, 41, 0.08);
    color: var(--brand-green);
}

.user-dropdown .dropdown-item.text-danger:hover {
    background: rgba(222, 40, 41, 0.08);
    color: var(--brand-red) !important;
}

.user-dropdown .dropdown-divider {
    margin: 6px 0;
    border-color: #eee;
}

/* ========================================
   Language Switcher
   ======================================== */
.lang-switcher-dropdown .btn-link {
    color: var(--brand-gray);
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.lang-switcher-dropdown .btn-link:hover {
    background: rgba(222, 40, 41, 0.08);
    color: var(--brand-green);
}

.lang-switcher-dropdown .btn-link i {
    font-size: 12px;
}

.lang-switcher-dropdown .dropdown-menu {
    min-width: 100px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
    border: 1px solid #eee;
    padding: 6px;
    z-index: 1060;
}

.lang-switcher-dropdown .dropdown-item {
    padding: 8px 12px;
    border-radius: 5px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--brand-gray);
    transition: all 0.3s ease;
}

.lang-switcher-dropdown .dropdown-item:hover,
.lang-switcher-dropdown .dropdown-item.active {
    background: var(--brand-green);
    color: #fff;
}

/* ========================================
   Mobile Menu Button
   ======================================== */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--brand-gray);
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: rgba(222, 40, 41, 0.08);
    color: var(--brand-green);
}

/* ========================================
   Mobile Navigation
   ======================================== */
.mobile-nav-collapse {
    background: #f5f5f5;
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.mobile-nav-collapse .mobile-search {
    margin-bottom: 12px;
}

.mobile-nav-collapse .mobile-search input {
    background: #f5f5f5;
    border: 1px solid var(--header-border);
    color: #333;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
}

.mobile-nav-collapse .mobile-search input::placeholder {
    color: #999;
}

.mobile-nav-collapse nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--brand-gray);
    text-decoration: none;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    transition: all 0.3s ease;
}

.mobile-nav-collapse nav a:hover,
.mobile-nav-collapse nav a.fw-bold {
    color: var(--brand-green);
}

.mobile-nav-collapse nav a i {
    width: 20px;
    font-size: 14px;
    color: var(--brand-green);
}

/* ========================================
   Responsive Styles
   ======================================== */
@media (max-width: 1200px) {
    .header-search {
        max-width: 280px;
    }
}

@media (max-width: 991px) {
    .header-search {
        display: none;
    }

    header nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 768px) {
    .top-bar-links {
        display: none;
    }

    .top-bar-info {
        gap: 12px;
    }

    .top-bar-info span {
        font-size: 11px;
    }

    header .logo img {
        height: 40px;
    }

    .header-icon-link .icon-label {
        display: none;
    }

    .header-icon-link {
        padding: 8px;
    }

    .header-icon-link i {
        font-size: 18px;
    }

    .user-dropdown .dropdown-toggle .icon-label {
        display: none;
    }
    
    /* Mobile bottom nav spacing */
    body {
        padding-bottom: 70px;
    }
    
    .whatsapp-float {
        bottom: 90px !important;
        right: 15px !important;
        width: 50px !important;
        height: 50px !important;
        font-size: 24px !important;
    }
    
    .newsletter-section {
        padding: 25px 15px !important;
        margin-bottom: 30px !important;
    }
    
    .newsletter-section h3 {
        font-size: 18px !important;
    }
    
    .newsletter-form {
        flex-direction: column !important;
    }
    
    .newsletter-form input,
    .newsletter-form button {
        width: 100% !important;
    }
    
    /* Footer mobile fix */
    footer .footer-content {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
    }
    
    footer {
        padding: 30px 0 20px !important;
    }
    
    footer .container {
        padding: 0 15px !important;
    }
}

@media (max-width: 480px) {
    header .header-content {
        padding: 6px 0;
    }

    .header-icons-nav {
        gap: 2px;
    }

    header .logo img {
        height: 35px;
    }
}

/* ========================================
   Mobile Bottom Navigation Bar (App-Style)
   ======================================== */
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 65px;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        z-index: 9998;
        align-items: center;
        justify-content: space-around;
        padding: 0 5px;
        box-shadow: 0 -2px 15px rgba(0,0,0,0.08);
        safe-area-inset-bottom: env(safe-area-inset-bottom);
    }
    
    .mobile-bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #666;
        font-size: 10px;
        padding: 6px 2px;
        border-radius: 8px;
        transition: all 0.2s ease;
        flex: 1;
        max-width: 80px;
        position: relative;
    }
    
    .mobile-bottom-nav a i {
        font-size: 20px;
        margin-bottom: 3px;
        transition: all 0.2s ease;
    }
    
    .mobile-bottom-nav a span {
        font-weight: 500;
        font-family: 'Tajawal', sans-serif;
        line-height: 1.2;
    }
    
    .mobile-bottom-nav a.active,
    .mobile-bottom-nav a:hover {
        color: #de2829;
    }
    
    .mobile-bottom-nav a.active i {
        transform: scale(1.15);
    }
    
    /* Cart badge on bottom nav */
    .mobile-bottom-nav .cart-badge-mobile {
        position: absolute;
        top: 2px;
        inset-inline-end: 50%;
        transform: translateX(calc(50% + 10px));
        background: #de2829;
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        min-width: 16px;
        height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    }
    
    /* iOS safe area */
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .mobile-bottom-nav {
            height: calc(65px + env(safe-area-inset-bottom));
            padding-bottom: env(safe-area-inset-bottom);
        }
        
        body {
            padding-bottom: calc(70px + env(safe-area-inset-bottom));
        }
    }
}
