@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

:root {
    --primary-color: #8B5FBF;
    --primary-dark: #6B46C1;
    --primary-light: #9F7AEA;
    --secondary-color: #4C51BF;
    --accent-color: #D53F8C;
    --background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --text-light: #FFFFFF;
    --text-dark: #2D3748;
    --success: #48BB78;
    --warning: #ED8936;
    --error: #F56565;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    min-height: 100vh;
    color: var(--text-light);
    overflow-x: hidden;
    line-height: 1.6;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.shop-title {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #FFD700, #FF6B6B, #4ECDC4, #45B7D1);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
    margin-bottom: 1rem;
    text-align: center;
}

.lightning-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.lightning {
    position: absolute;
    width: 3px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, #FFD700, transparent);
    animation: lightningMove 1.5s linear infinite;
    opacity: 0;
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2000;
}

.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    animation: confettiFall 4s linear forwards;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes lightningMove {
    0% { transform: translateY(-100px) rotate(45deg); opacity: 0; }
    10% { opacity: 1; }
    20% { opacity: 0; }
    100% { transform: translateY(100vh) rotate(45deg); opacity: 0; }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

.main-container {
    display: none;
    min-height: 100vh;
    padding: 1.5rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.8rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

.admin-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    font-size: 1rem;
    opacity: 0.4;
    cursor: pointer;
    padding: 0.8rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
}

.admin-btn:hover {
    opacity: 1;
    background: var(--glass-bg);
}

.sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    border-left: 1px solid var(--glass-border);
    padding: 2rem 1.5rem;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    overflow-y: auto;
}

.sidebar.active {
    right: 0;
}

.sidebar h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
}

.category-list {
    list-style: none;
}

.category-item {
    padding: 1rem 1.2rem;
    margin: 0.5rem 0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid transparent;
}

.category-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border);
}

.category-item.active {
    background: transparent;
    border-color: var(--glass-border);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem;
}

.product-card {
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(31, 38, 135, 0.3);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
}

.product-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    line-height: 1.4;
}

.product-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
    line-height: 1.5;
    flex-grow: 1;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.product-quantity {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
    font-weight: 500;
}

.add-to-cart-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: auto;
}

.add-to-cart-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 95, 191, 0.4);
}

.add-to-cart-btn:disabled {
    background: #718096;
    cursor: not-allowed;
    opacity: 0.6;
}

.cart-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(139, 95, 191, 0.5);
    transition: all 0.3s ease;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 40px rgba(139, 95, 191, 0.6);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--background);
}

.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.cart-content {
    width: 95%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.cart-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
}

.cart-items {
    margin-bottom: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1.2rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    margin-right: 1rem;
    border: 1px solid var(--glass-border);
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 1rem;
}

.cart-item-price {
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: var(--glass-bg);
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: var(--primary-color);
}

.cart-total {
    margin-bottom: 1.5rem;
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.cart-total strong {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-light);
}

.checkout-btn {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 95, 191, 0.5);
}

.checkout-btn:disabled {
    background: #718096;
    cursor: not-allowed;
    opacity: 0.6;
}

.success-animation {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.success-icon {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    animation: bounce 1s ease infinite;
}

.success-animation h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-light), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.order-code {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-light);
    margin: 1.5rem 0;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.success-message {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    line-height: 1.6;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.empty-cart {
    text-align: center;
    padding: 3rem 2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

.empty-cart::before {
    content: "🛒";
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.notification.success {
    background: linear-gradient(135deg, var(--success), #38A169);
}

.notification.error {
    background: linear-gradient(135deg, var(--error), #E53E3E);
}

.notification.warning {
    background: linear-gradient(135deg, var(--warning), #DD6B20);
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .shop-title {
        font-size: 2.5rem;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .main-container {
        padding: 1rem;
    }

    .sidebar {
        width: 280px;
    }

    .cart-content {
        width: 100%;
        margin: 1rem;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    margin-right: 1rem;
    border: 1px solid var(--glass-border);
}

.cart-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    margin-right: 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
}

.cart-image-placeholder-icon {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
    opacity: 0.7;
}