/*
 * Header and Footer Styles
 * Custom styles for the new header, footer, and mobile menu
 */

/* ============================================
   HEADER STYLES
   ============================================ */

/* Top Bar */
.header-top-bar {
    background-color: var(--header-bg-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    font-size: 12px;
}

.header-top-bar .top-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.header-top-bar .top-links a {
    color: var(--header-text-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.header-top-bar .top-links a:hover {
    opacity: 0.7;
}

.header-top-bar .separator {
    color: var(--header-text-color);
    opacity: 0.5;
}

/* Header Main */
.header-main {
    background-color: var(--header-bg-color);
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Site Branding */
.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.custom-logo {
    max-height: 60px;
    width: auto;
}

.site-title-wrapper {
    display: flex;
    flex-direction: column;
}

.site-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.site-title a {
    color: var(--header-text-color);
    text-decoration: none;
}

.site-tagline {
    margin: 0;
    font-size: 12px;
    color: var(--header-text-color);
    opacity: 0.8;
}

/* Header Search */
.header-search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.header-search .search-form {
    position: relative;
    display: flex;
}

.header-search .search-field {
    width: 100%;
    padding: 10px 45px 10px 15px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 14px;
    color: var(--header-text-color);
    background-color: rgba(255, 255, 255, 0.9);
}

.header-search .search-field:focus {
    outline: none;
    border-color: var(--header-text-color);
}

.header-search .search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--header-text-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-search .search-submit:hover {
    opacity: 0.7;
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-results-dropdown.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 4px;
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.search-result-price {
    font-size: 13px;
    color: #666;
}

.search-no-results {
    padding: 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Header Icons */
.header-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icon {
    position: relative;
    color: var(--header-text-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.header-icon:hover {
    opacity: 0.7;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background-color: var(--header-text-color);
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Main Navigation */
.main-navigation {
    background-color: var(--header-bg-color);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.main-navigation .menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.main-navigation .menu-item {
    position: relative;
}

.main-navigation .menu-item a {
    display: block;
    padding: 15px 0;
    color: var(--header-text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    transition: opacity 0.3s ease;
}

.main-navigation .menu-item a:hover {
    opacity: 0.7;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85%;
    height: 100%;
    background-color: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-menu-title {
    font-weight: 700;
    font-size: 16px;
}

.mobile-menu-close {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #333;
}

.mobile-search {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-search .search-form {
    position: relative;
    display: flex;
}

.mobile-search .search-field {
    width: 100%;
    padding: 10px 45px 10px 15px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 14px;
}

.mobile-search .search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #333;
}

.mobile-menu-nav {
    padding: 10px 0;
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-menu-item a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.mobile-menu-item a:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* ============================================
   FOOTER STYLES
   ============================================ */

.site-footer {
    margin-top: 50px;
}

.footer-main {
    padding: 50px 0 30px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-company-name {
    font-size: 16px;
    margin-bottom: 10px;
}

.footer-email,
.footer-address,
.footer-hours {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 0;
}

.footer-email a {
    color: inherit;
    text-decoration: none;
}

.footer-email a:hover {
    text-decoration: underline;
}

.footer-map {
    margin-top: 15px;
}

.footer-map iframe {
    width: 100%;
    height: 200px;
    border: none;
    border-radius: 4px;
}

.footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-menu li {
    margin-bottom: 10px;
}

.footer-menu a {
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s ease;
}

.footer-menu a:hover {
    opacity: 0.7;
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
}

.footer-bottom-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-copyright p {
    margin: 0;
    font-size: 13px;
}

.footer-payment-icons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.footer-payment-icons img {
    height: 30px;
    width: auto;
}

.footer-credits {
    font-size: 12px;
    opacity: 0.8;
}

.footer-credits a {
    color: inherit;
    text-decoration: none;
}

.footer-credits a:hover {
    text-decoration: underline;
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media screen and (max-width: 992px) {
    .footer-columns {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-column:last-child {
        grid-column: 1 / -1;
    }
}

@media screen and (max-width: 768px) {

    /* Header */
    .header-top-bar {
        display: none;
    }

    .header-content {
        flex-wrap: wrap;
    }

    .site-branding {
        flex: 1;
    }

    .custom-logo {
        max-height: 40px;
    }

    .site-title {
        font-size: 16px;
    }

    .site-tagline {
        font-size: 11px;
    }

    .header-search {
        display: none;
    }

    .header-icons .user-icon {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .main-navigation {
        display: none;
    }

    /* Footer */
    .footer-columns {
        grid-template-columns: 1fr;
    }

    .footer-column:last-child {
        grid-column: auto;
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }

    /* Scroll to Top */
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media screen and (max-width: 480px) {
    .header-container {
        padding: 0 15px;
    }

    .footer-container {
        padding: 0 15px;
    }

    .footer-main {
        padding: 30px 0 20px;
    }
}