:root {
    --bg-primary: rgba(255, 255, 255, 0.85);
    --bg-secondary: rgba(250, 250, 250, 0.9);
    --bg-tertiary: rgba(245, 245, 245, 0.95);
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --text-muted: #999;
    --border-primary: rgba(229, 229, 229, 0.8);
    --border-secondary: rgba(240, 240, 240, 0.8);
    --accent: #1a1a1a;
    --accent-hover: #333;
    --gold: #FFD700;
    --gold-light: #FFE55C;
    --gold-dark: #B8860B;
    --shadow: rgba(0, 0, 0, 0.08);
    --modal-overlay: rgba(0, 0, 0, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.4);
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

[data-theme="dark"] {
    --bg-primary: rgba(26, 26, 26, 0.85);
    --bg-secondary: rgba(42, 42, 42, 0.9);
    --bg-tertiary: rgba(51, 51, 51, 0.95);
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #999999;
    --border-primary: rgba(64, 64, 64, 0.8);
    --border-secondary: rgba(51, 51, 51, 0.8);
    --accent: #FFD700;
    --accent-hover: #FFE55C;
    --shadow: rgba(0, 0, 0, 0.4);
    --modal-overlay: rgba(0, 0, 0, 0.85);
    --glass-bg: rgba(20, 20, 30, 0.8);
    --glass-border: rgba(255, 215, 0, 0.2);
    --gradient-bg: linear-gradient(135deg, #0c0c1e 0%, #1a1a3e 50%, #2d1b4e 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-bg);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

.stars-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#starsCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background: 
        radial-gradient(ellipse at top left, rgba(255, 215, 0, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(255, 165, 0, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at center, rgba(0, 0, 0, 0.2) 0%, transparent 70%);
    backdrop-filter: blur(0.5px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

/* ========== HEADER ========== */

.header {
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
    animation: slideDown 0.6s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold) 0%, #fff 30%, var(--gold) 60%, var(--gold-light) 100%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    letter-spacing: -0.5px;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 300% center; }
}

.theme-btn {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.4rem;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.15);
}

.theme-btn:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.35);
    border-color: var(--gold);
}

.theme-btn:active {
    transform: scale(0.95);
}

/* ========== HERO ========== */

.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 28px;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

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

.hero-glow {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.25) 0%, transparent 60%);
    pointer-events: none;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translateX(-50%) scale(1.3);
        opacity: 1;
    }
}

.hero h2 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--gold) 0%, #fff 25%, var(--gold) 50%, #fff 75%, var(--gold) 100%);
    background-size: 400% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
    position: relative;
    z-index: 2;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    opacity: 0.9;
}

/* ========== PRODUCTS ========== */

.products {
    padding: 2rem 0 4rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    position: relative;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.product-card.animated {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.15), transparent);
    transition: left 0.6s ease;
    z-index: 1;
}

.product-card:hover::before {
    left: 100%;
}

.product-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.35),
        0 0 60px rgba(255, 215, 0, 0.2);
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    transition: transform 0.5s ease;
    position: relative;
}

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

.product-info {
    padding: 1.5rem;
    position: relative;
    z-index: 2;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.product-description {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    opacity: 0.85;
}

.product-price {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.25rem;
    letter-spacing: -0.5px;
}

.add-to-cart {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
    background-size: 200% auto;
    color: #1a1a1a;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.35);
}

.add-to-cart:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 10px 35px rgba(255, 215, 0, 0.5);
}

.add-to-cart:active {
    transform: translateY(0) scale(0.98);
}

/* ========== CART BUTTON ========== */

.cart-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
    background-size: 200% auto;
    color: #1a1a1a;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 
        0 10px 40px rgba(255, 215, 0, 0.45),
        0 0 80px rgba(255, 215, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) 1s forwards;
    overflow: hidden;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-180deg);
    }
    50% {
        transform: scale(1.15) rotate(10deg);
    }
    70% {
        transform: scale(0.9) rotate(-5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.cart-glow {
    position: absolute;
    width: 150%;
    height: 150%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: glowRotate 3s linear infinite;
}

@keyframes glowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.cart-btn:hover {
    transform: scale(1.15) rotate(10deg);
    background-position: right center;
    box-shadow: 
        0 15px 50px rgba(255, 215, 0, 0.6),
        0 0 100px rgba(255, 215, 0, 0.35);
}

.cart-btn:active {
    transform: scale(1.05);
}

.cart-icon {
    position: relative;
    z-index: 2;
}

#cartCount {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #ff4444, #ff6b6b);
    color: white;
    border-radius: 50%;
    min-width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 3;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.5);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

#cartCount.bump {
    animation: bump 0.4s ease;
}

