/* ============================================
   MY-HOUSE — Premium Modern Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Color Palette */
    --primary: #6366F1;
    --primary-light: #818CF8;
    --primary-dark: #4F46E5;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --accent: #F59E0B;
    --accent-light: #FCD34D;
    --success: #10B981;
    --success-light: #D1FAE5;
    --danger: #EF4444;

    /* Backgrounds */
    --bg-body: #0F0F1A;
    --bg-surface: rgba(255, 255, 255, 0.04);
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-card-hover: rgba(255, 255, 255, 0.1);
    --bg-glass: rgba(255, 255, 255, 0.07);

    /* Text */
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(99, 102, 241, 0.3);

    /* Misc */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 16px 48px rgba(99, 102, 241, 0.2);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   Header
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 26, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 18px;
    border-radius: 999px;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff !important;
    padding: 10px 22px;
    border-radius: 999px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
    transition: var(--transition);
}

.cart-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.cart-badge {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    min-width: 24px;
    text-align: center;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    padding: 80px 0 40px;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-glow);
    border: 1px solid var(--border-glow);
    padding: 6px 18px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease;
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.page-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 16px;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.page-title .gradient-text {
    background: linear-gradient(135deg, var(--primary-light), #A78BFA, #F472B6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 520px;
    margin: 0 auto 50px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Products Grid
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding-bottom: 60px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    animation: fadeInUp 0.5s ease both;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }
.product-card:nth-child(9) { animation-delay: 0.45s; }
.product-card:nth-child(10) { animation-delay: 0.5s; }
.product-card:nth-child(11) { animation-delay: 0.55s; }
.product-card:nth-child(12) { animation-delay: 0.6s; }
.product-card:nth-child(13) { animation-delay: 0.65s; }
.product-card:nth-child(14) { animation-delay: 0.7s; }
.product-card:nth-child(15) { animation-delay: 0.75s; }

.product-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-hover);
    background: var(--bg-card-hover);
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(168,85,247,0.05));
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image {
    transform: scale(1.08);
}

.product-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    background: linear-gradient(135deg, var(--accent), #F97316);
    color: #000;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.product-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 20px;
    flex: 1;
    line-height: 1.6;
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.product-price {
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-price-suffix {
    font-size: 0.8rem;
    font-weight: 500;
    -webkit-text-fill-color: var(--text-muted);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.2px;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: var(--transition);
}

.btn:hover::after {
    opacity: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.45);
}

.btn-outline {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--border-glow);
    background: var(--primary-glow);
    color: var(--primary-light);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #DC2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(239, 68, 68, 0.45);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

/* ============================================
   Cart Page
   ============================================ */
.cart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    backdrop-filter: blur(20px);
    animation: fadeInUp 0.5s ease;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item:hover {
    background: var(--bg-glass);
    margin: 0 -20px;
    padding: 24px 20px;
    border-radius: var(--radius-md);
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.cart-item-price-each {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.cart-item-quantity {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
    min-width: 60px;
    text-align: center;
}

.cart-item-subtotal {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-light);
    min-width: 120px;
    text-align: right;
}

.cart-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 30px 0;
}

.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.cart-total {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-total-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.cart-total-value {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.cart-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.empty-cart {
    text-align: center;
    padding: 80px 20px;
    animation: fadeInUp 0.5s ease;
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-cart p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Alert */
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    text-align: center;
    font-weight: 600;
    animation: fadeInUp 0.5s ease;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    padding: 60px 0 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    margin-bottom: 16px;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 300px;
    line-height: 1.7;
}

.footer-links h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.footer-links a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 12px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-light);
    transform: translateX(4px);
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        height: 60px;
    }
    
    .logo-text {
        font-size: 1.15rem;
    }

    .hero {
        padding: 50px 0 20px;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 18px;
    }
    
    .cart-container {
        padding: 20px;
        border-radius: var(--radius-lg);
    }
    
    .cart-item {
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .cart-item-subtotal {
        text-align: left;
        min-width: auto;
    }
    
    .cart-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .cart-actions {
        flex-direction: column;
    }
    
    .cart-actions .btn {
        width: 100%;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .nav-link:not(.cart-link) {
        display: none;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-bottom {
        flex-direction: column;
        gap: 14px;
        align-items: stretch;
    }
    
    .product-price {
        text-align: center;
    }
    
    .btn-primary {
        width: 100%;
    }
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Selection
   ============================================ */
::selection {
    background: var(--primary);
    color: #fff;
}
