:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --light-gray: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ===== Generic Page Header (Cart, Checkout, Profile, etc.) ===== */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 2.5rem; color: var(--dark); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 1rem; }
.page-header h1 i { color: var(--primary); }
.page-header p { color: var(--gray); font-size: 1.1rem; }

/* ===== Header ===== */
.home-header {
    position: fixed; top: 0; left: 0; right: 0; height: 70px;
    background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(20px);
    box-shadow: var(--shadow); z-index: 1000; border-bottom: 1px solid var(--light-gray);
}
.header-container {
    max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; height: 100%;
    display: flex; align-items: center; justify-content: space-between;
}
.home-logo {
    display: flex; align-items: center; gap: 0.75rem; font-size: 1.4rem; font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-decoration: none;
}
.home-nav { display: flex; gap: 0.5rem; }
.home-nav a {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem;
    color: var(--dark); text-decoration: none; font-weight: 600; border-radius: var(--radius-xs);
    transition: all 0.3s; font-size: 0.95rem;
}
.home-nav a:hover, .home-nav a.active { background: var(--light); color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 0.75rem; }

.auth-btn {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white;
    text-decoration: none; border-radius: 50px; font-weight: 600; font-size: 0.9rem;
    transition: all 0.3s; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4); }

.cart-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; background: var(--light); border-radius: 50%;
    color: var(--dark); text-decoration: none; transition: all 0.3s; position: relative;
}
.cart-icon-btn:hover { background: var(--primary); color: white; }
.cart-badge {
    position: absolute; top: -5px; right: -5px; background: var(--danger); color: white;
    font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.4rem; border-radius: 10px;
    min-width: 18px; text-align: center;
}

.user-dropdown-wrapper { position: relative; }
.user-profile-btn {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 1rem 0.4rem 0.4rem;
    background: var(--light); border: 2px solid var(--light-gray); border-radius: 50px;
    cursor: pointer; transition: all 0.3s; font-weight: 600;
}
.user-profile-btn:hover { background: white; border-color: var(--primary); box-shadow: var(--shadow); }
.user-avatar {
    width: 38px; height: 38px; background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.user-avatar.large { width: 48px; height: 48px; font-size: 1.2rem; }
.user-name-text { color: var(--dark); font-size: 0.9rem; }
.user-profile-btn i.fa-chevron-down { color: var(--gray); font-size: 0.8rem; transition: transform 0.3s; }
.user-profile-btn:hover i.fa-chevron-down { transform: rotate(180deg); }

.user-dropdown-menu {
    position: absolute; top: calc(100% + 10px); right: 0; background: white;
    border-radius: var(--radius-sm); box-shadow: var(--shadow-xl); min-width: 260px;
    opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.3s;
    z-index: 1001; border: 1px solid var(--light-gray); overflow: hidden;
}
.user-dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-user-info {
    display: flex; align-items: center; gap: 1rem; padding: 1.25rem;
    background: var(--light); border-bottom: 1px solid var(--light-gray);
}
.dropdown-user-info h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.dropdown-user-info p { font-size: 0.8rem; color: var(--gray); }
.user-dropdown-menu a {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1.25rem;
    color: var(--dark); text-decoration: none; transition: all 0.3s; font-weight: 500; font-size: 0.95rem;
}
.user-dropdown-menu a:hover { background: var(--light); color: var(--primary); }
.user-dropdown-menu a i { width: 20px; color: var(--gray); }
.user-dropdown-menu a:hover i { color: var(--primary); }
.dropdown-divider { height: 1px; background: var(--light-gray); margin: 0.5rem 0; }
.logout-link { color: var(--danger) !important; }
.logout-link:hover { background: #fef2f2 !important; color: var(--danger) !important; }
.logout-link i { color: var(--danger) !important; }

.mobile-toggle-btn {
    display: none; background: var(--light); border: none; width: 42px; height: 42px;
    border-radius: 50%; cursor: pointer; font-size: 1.2rem; color: var(--dark); transition: all 0.3s;
}
.mobile-toggle-btn:hover { background: var(--primary); color: white; }

/* ===== Mobile Menu ===== */
.mobile-menu {
    position: fixed; top: 0; right: -100%; width: 320px; max-width: 85%; height: 100vh;
    background: white; box-shadow: -5px 0 30px rgba(0,0,0,0.2); z-index: 10000;
    transition: right 0.3s ease; overflow-y: auto;
}
.mobile-menu.open { right: 0; }
.mobile-menu-header {
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--light-gray);
    display: flex; justify-content: space-between; align-items: center; background: var(--light);
}
.mobile-menu-header h3 { font-size: 1.2rem; color: var(--dark); }
.close-mobile-menu {
    background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--gray);
    width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.close-mobile-menu:hover { background: var(--light-gray); color: var(--dark); }
.mobile-menu-content { padding: 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.mobile-menu-content a {
    display: flex; align-items: center; gap: 1rem; padding: 1rem; color: var(--dark);
    text-decoration: none; font-weight: 600; border-radius: var(--radius-xs); transition: all 0.3s;
}
.mobile-menu-content a:hover, .mobile-menu-content a.active { background: var(--light); color: var(--primary); }
.mobile-user-section { margin-top: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--light-gray); }
.mobile-user-card {
    display: flex; align-items: center; gap: 1rem; padding: 1rem;
    background: var(--light); border-radius: var(--radius-sm); margin-bottom: 0.75rem;
}
.mobile-user-details h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.mobile-user-details p { font-size: 0.8rem; color: var(--gray); }
.mobile-logout { color: var(--danger) !important; margin-top: 0.5rem; }
.mobile-logout:hover { background: #fef2f2 !important; }
.mobile-auth-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    color: white !important; justify-content: center; margin-top: 0.5rem;
}
.mobile-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5);
    z-index: 9999; opacity: 0; visibility: hidden; transition: all 0.3s;
}
.mobile-overlay.active { opacity: 1; visibility: visible; }

/* ===== Footer ===== */
.home-footer { background: var(--dark); color: white; padding: 4rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-col h3 {
    font-size: 1.4rem; margin-bottom: 1rem; background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: flex; align-items: center; gap: 0.5rem;
}
.footer-col h3 i { -webkit-text-fill-color: var(--primary); }
.footer-col h4 { margin-bottom: 1rem; font-size: 1.1rem; }
.footer-col p { color: #94a3b8; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
.footer-col a { color: #94a3b8; text-decoration: none; display: block; margin-bottom: 0.75rem; transition: color 0.3s; font-size: 0.95rem; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { text-align: center; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1); color: #94a3b8; }

/* ===== Toast Notification ===== */
.toast {
    position: fixed; top: 90px; right: 20px; background: var(--success); color: white;
    padding: 1rem 1.5rem; border-radius: var(--radius-xs); box-shadow: var(--shadow-lg);
    z-index: 10000; display: flex; align-items: center; gap: 0.75rem;
    transform: translateX(400px); transition: transform 0.3s ease;
}
.toast.show { transform: translateX(0); }
.toast.error { background: var(--danger); }

/* ===== Global Responsive ===== */
@media (max-width: 768px) {
    .home-nav { display: none; }
    .mobile-toggle-btn { display: flex; align-items: center; justify-content: center; }
    .user-name-text { display: none; }
    .user-profile-btn { padding: 0.4rem; }
    .auth-btn span { display: none; }
    .auth-btn { padding: 0.6rem; width: 42px; height: 42px; justify-content: center; }
    .page-header h1 { font-size: 1.75rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 480px) {
    .header-container { padding: 0 1rem; }
    .home-logo { font-size: 1.2rem; }
}