:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --light: #f9fafb;
    --gray: #6b7280;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

body.dark-mode {
    --primary: #818cf8;
    --dark: #f9fafb;
    --light: #111827;
    --white: #1f2937;
    --gray: #9ca3af;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    transition: var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 1.8rem;
}

.nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-icon {
    position: relative;
    background: var(--light);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
}

.btn-icon:hover {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.1);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Promo Banner */
.promo-banner {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: var(--white);
    padding: 1rem 0;
    animation: slideDown 0.5s ease;
}

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

.promo-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    position: relative;
}

.promo-icon {
    font-size: 1.5rem;
    animation: shake 2s infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: rotate(-10deg); }
    20%, 40%, 60%, 80% { transform: rotate(10deg); }
}

.promo-text {
    font-weight: 600;
    font-size: 1.1rem;
}

.promo-close {
    position: absolute;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--white);
    transition: var(--transition);
}

.promo-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    text-align: center;
    padding: 5rem 0;
    animation: fadeIn 1s ease;
}

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

.hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease;
}

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

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background: #db2777;
}

.btn-block {
    width: 100%;
}

/* Filters Section */
.filters-section {
    background: var(--white);
    padding: 2rem 0;
    box-shadow: var(--shadow);
}

.filters-content {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.search-box {
    flex: 2;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.search-box input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--light);
    color: var(--dark);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray);
    font-size: 0.875rem;
}

.filter-group select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    background: var(--light);
    color: var(--dark);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Products Section */
.products-section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark);
}

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

.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.product-card.has-discount::before {
    content: '-' attr(data-discount) '%';
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.875rem;
    z-index: 2;
    animation: pulse 2s infinite;
}

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

.product-image {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    font-size: 5rem;
    position: relative;
}

.btn-wishlist {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 3;
    color: var(--gray);
}

.btn-wishlist:hover {
    background: var(--white);
    transform: scale(1.1);
}

.btn-wishlist.active {
    color: var(--danger);
    animation: heartbeat 0.3s ease;
}

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

.product-info {
    padding: 1.5rem;
}

.product-category {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

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

.product-author {
    color: var(--gray);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stars {
    color: var(--warning);
}

.rating-count {
    color: var(--gray);
    font-size: 0.875rem;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.price-current {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.price-original {
    font-size: 1rem;
    color: var(--gray);
    text-decoration: line-through;
}

.btn-add-cart {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.btn-add-cart:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.newsletter-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.newsletter-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.newsletter-form button {
    padding: 1rem 2rem;
    background: var(--white);
    color: var(--primary);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Footer */
.footer {
    background: var(--white);
    padding: 2rem 0;
    text-align: center;
    color: var(--gray);
    border-top: 1px solid var(--light);
}

/* Cart Sidebar */
.cart-sidebar,
.wishlist-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    transition: right 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active,
.wishlist-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    font-size: 1.5rem;
    color: var(--dark);
}

.close-btn {
    background: var(--light);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--dark);
}

.close-btn:hover {
    background: var(--danger);
    color: var(--white);
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item,
.wishlist-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    align-items: center;
}

.cart-item-icon,
.wishlist-item-icon {
    font-size: 2rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--border-radius);
}

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

.cart-item-title,
.wishlist-item-title {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.cart-item-price,
.wishlist-item-price {
    color: var(--primary);
    font-weight: 700;
}

.cart-item-actions,
.wishlist-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-remove {
    background: var(--danger);
    color: var(--white);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-remove:hover {
    background: #dc2626;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray);
}

.cart-empty i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 2px solid var(--light);
}

.promo-section {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.promo-section input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--light);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    background: var(--light);
    color: var(--dark);
}

.promo-section input:focus {
    outline: none;
    border-color: var(--primary);
}

.promo-hint {
    font-size: 0.75rem;
    color: var(--gray);
    margin-bottom: 1rem;
    text-align: center;
}

.promo-applied {
    background: linear-gradient(135deg, var(--success), #059669);
    color: var(--white);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease;
}

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

.btn-remove-promo {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-remove-promo:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.product-modal-content,
.checkout-modal-content,
.history-modal-content {
    max-width: 800px;
}

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

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--dark);
}

.modal-body {
    padding: 1.5rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    flex: 1;
    padding: 0.875rem;
    background: var(--light);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    color: var(--dark);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--light);
    color: var(--dark);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Checkout Summary */
.checkout-summary {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.checkout-summary h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    color: var(--dark);
}

.summary-row.promo-row {
    color: var(--success);
    font-weight: 600;
}

.summary-row.total-row {
    font-size: 1.25rem;
    font-weight: 700;
    padding-top: 0.75rem;
    border-top: 2px solid var(--white);
}

.promo-amount {
    color: var(--success);
}

/* History */
.history-item {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--white);
}

.history-date {
    font-weight: 600;
    color: var(--dark);
}

.history-total {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.25rem;
}

.history-products {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-product {
    display: flex;
    justify-content: space-between;
    color: var(--gray);
}

/* Product Detail */
.product-detail {
    text-align: center;
}

.product-detail-icon {
    font-size: 6rem;
    margin-bottom: 1rem;
}

.product-detail-category {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.product-detail-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.product-detail-author {
    color: var(--gray);
    margin-bottom: 1rem;
}

.product-detail-rating {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.product-detail-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.product-detail-description {
    text-align: left;
    color: var(--gray);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.product-detail-features {
    text-align: left;
    margin-bottom: 2rem;
}

.product-detail-features h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.product-detail-features ul {
    list-style: none;
    padding: 0;
}

.product-detail-features li {
    padding: 0.75rem;
    background: var(--light);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-detail-features li i {
    color: var(--success);
}

.product-detail-reviews {
    text-align: left;
    margin-bottom: 2rem;
}

.product-detail-reviews h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.review-item {
    background: var(--light);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.review-author {
    font-weight: 600;
    color: var(--dark);
}

.review-rating {
    color: var(--warning);
}

.review-comment {
    color: var(--gray);
}

.rating-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--light);
}

.rating-section h3 {
    margin-bottom: 1rem;
    color: var(--dark);
}

.rating-stars {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.rating-star {
    font-size: 2rem;
    cursor: pointer;
    color: var(--light);
    transition: var(--transition);
}

.rating-star:hover,
.rating-star.active {
    color: var(--warning);
}

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* Toast */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    transition: bottom 0.3s ease;
}

.toast.show {
    bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .filters-content {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .cart-sidebar,
    .wishlist-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .btn-wishlist {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .newsletter-section {
        padding: 2rem 0;
    }
    
    .cart-item-actions,
    .wishlist-item-actions {
        flex-direction: row;
    }
}