/* ========================================
   Header Styles
======================================== */

/* Header Main */
.site-header {
    background-color: var(--color-background);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-main {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.header-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}

/* Site Branding */
.site-branding {
    flex-shrink: 0;
    text-align: center;
}

.site-branding img {
    max-height: 60px;
    width: auto;
}

.site-title {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    margin-top: 5px;
}

/* Header Search */
.header-search {
    flex: 1;
    max-width: 500px;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--color-white);
    border: 2px solid var(--color-primary);
    border-radius: 4px;
    overflow: hidden;
}

.search-wrapper .search-icon {
    padding: 0 var(--spacing-sm);
    color: var(--color-primary);
    display: flex;
    align-items: center;
}

.search-wrapper .search-field {
    flex: 1;
    border: none;
    padding: 0.75rem 0;
    font-size: 0.95rem;
}

.search-wrapper .search-field:focus {
    outline: none;
}

.search-wrapper .search-submit {
    background-color: var(--color-primary);
    border: none;
    padding: 0.75rem 1rem;
    color: var(--color-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.search-wrapper .search-submit:hover {
    background-color: #5a2550;
}

/* Header Icons */
.header-icons {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Appointment Button */
.header-appointment-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: var(--color-secondary);
    color: var(--color-white);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.header-appointment-btn:hover {
    background-color: #a07a10;
    color: var(--color-white);
    transform: translateY(-1px);
}

.header-appointment-btn svg {
    flex-shrink: 0;
}

.header-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: relative;
    color: var(--color-text);
    text-decoration: none;
    transition: var(--transition);
}

.header-icon:hover {
    color: var(--color-primary);
}

.header-icon svg {
    width: 24px;
    height: 24px;
}

.icon-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--color-primary);
    color: var(--color-white);
    font-size: 0.7rem;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* ========================================
   Gold Rate Display
======================================== */
.gold-rate-display {
    position: relative;
    flex-shrink: 0;
}

.gold-rate-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background-color: transparent;
    border: 2px solid var(--color-secondary);
    border-radius: 4px;
    color: var(--color-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.gold-rate-toggle:hover {
    background-color: var(--color-secondary);
    color: white;
}

.gold-rate-toggle .gold-icon {
    display: flex;
    align-items: center;
}

.gold-rate-toggle .rate-text strong {
    color: inherit;
}

.gold-rate-toggle .dropdown-arrow {
    transition: transform 0.2s ease;
}

.gold-rate-display.active .gold-rate-toggle .dropdown-arrow {
    transform: rotate(180deg);
}

/* Gold Rate Dropdown */
.gold-rate-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 300px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
    z-index: 9999;
    overflow: hidden;
}

.gold-rate-display.active .gold-rate-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rate-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background-color: var(--color-primary);
    color: white;
}

.rate-dropdown-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.rate-dropdown-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.rate-dropdown-close:hover {
    opacity: 1;
}

/* Rate Table */
.rate-table {
    width: 100%;
    border-collapse: collapse;
}

.rate-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--color-border);
    background-color: #f9f9f9;
}

.rate-table td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-border);
}

.rate-table tbody tr:last-child td {
    border-bottom: none;
}

.rate-table tbody tr:hover {
    background-color: #faf9f7;
}

.metal-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #333;
}

.metal-name.gold::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #DAA520);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.metal-name.silver::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.metal-name.platinum::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E5E4E2, #B4B4B4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.rate-value {
    font-weight: 600;
    color: var(--color-primary);
    text-align: right;
}

.rate-updated {
    padding: 10px 20px;
    margin: 0;
    font-size: 0.8rem;
    color: #888;
    background-color: #f9f9f9;
    border-top: 1px solid var(--color-border);
}

.rate-shop-btn {
    display: block;
    padding: 12px 20px;
    text-align: center;
    background-color: var(--color-primary);
    color: white;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.rate-shop-btn:hover {
    background-color: #5a2550;
    color: white;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
}

.mobile-menu-toggle .hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    position: relative;
}

.mobile-menu-toggle .hamburger::before,
.mobile-menu-toggle .hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    left: 0;
}

.mobile-menu-toggle .hamburger::before {
    top: -7px;
}

