/* Layout Styles */
header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo img {
    height: 32px;
    width: auto;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.nav-buttons {
    display: flex;
    gap: var(--spacing-md);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.orders-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.orders-link:hover {
    color: var(--primary);
}

.mobile-only {
    display: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link svg {
    flex-shrink: 0;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
}

.user-profile:hover {
    border-color: var(--primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.user-email {
    font-size: 0.7rem;
    color: var(--text-light);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    z-index: 1000;
    overflow: hidden;
}

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

.profile-dropdown a {
    display: block;
    padding: 0.65rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: background var(--transition-fast);
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.profile-dropdown a:last-child {
    color: var(--danger);
    border-bottom: none;
}

.profile-dropdown a:hover {
    background: var(--bg);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    align-items: center;
}

.search-form {
    flex: 1;
    min-width: 100%;
}

.category-chips {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.chip {
    padding: 0.4rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: all var(--transition-fast);
    display: inline-block;
}

.chip:hover {
    border-color: var(--primary);
    background: rgba(37,99,235,0.05);
}

.chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.search-box {
    flex: 1;
    min-width: 280px;
}

.search-box input {
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: all var(--transition-base);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    text-decoration: none;
    color: var(--text);
    display: inline-block;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xl);
}

.orders-section {
    display: none;
}

.orders-section.active {
    display: block;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Responsive */
@media (max-width: 768px) {
    .logo-text {
        font-size: 1rem;
    }
    
    .logo img {
        height: 28px;
    }
    
    .orders-link {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
    
    .user-profile {
        padding: 0.5rem;
        min-width: auto;
    }
    
    .user-info {
        display: none;
    }
    
    .profile-dropdown {
        right: 0;
        min-width: 150px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .search-box {
        min-width: 100%;
    }
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

/* Profile Card */
.profile-card, .settings-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 600px;
}

.profile-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

.profile-sidebar {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 80px;
}

.profile-main {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.profile-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.profile-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1.5rem;
}

.profile-section h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 968px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
    
    .profile-sidebar {
        position: static;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2rem;
    margin: 0 auto 2rem;
}

.profile-info-section .form-group {
    margin-bottom: 1.5rem;
}

.settings-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1.5rem;
}

/* Profile Image Section */
.profile-image-section {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-avatar-large {
    position: relative;
    overflow: hidden;
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-base);
    border: none;
}

.btn-secondary:hover {
    background: var(--text);
    transform: translateY(-1px);
}
