/* Base Styles and Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a6de5;
    --secondary-color: #ff7f50;
    --dark-color: #333;
    --light-color: #f4f4f4;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --max-width: 1200px;
}

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

a {
    text-decoration: none;
    color: var(--dark-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: #3a59c7;
    transform: translateY(-2px);
}

.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 2rem;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
}

/* Header */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
}

.nav-links li {
    margin: 0 15px;
}

.nav-links a {
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.3rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--secondary-color);
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--dark-color);
    margin: 5px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/hero-bg.jpg');
    background-color: #4a6de5; /* Fallback color if image fails to load */
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 8rem 0;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Featured Categories */
.featured-categories {
    padding: 5rem 0;
    background-color: #fff;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.category-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-10px);
}

.category-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.category-card h3 {
    padding: 1rem;
    text-align: center;
    background-color: var(--light-color);
}

/* Products Section */
.products {
    padding: 5rem 0;
    background-color: #f9f9f9;
}

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

.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-img {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-info {
    padding: 1.5rem;
}

.product-category {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

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

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

.original-price {
    font-size: 0.9rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 0.5rem;
}

.discount {
    font-size: 0.8rem;
    background-color: var(--secondary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 0.5rem;
}

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

.stars {
    color: #ffc107;
    margin-right: 0.5rem;
}

.reviews-count {
    font-size: 0.8rem;
    color: #777;
}

.product-buttons {
    display: flex;
    justify-content: space-between;
}

.add-to-cart,
.view-details {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.add-to-cart {
    background-color: var(--primary-color);
    color: white;
    flex-grow: 1;
    margin-right: 0.5rem;
}

.add-to-cart:hover {
    background-color: #3a59c7;
}

.view-details {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.view-details:hover {
    background-color: #e1e1e1;
}

/* Special Offer */
.special-offer {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../images/offer-bg.jpg');
    background-color: #2a3b5c; /* Fallback color if image fails to load */
    background-size: cover;
    background-position: center;
    color: white;
    padding: 5rem 0;
    text-align: center;
}

.offer-content {
    max-width: 700px;
    margin: 0 auto;
}

.offer-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.offer-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.countdown {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.countdown-item {
    margin: 0 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    min-width: 80px;
    border-radius: 8px;
}

.countdown-item span:first-child {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}

/* Testimonials */
.testimonials {
    padding: 5rem 0;
    background-color: #fff;
}

.testimonial-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 2rem;
    padding: 1rem 0;
}

.testimonial {
    flex: 0 0 auto;
    width: 300px;
    scroll-snap-align: start;
    background-color: var(--light-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.rating {
    color: #ffc107;
    margin-bottom: 1rem;
}

.testimonial p {
    font-style: italic;
    margin-bottom: 1.5rem;
}

.customer h4 {
    font-weight: 600;
}

/* Newsletter */
.newsletter {
    padding: 4rem 0;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
}

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

.newsletter p {
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

#newsletter-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

#newsletter-form input {
    flex-grow: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 4px 0 0 4px;
    outline: none;
}

#newsletter-form button {
    border-radius: 0 4px 4px 0;
    background-color: var(--secondary-color);
}

#newsletter-form button:hover {
    background-color: #ff6a3c;
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--secondary-color);
}

.footer-section p {
    margin-bottom: 1rem;
}

.social-icons a {
    color: white;
    margin-right: 1rem;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: var(--secondary-color);
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: #bbb;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.payment-icons i {
    font-size: 2rem;
    margin-right: 1rem;
    color: #bbb;
}

.copyright {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #444;
    color: #bbb;
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 200;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.cart-overlay.show {
    visibility: visible;
    opacity: 1;
}

.cart {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: white;
    padding: 2rem;
    transition: all 0.3s ease;
    overflow-y: auto;
}

.cart-overlay.show .cart {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    margin-bottom: 2rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.cart-item {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 1rem;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cart-item-actions {
    display: flex;
    align-items: center;
}

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

.item-quantity {
    margin: 0 0.5rem;
}

.remove-item {
    color: var(--danger-color);
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: auto;
}

.cart-footer {
    border-top: 1px solid #eee;
    padding-top: 2rem;
}

.cart-total {
    font-weight: 700;
}

.checkout-btn {
    width: 100%;
    background-color: var(--success-color);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.checkout-btn:hover {
    background-color: #218838;
}

/* Add to Cart Feedback */
.add-to-cart-feedback {
    position: fixed;
    top: 20px;
    right: -300px;
    background-color: var(--success-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 4px;
    z-index: 1000;
    transition: right 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.add-to-cart-feedback.show {
    right: 20px;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .countdown-item {
        margin: 0 0.5rem;
        min-width: 60px;
    }
    
    .countdown-item span:first-child {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    header .container {
        padding: 1rem;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: white;
        flex-direction: column;
        align-items: center;
        padding-top: 2rem;
        transition: all 0.3s ease;
        z-index: 99;
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links li {
        margin: 1.5rem 0;
    }
    
    .hamburger {
        display: block;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }

    .category-grid,
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .countdown {
        flex-wrap: wrap;
    }
    
    .countdown-item {
        margin: 0.5rem;
    }
    
    .testimonial-slider {
        padding-bottom: 2rem;
    }
    
    .testimonial {
        width: 260px;
    }
    
    #newsletter-form {
        flex-direction: column;
    }
    
    #newsletter-form input {
        border-radius: 4px;
        margin-bottom: 1rem;
    }
    
    #newsletter-form button {
        border-radius: 4px;
    }
}

@media (max-width: 576px) {
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .hero {
        padding: 6rem 0;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .cart {
        max-width: 100%;
    }
}

/* Reduce number of hardware-accelerated animations */
.product-card:hover,
.category-card:hover,
.btn:hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

/* Only apply animations when not on low-power devices */
@media (prefers-reduced-motion: no-preference) {
    .product-card:hover .product-img img {
        transform: scale(1.05);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
    
    .product-card:hover,
    .category-card:hover {
        transform: none !important;
    }
} 