.mobile-menu-toggle .hamburger::after {
    top: 7px;
}

/* ========================================
   Category Navigation Bar (Horizontal Menu)
======================================== */
.category-navigation {
    background-color: var(--color-primary);
    border-bottom: none;
    position: relative;
    z-index: 999;
}

.category-navigation .container {
    padding: 0;
    overflow: visible;
}

.category-menu {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.category-item {
    position: relative;
}

.category-item > a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    color: var(--color-white);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.category-item > a:hover,
.category-item:hover > a {
    background-color: rgba(255, 255, 255, 0.1);
}

.category-item > a svg {
    flex-shrink: 0;
}

.category-item > a .dropdown-arrow {
    transition: transform 0.2s ease;
}

.category-item:hover > a .dropdown-arrow {
    transform: rotate(180deg);
}

/* Mega Dropdown with Images */
.mega-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 600px;
    max-width: 900px;
    background-color: var(--color-white);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 8px 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 9999;
    padding: 24px;
}

.category-item:hover .mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Ensure dropdown doesn't go off-screen */
.category-item:first-child .mega-dropdown,
.category-item:nth-child(2) .mega-dropdown {
    left: 0;
    transform: translateY(10px);
}

.category-item:first-child:hover .mega-dropdown,
.category-item:nth-child(2):hover .mega-dropdown {
    transform: translateY(0);
}

.mega-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.mega-dropdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mega-dropdown-item:hover {
    background-color: var(--color-light-gray);
}

.mega-dropdown-item:hover .mega-dropdown-image img {
    transform: scale(1.05);
}

.mega-dropdown-image {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
}

.mega-dropdown-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.mega-dropdown-title {
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.mega-dropdown-item:hover .mega-dropdown-title {
    color: var(--color-primary);
}

/* View All Link */
.mega-dropdown-viewall {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mega-dropdown-viewall:hover {
    color: var(--color-secondary);
}

.mega-dropdown-viewall svg {
    transition: transform 0.2s ease;
}

.mega-dropdown-viewall:hover svg {
    transform: translateX(4px);
}

/* Home icon styling */
.category-item:first-child > a {
    padding: 14px 16px;
}

.category-item:first-child > a svg {
    width: 18px;
    height: 18px;
}

/* Active state for current category */
.category-item.current-cat > a,
.category-item.current-cat-parent > a {
    background-color: rgba(255, 255, 255, 0.15);
}

/* ========================================
   Mobile Navigation
======================================== */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-navigation {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100%;
    background-color: var(--color-white);
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1001;
    padding-top: 0;
}

.mobile-navigation.active {
    left: 0;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background-color: var(--color-primary);
    color: var(--color-white);
}

.mobile-nav-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-menu {
    padding-top: var(--spacing-md);
}

.mobile-menu li a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}

.mobile-menu li a:hover {
    background-color: var(--color-light-gray);
    color: var(--color-primary);
}

/* ========================================
   Footer
======================================== */
.site-footer {
    background-color: #FAF6F1;
}

/* Footer Main */
.footer-main {
    padding: 50px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr;
    gap: 40px;
}

.footer-col {
    min-width: 0;
}

/* Footer About Column */
.footer-about .custom-logo-link img {
    max-height: 60px;
    width: auto;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.footer-tagline {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 12px;
    font-style: italic;
}

.footer-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Footer Advantages */
.footer-advantages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.advantage-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #555;
}

.advantage-item svg {
    color: var(--color-primary);
    flex-shrink: 0;
}

/* Footer Titles */
.footer-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--color-primary);
    margin-bottom: 20px;
    font-weight: 600;
}

/* Footer Links */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links li a {
    color: #555;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-links li a:hover {
    color: var(--color-primary);
    padding-left: 5px;
}

/* Contact Info */
.contact-info {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #555;
}

