/* Layout Components */

/* Header */
.main-header {
    background-color: var(--amazon-blue-dark);
    color: white;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 0 var(--space-4);
    height: 60px;
    width: 100%;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.hamburger-menu {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
    margin: 0;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }
}

.logo a {
    color: white;
    font-size: 1.4rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo {
    display: flex;
    align-items: center;
}

.search-bar {
    flex: 1;
    display: flex;
    max-width: 800px;
}

.search-bar input {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    border: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.search-bar button {
    background-color: var(--amazon-yellow);
    border: none;
    padding: 0 var(--space-4);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer;
}

.nav-links {
    display: flex;
    gap: var(--space-6);
}

.nav-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
}

.nav-item .line-1 {
    font-size: var(--fs-xs);
    color: #ccc;
}

.nav-item .line-2 {
    font-size: var(--fs-sm);
    font-weight: 700;
}

.nav-item.cart {
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
}

.cart-count {
    color: var(--amazon-orange);
    font-weight: 800;
}

.location-bar {
    background-color: #37475a;
    color: white;
    padding: var(--space-2) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-xs);
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

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

.header-bottom {
    background-color: var(--amazon-blue-light);
    padding: var(--space-2) var(--space-4);
    display: flex;
    gap: var(--space-4);
    font-size: var(--fs-sm);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

.header-bottom::-webkit-scrollbar {
    display: none;
}

.header-bottom a {
    color: white;
    text-decoration: none;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
        height: auto;
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
        justify-content: space-between;
        width: 100%;
        box-sizing: border-box;
    }
    
    .header-left {
        gap: 0.5rem;
        flex: 1;
        min-width: 0;
    }

    .logo a {
        font-size: 1.1rem;
    }
    
    .nav-links {
        display: flex;
        gap: 0.6rem;
        margin-left: auto;
        align-items: center;
        flex-shrink: 0;
    }
    
    .search-bar {
        order: 3;
        flex: none;
        width: 100%;
        max-width: 100%;
        margin: 0.25rem 0;
        box-sizing: border-box;
    }

    .search-bar input {
        font-size: 0.9rem;
    }
    
    .nav-item .line-1 {
        display: block;
        font-size: 0.6rem;
        margin-bottom: -2px;
    }

    .nav-item .line-2 {
        font-size: 0.75rem;
    }
    
    .nav-item.mobile-hide {
        display: none !important;
    }
    
    .nav-item.cart {
        gap: 0.2rem;
    }
    
    .nav-item.cart .line-2 {
        display: none;
    }

    .location-bar {
        padding: 6px 12px;
        font-size: 0.72rem;
        width: 100%;
        box-sizing: border-box;
    }

    .header-bottom {
        padding: 6px 12px;
        gap: 0.75rem;
        font-size: 0.78rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Footer mobile */
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        padding: var(--space-8) 12px;
        gap: var(--space-4);
    }
}

/* Footer */
.main-footer {
    background-color: var(--amazon-blue-light);
    color: white;
    margin-top: var(--space-12);
}

.back-to-top {
    background-color: #37475a;
    text-align: center;
    padding: var(--space-4);
    cursor: pointer;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-8);
    padding: var(--space-12) var(--space-4);
    max-width: 1000px;
    margin: 0 auto;
}

.footer-section h3 {
    color: white;
    margin-bottom: var(--space-4);
    font-size: var(--fs-lg);
}

.footer-section ul li {
    margin-bottom: var(--space-2);
}

.footer-section ul li a {
    color: #DDD;
    font-size: var(--fs-sm);
}

.footer-bottom {
    border-top: 1px solid #3a4553;
    padding: var(--space-8) 0;
    text-align: center;
}

/* Utils */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .mobile-hide {
        display: none !important;
    }
}

/* Account Pages Responsive */
.account-layout {
    display: flex;
    gap: var(--space-8);
    padding: 2rem 0;
}

.account-sidebar {
    width: 260px;
    flex-shrink: 0;
}

.account-content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {
    .account-layout {
        flex-direction: column;
        padding: 1rem 0;
        gap: var(--space-4);
    }
    
    .account-sidebar {
        width: 100%;
    }
    
    .account-sidebar h3 {
        display: none; /* Hide 'My Account' title on mobile */
    }
    
    .account-sidebar ul {
        flex-direction: row !important;
        overflow-x: auto;
        padding-bottom: 5px;
        scrollbar-width: none;
    }
    
    .account-sidebar ul::-webkit-scrollbar {
        display: none;
    }
    
    .account-sidebar ul li {
        flex-shrink: 0;
    }
    
    .account-sidebar ul li a {
        padding: 8px 12px !important;
        border: 1px solid #DDD;
        background: #FFF !important;
        font-size: 0.85rem;
    }
    
    .account-content h1 {
        font-size: 1.25rem !important;
        margin-bottom: 1rem !important;
    }
    
    input[style*="max-width: 400px"] {
        max-width: 100% !important;
    }
}
