@import url('https://fonts.googleapis.com/css2?family=Saira:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #7C3AED;
    --primary-dark: #6D28D9;
    --primary-light: #A78BFA;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --bg-white: #FFFFFF;
    --bg-light: #F9FAFB;
    --bg-gray: #F3F4F6;
    --border: #E5E7EB;
    --shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.1), 0 2px 4px -1px rgba(124, 58, 237, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(124, 58, 237, 0.15), 0 8px 10px -6px rgba(124, 58, 237, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Saira', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header & Navigation --- */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-link:hover { color: var(--primary); }

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.4rem;
    transition: transform 0.2s;
}
.cart-icon:hover { transform: scale(1.1); }

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
}

/* --- Layout & Containers --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    flex: 1;
    width: 100%;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    text-align: center;
}

.section-subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 3rem;
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 1.5rem;
    text-align: center;
}

.hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; }
.hero p { font-size: 1.125rem; opacity: 0.9; max-width: 600px; margin: 0 auto; }

/* --- Products Grid --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.product-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-gray);
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; }
.product-description { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; flex: 1; }
.product-price { font-size: 1.35rem; font-weight: 800; color: var(--primary); margin-bottom: 1rem; }
.product-price.contact { color: var(--text-muted); font-size: 1rem; font-weight: 600; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Saira', sans-serif;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    width: 100%;
    gap: 0.5rem;
}

.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { background: var(--text-muted); cursor: not-allowed; transform: none; }

.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--error); }
.btn-danger:hover { background: #DC2626; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; width: auto; }

/* --- Loaders --- */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.page-loader .spinner {
    width: 50px; height: 50px;
    border: 5px solid var(--bg-gray);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* --- Cart & Checkout --- */
.cart-container, .checkout-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1;
    width: 100%;
}

.cart-item {
    display: flex;
    gap: 1.5rem;
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    align-items: center;
}

.cart-item-image {
    width: 80px; height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-info { flex: 1; }
.cart-item-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.25rem; }
.cart-item-price { color: var(--primary); font-weight: 800; font-size: 1.1rem; }
.cart-item-remove {
    color: var(--error); background: none; border: none;
    cursor: pointer; font-size: 0.85rem; font-weight: 600;
    padding: 0.5rem;
}

.cart-summary {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-top: 2rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

/* Checkout Layout */
.checkout-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    align-items: start;
}

.order-summary {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-main); font-size: 0.9rem; }
.form-input {
    width: 100%; padding: 0.75rem 1rem;
    border: 2px solid var(--border); border-radius: 8px;
    font-size: 1rem; font-family: 'Saira', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}
.form-input:read-only {
    background: var(--bg-gray);
    cursor: not-allowed;
}

/* --- Auth & Success Pages --- */
.auth-container, .success-container {
    max-width: 450px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.success-icon {
    width: 80px; height: 80px;
    background: #D1FAE5; color: var(--success);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }

.empty-state {
    text-align: center; padding: 4rem 2rem; color: var(--text-muted);
}
.empty-state-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.3; }

/* --- Monthly Fee Section --- */
.monthly-section {
    background: linear-gradient(135deg, #F3F0FF 0%, #E9D5FF 100%);
    border: 2px solid var(--primary-light);
    border-radius: 16px;
    padding: 3rem 2rem;
    margin-top: 4rem;
    text-align: center;
}
.monthly-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    margin: 2rem auto 0;
    box-shadow: var(--shadow-lg);
}

/* --- Profile Page Styles --- */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    margin-right: 1rem;
}

.profile-header-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.profile-details-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.profile-field {
    margin-bottom: 1.5rem;
}

.profile-field-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.profile-field-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    padding: 0.5rem 0;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.profile-note {
    background: #FEF3C7;
    border-left: 4px solid var(--warning);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #92400E;
    margin-top: 1rem;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid var(--success); }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid var(--error); }

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 1.5rem;
        box-shadow: var(--shadow-lg);
        gap: 1rem;
        border-top: 1px solid var(--border);
    }
    
    .nav-links.active { display: flex; }
    .nav-links .btn { width: 100%; }
    
    .hero h1 { font-size: 2rem; }
    .products-grid { grid-template-columns: 1fr; }
    
    .cart-item { flex-direction: column; text-align: center; }
    .cart-item-image { width: 100%; height: 150px; }
    
    .checkout-grid { grid-template-columns: 1fr; }
    .order-summary { position: static; order: -1; margin-bottom: 1.5rem; }
    
    .auth-container, .success-container { margin: 1.5rem; padding: 1.5rem; }
    
    .profile-header { flex-direction: column; align-items: flex-start; }
    .profile-actions { width: 100%; }
    .profile-actions .btn { flex: 1; }
}