.contact-info li svg {
    color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

/* Footer Newsletter */
.footer-newsletter {
    margin-top: 10px;
}

.footer-newsletter h5 {
    font-size: 0.95rem;
    color: var(--color-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

.footer-newsletter .newsletter-form {
    display: flex;
    gap: 0;
}

.footer-newsletter .newsletter-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
    min-width: 0;
}

.footer-newsletter .newsletter-form input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.footer-newsletter .newsletter-form button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
}

.footer-newsletter .newsletter-form button:hover {
    background-color: #5a2550;
}

/* Footer Middle - Social & Payment */
.footer-middle {
    background-color: #F0EBE5;
    padding: 20px 0;
    border-top: 1px solid #E5DED6;
}

.footer-middle-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

/* Social Links */
.footer-social {
    display: flex;
    align-items: center;
    gap: 15px;
}

.social-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
}

.social-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--color-primary);
    color: white;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

.social-icons a svg {
    width: 18px;
    height: 18px;
}

/* Payment Methods */
.footer-payments {
    display: flex;
    align-items: center;
    gap: 15px;
}

.payment-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
}

.payment-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-icons img {
    height: 28px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.payment-icons img:hover {
    opacity: 1;
}

/* Footer Bottom */
.footer-bottom {
    background-color: var(--color-primary);
    padding: 15px 0;
}

.footer-bottom .container {
    text-align: center;
}

.copyright {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--color-secondary);
    transform: translateY(-3px);
}

/* ========================================
   Responsive Header
======================================== */
@media (max-width: 991px) {
    .header-search {
        max-width: 350px;
    }

    .icon-label {
        display: none;
    }

    /* Gold rate tablet adjustments */
    .gold-rate-toggle {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .gold-rate-toggle .gold-icon {
        display: none;
    }

    /* Category navigation adjustments for tablet */
    .category-item > a {
        padding: 12px 14px;
        font-size: 0.85rem;
    }

    .category-item:first-child > a {
        padding: 12px 12px;
    }

    /* Mega dropdown adjustments for tablet */
    .mega-dropdown {
        min-width: 500px;
        max-width: 700px;
        padding: 20px;
    }

    .mega-dropdown-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }

    .mega-dropdown-image {
        width: 80px;
        height: 80px;
    }

    .mega-dropdown-title {
        font-size: 0.8rem;
    }

    /* Footer tablet adjustments */
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }

    .footer-about {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 20px 30px;
        align-items: start;
    }

    .footer-about .custom-logo-link,
    .footer-about .footer-logo {
        grid-row: 1 / 3;
    }

    .footer-advantages {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px 30px;
    }

    .footer-middle-content {
        justify-content: center;
        gap: 30px;
    }
}

@media (max-width: 767px) {
    .header-main .container {
        flex-wrap: wrap;
    }

    .header-search {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: var(--spacing-sm);
    }

    .header-icons {
        gap: var(--spacing-sm);
    }

    /* Appointment button mobile - icon only */
    .header-appointment-btn {
        padding: 6px 10px;
    }

    .header-appointment-btn span {
        display: none;
    }

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

    .main-navigation {
        display: none;
    }

    /* Hide category navigation on mobile - use mobile menu instead */
    .category-navigation {
        display: none;
    }

    /* Gold rate mobile - hide full display, show compact version */
    .gold-rate-display {
        order: 2;
    }

    .gold-rate-toggle {
        padding: 5px 8px;
        font-size: 0.75rem;
        border-width: 1px;
    }

    .gold-rate-toggle .rate-text {
        display: none;
    }

    .gold-rate-toggle .gold-icon {
        display: flex;
    }

    .gold-rate-toggle .dropdown-arrow {
        display: none;
    }

    .gold-rate-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        min-width: auto;
        border-radius: 16px 16px 0 0;
        max-height: 80vh;
        overflow-y: auto;
    }

    /* Mobile footer */
    .footer-main {
        padding: 40px 0 30px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px 20px;
        text-align: left;
    }

    .footer-about {
        grid-column: 1 / -1;
        text-align: center;
    }

    .footer-advantages {
        justify-content: center;
    }

    .footer-contact {
        grid-column: 1 / -1;
    }

    .contact-info li {
        justify-content: flex-start;
    }

    .footer-newsletter .newsletter-form {
        max-width: 300px;
    }

    .footer-middle-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-social,
    .footer-payments {
        flex-direction: column;
        gap: 10px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-links li a:hover {
        padding-left: 0;
    }

    .contact-info li {
        justify-content: center;
    }

    .footer-newsletter .newsletter-form {
        max-width: 100%;
    }
}
