/* Q47 E-Commerce Store - Warm & Cozy Pastel Design */

:root {
    --primary: #FFF0E6;        /* Soft peach */
    --secondary: #FFF8DC;      /* Soft cream */
    --accent: #FFE4E1;         /* Soft rose */
    --success: #F0FFF0;        /* Soft sage */
    --background: #FFFBF5;     /* Warm white */
    --text-dark: #5A5A5A;      /* Dark gray */
    --text-light: #8B8B8B;     /* Light gray */
    --border: #FFE8D6;         /* Soft border */
    --shadow: rgba(0, 0, 0, 0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand h1 {
    font-size: 28px;
    color: var(--text-dark);
    font-weight: 700;
}

.tagline {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--accent);
    color: white;
}

.language-selector {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text-dark);
    font-size: 14px;
    cursor: pointer;
}

.btn-cart {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.btn-cart:hover {
    background: #FFD6C6;
    transform: translateY(-2px);
}

#authButtons {
    display: flex;
    gap: 10px;
}

.btn-login {
    background: white;
    color: var(--text-dark);
    border: 2px solid var(--primary);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: var(--primary);
}

.btn-signup {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-signup:hover {
    background: #FFD6C6;
    transform: translateY(-2px);
}

.user-email {
    color: var(--text-dark);
    font-weight: 500;
}

.btn-logout {
    background: var(--secondary);
    color: var(--text-dark);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: var(--border);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    padding: 100px 40px;
    text-align: center;
    margin-bottom: 60px;
}

.hero-content h2 {
    font-size: 48px;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 20px;
    color: var(--text-light);
    margin-bottom: 30px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #FFD6C6);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 200, 190, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text-dark);
    border: 2px solid var(--border);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--primary);
    border-color: var(--accent);
}

.btn-accent {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-accent:hover {
    background: #FFD6C6;
    transform: translateY(-2px);
}

.full-width {
    width: 100%;
    margin-top: 10px;
}

/* Products Section */
.products-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 40px;
    background: var(--background);
}

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

.products-section h2 {
    font-size: 36px;
    color: var(--text-dark);
    margin-bottom: 30px;
    text-align: center;
}

.search-bar {
    margin-bottom: 40px;
    text-align: center;
}

.search-bar input {
    width: 100%;
    max-width: 500px;
    padding: 14px 20px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 228, 225, 0.1);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(255, 200, 190, 0.2);
    border-color: var(--accent);
}

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

.product-info {
    padding: 20px;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.product-description {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
    line-height: 1.5;
}

.product-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.btn-view {
    flex: 1;
    background: var(--secondary);
    color: var(--text-dark);
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-view:hover {
    background: var(--primary);
}

.btn-add-cart {
    flex: 1;
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-add-cart:hover {
    background: #FFD6C6;
}

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

.cart-sidebar.open {
    transform: translateX(0);
}

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

.cart-header h3 {
    color: var(--text-dark);
    font-size: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-btn:hover {
    color: var(--accent);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--primary);
    border-radius: 8px;
    margin-bottom: 12px;
}

.cart-item-name {
    font-weight: 600;
    color: var(--text-dark);
}

.cart-item-price {
    color: var(--accent);
    font-weight: 600;
}

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

.cart-total {
    font-size: 18px;
    margin-bottom: 15px;
    text-align: right;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none;
}

.overlay.open {
    display: block;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px var(--shadow);
    position: relative;
}

.modal-form {
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    max-width: 500px;
}

.modal-form h2 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 28px;
}

.modal-form h3 {
    color: var(--text-dark);
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 16px;
}

.modal-form form {
    display: flex;
    flex-direction: column;
}

.modal-form input {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    background: white;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.modal-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 228, 225, 0.1);
}

.form-link {
    text-align: center;
    color: var(--text-light);
    margin-top: 15px;
    font-size: 14px;
}

.form-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.form-link a:hover {
    text-decoration: underline;
}

.error-message {
    color: #d32f2f;
    font-size: 14px;
    margin-top: 12px;
    padding: 12px;
    background: rgba(211, 47, 47, 0.1);
    border-radius: 6px;
    display: none;
}

.error-message.show {
    display: block;
}

.test-card-info {
    font-size: 12px;
    color: var(--text-light);
    background: var(--success);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-family: monospace;
}

.checkout-summary {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Product Detail Modal */
.product-detail {
    max-width: 600px;
}

.product-detail-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.product-detail h2 {
    color: var(--text-dark);
    font-size: 28px;
    margin-bottom: 10px;
}

.product-detail p {
    color: var(--text-light);
    margin-bottom: 15px;
}

.circuit-diagram {
    background: var(--secondary);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.bom-section {
    background: var(--success);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.bom-section h3 {
    color: var(--text-dark);
    margin-bottom: 10px;
}

.bom-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 15px 20px;
        gap: 10px;
    }

    .navbar-menu {
        gap: 10px;
        width: 100%;
        justify-content: space-between;
    }

    .hero {
        padding: 60px 20px;
    }

    .hero-content h2 {
        font-size: 32px;
    }

    .products-section {
        padding: 40px 20px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .cart-sidebar {
        width: 100%;
    }

    .modal-content {
        padding: 30px 20px;
    }

    .products-section h2 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .navbar-brand h1 {
        font-size: 20px;
    }

    .hero-content h2 {
        font-size: 24px;
    }

    .hero-content p {
        font-size: 16px;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .products-section h2 {
        font-size: 24px;
    }
}
