/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff9900;
    --secondary-color: #146eb4;
    --dark-color: #1a1a1a;
    --light-color: #f5f5f5;
    --white: #ffffff;
    --gray: #666666;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.2);
    --transition: all 0.3s ease;
    --border-color: #ddd;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--white);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: #DC143C;
    color: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px var(--shadow-dark);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 4rem;
    font-weight: 900;
    color: var(--white);
    cursor: pointer;
    min-width: fit-content;
    letter-spacing: 0.05em;
}

.logo-icon {
    font-size: 3rem;
    color: var(--primary-color);
}

/* Search Container */
.search-container {
    flex: 1;
    display: flex;
    max-width: 500px;
}

.search-bar {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 5px 0 0 5px;
    font-size: 1rem;
    outline: none;
}

.search-bar:focus {
    outline: 2px solid var(--primary-color);
}

.search-btn {
    padding: 0.75rem 1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.search-btn:hover {
    background-color: #ff8c00;
}

/* Cart Container */
.cart-container {
    position: relative;
}

.cart-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    transition: var(--transition);
}

.cart-btn:hover {
    transform: scale(1.1);
}

.cart-icon {
    display: inline-block;
}

.cart-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background-color: var(--white);
    box-shadow: -2px 0 10px var(--shadow-dark);
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.cart-modal.active {
    right: 0;
}

.cart-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h2 {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-color);
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--primary-color);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.empty-cart {
    text-align: center;
    color: var(--gray);
    padding: 2rem 0;
}

.cart-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background-color: var(--light-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.qty-btn {
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    width: 25px;
    height: 25px;
    cursor: pointer;
    border-radius: 3px;
    transition: var(--transition);
}

.qty-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.remove-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.remove-btn:hover {
    color: #c0392b;
}

.cart-footer {
    border-top: 2px solid var(--border-color);
    padding: 1.5rem;
    background-color: var(--light-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.total-label {
    font-weight: 600;
    color: var(--dark-color);
}

.total-amount {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.checkout-btn:hover {
    background-color: #ff8c00;
}

.checkout-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Hero Section */
.hero {
    background: #DC143C;
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* Products Section */
.products-section {
    padding: 3rem 0;
    background-color: var(--light-color);
    min-height: 60vh;
}

.section-title {
    font-size: 2rem;
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 2.5rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 5px 20px var(--shadow-dark);
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.product-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    overflow: hidden;
}

.product-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    min-height: 2.8rem;
}

.product-description {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 1rem;
    flex: 1;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.add-to-cart-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.add-to-cart-btn:hover {
    background-color: #ff8c00;
    transform: scale(1.02);
}

.add-to-cart-btn:active {
    transform: scale(0.98);
}

/* Footer */
.footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: 2rem 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    justify-content: center;
}

.footer-text {
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .logo {
        width: 100%;
    }

    .search-container {
        width: 100%;
        max-width: none;
    }

    .cart-modal {
        width: 100%;
        right: -100%;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        flex-direction: column;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo-text {
        font-size: 1rem;
    }

    .search-container {
        order: 3;
        width: 100%;
    }

    .cart-container {
        order: 2;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .product-name {
        font-size: 0.9rem;
    }

    .product-price {
        font-size: 1.2rem;
    }

    .hero-content h1 {
        font-size: 1.5rem;
    }

    .hero-content p {
        font-size: 1rem;
    }
}