@keyframes bump {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

/* ========== MODAL ========== */

.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 2000;
    opacity: 0;
}

.cart-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 28px;
    max-width: 520px;
    width: 92%;
    max-height: 88vh;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 30px 100px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(255, 215, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: scale(0.85) translateY(-30px);
}

.cart-modal.active .modal-content {
    animation: modalIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.close-btn:hover {
    color: var(--gold);
    border-color: var(--gold);
    transform: rotate(90deg);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.3);
}

.cart-items {
    padding: 1.25rem 1.75rem;
    min-height: 100px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 14px;
    background: rgba(255, 215, 0, 0.03);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    animation: slideInLeft 0.4s ease forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: rgba(255, 215, 0, 0.2);
}

.cart-item:last-child {
    margin-bottom: 0;
}

.cart-item-info {
    flex: 1;
}

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

.cart-item-price {
    color: var(--gold);
    font-weight: 700;
    font-size: 1.1rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.quantity-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 500;
}

.quantity-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity {
    font-weight: 700;
    min-width: 35px;
    text-align: center;
    color: var(--gold);
    font-size: 1.15rem;
}

.cart-total {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--glass-border);
    font-size: 1.35rem;
}

.cart-total strong {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.payment-methods {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--glass-border);
}

.payment-methods h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.payment-options label {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    padding: 1.1rem 1.25rem;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    font-weight: 500;
}

.payment-options label:hover {
    border-color: var(--gold);
    background: rgba(255, 215, 0, 0.05);
    transform: translateX(5px);
}

.payment-options input[type="radio"] {
    accent-color: var(--gold);
    width: 20px;
    height: 20px;
}

.important-notice {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--glass-border);
}

.important-notice h4 {
    margin-bottom: 1rem;
    color: #ff6b6b;
    font-weight: 800;
    font-size: 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    animation: pulse 2s ease-in-out infinite;
}

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

.notice-content {
    background: rgba(255, 68, 68, 0.08);
    padding: 1.25rem;
    border-radius: 14px;
    border-left: 4px solid #ff6b6b;
}

.notice-content ol {
    margin: 0 0 1rem 0;
    padding-left: 1.25rem;
}

.notice-content li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9rem;
}

.notice-content li:last-child {
    margin-bottom: 0;
}

.warning {
    margin-top: 1.25rem;
    padding: 1rem;
    background: rgba(255, 68, 68, 0.12);
    border-radius: 12px;
    border: 1px solid rgba(255, 68, 68, 0.35);
}

.warning strong {
    color: #ff6b6b !important;
    font-size: 0.9rem;
    line-height: 1.5;
    display: block;
}

.checkout-btn {
    width: calc(100% - 3.5rem);
    margin: 1.5rem 1.75rem;
    padding: 1.15rem;
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
    background-size: 200% auto;
    color: #1a1a1a;
    border: none;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.4);
    letter-spacing: 0.5px;
}

.checkout-btn:hover {
    background-position: right center;
    transform: translateY(-3px);
    box-shadow: 0 15px 50px rgba(255, 215, 0, 0.55);
}

.checkout-btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: btnShine 3s infinite;
}

@keyframes btnShine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* ========== FOOTER ========== */

.footer {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--glass-border);
    position: relative;
    z-index: 10;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

/* ========== SCROLLBAR ========== */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-dark), var(--gold), var(--gold-light));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-light);
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .header-content {
        padding: 1rem 0;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .hero {
        padding: 3rem 1.5rem;
        margin: 1.5rem 0;
        border-radius: 20px;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .product-card {
        border-radius: 20px;
    }
    
    .cart-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }
    
    .modal-content {
        width: 95%;
        max-height: 92vh;
        border-radius: 24px;
    }
    
    .modal-header,
    .cart-items,
    .cart-total,
    .payment-methods,
    .important-notice {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    
    .checkout-btn {
        width: calc(100% - 2.5rem);
        margin-left: 1.25rem;
        margin-right: 1.25rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.15rem;
    }
    
    .theme-btn {
        width: 42px;
        height: 42px;
    }
    
    .hero h2 {
        font-size: 1.65rem;
    }
    
    .product-price {
        font-size: 1.6rem;
    }
}