/* ====== GENERAL ====== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-image: url('img/truck.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    line-height: 1.6;
}

/* ====== HEADER ====== */
header {
    background-color: #111;
    color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

header h1 {
    margin: 0;
    font-size: 1.8em;
}

header .logo {
    flex: 1;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #d32f2f;
}

.cart-btn {
    background-color: #d32f2f;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.cart-btn:hover {
    background-color: #b71c1c;
}

/* ====== HERO ====== */
.hero {
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('https://images.unsplash.com/photo-1552820728-8ac41f1ce891?w=1200&h=500&fit=crop') center/cover no-repeat;
    text-align: center;
    color: white;
    padding: 120px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.hero-content h2 {
    font-size: 2.5em;
    margin: 0 0 15px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

.hero-content p {
    font-size: 1.2em;
    margin: 0 0 20px 0;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.hero-btn {
    background-color: #d32f2f;
    padding: 14px 30px;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s;
    cursor: pointer;
}

.hero-btn:hover {
    background-color: #b71c1c;
    transform: scale(1.05);
}

/* ====== SEARCH SECTION ====== */
.search-section {
    padding: 20px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.95);
}

.search-bar {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    font-size: 1em;
    border: 2px solid #d32f2f;
    border-radius: 5px;
    outline: none;
    transition: border-color 0.3s;
}

.search-bar:focus {
    border-color: #111;
}

/* ====== PRODUCTS ====== */
.products {
    padding: 50px 20px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.9);
}

.products h2 {
    font-size: 2em;
    margin-bottom: 40px;
    color: #111;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.product {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

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

.product img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.product h3 {
    margin: 15px 0 10px;
    font-size: 1.2em;
    color: #111;
}

.product .price {
    font-size: 1.5em;
    color: #d32f2f;
    font-weight: bold;
    margin: 10px 0;
}

.product .category {
    color: #666;
    font-size: 0.9em;
    margin: 5px 0 15px;
}

.product button {
    background-color: #1e88e5;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: background-color 0.3s;
}

.product button:hover {
    background-color: #1565c0;
}

/* ====== TESTIMONIALS ====== */
.testimonials {
    padding: 50px 20px;
    background-color: #f5f5f5;
    text-align: center;
}

.testimonials h2 {
    font-size: 2em;
    margin-bottom: 40px;
    color: #111;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.testimonial {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-left: 5px solid #d32f2f;
}

.testimonial .stars {
    font-size: 1.3em;
    margin: 0 0 15px;
}

.testimonial p {
    color: #666;
    font-style: italic;
    margin: 10px 0;
}

.testimonial .author {
    color: #111;
    font-weight: bold;
    margin-top: 15px;
}

/* ====== NEWSLETTER ====== */
.newsletter {
    padding: 50px 20px;
    background: linear-gradient(135deg, #d32f2f, #111);
    color: white;
    text-align: center;
}

.newsletter h2 {
    font-size: 2em;
    margin: 0 0 15px;
}

.newsletter p {
    margin: 0 0 30px;
    font-size: 1.1em;
}

#newsletterForm {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
    flex-wrap: wrap;
}

#newsletterForm input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
}

#newsletterForm button {
    padding: 12px 30px;
    background-color: white;
    color: #d32f2f;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

#newsletterForm button:hover {
    background-color: #f0f0f0;
}

/* ====== CONTACT ====== */
.contact {
    padding: 50px 20px;
    background-color: rgba(34, 34, 34, 0.95);
    color: white;
    text-align: center;
}

.contact h2 {
    font-size: 2em;
    margin-bottom: 30px;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.contact-info p {
    font-size: 1.05em;
    line-height: 1.8;
}

/* ====== CART POPUP ====== */
.cart-popup {
    position: fixed;
    top: 20%;
    right: -350px;
    width: 300px;
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    border-radius: 10px;
    transition: right 0.4s;
    z-index: 200;
    max-height: 80vh;
    overflow-y: auto;
}

.cart-popup.active {
    right: 20px;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.cart-header h3 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
}

#cartItems {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

#cartItems li {
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-total {
    border-top: 2px solid #ddd;
    padding-top: 15px;
    margin: 15px 0;
    font-size: 1.2em;
    font-weight: bold;
}

.checkout-btn {
    width: 100%;
    background-color: #d32f2f;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

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

/* ====== FOOTER ====== */
footer {
    background-color: #111;
    color: white;
    text-align: center;
    padding: 30px 20px;
}

footer p {
    margin: 10px 0;
}

footer a {
    color: #d32f2f;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: white;
}

/* ====== RESPONSIVE DESIGN ====== */
/* Tablet (768px and below) */
@media (max-width: 768px) {
    header {
        padding: 15px;
    }

    header h1 {
        font-size: 1.3em;
    }

    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 60px;
        right: 0;
        background-color: #111;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s;
    }

    .nav-menu.active {
        max-height: 400px;
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 0;
        padding: 15px;
    }

    .nav-menu li {
        border-bottom: 1px solid #333;
        padding: 10px 0;
    }

    .hero {
        padding: 60px 20px;
        min-height: 350px;
    }

    .hero-content h2 {
        font-size: 1.8em;
    }

    .hero-content p {
        font-size: 1em;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }

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

    .cart-popup {
        width: 280px;
        right: -280px;
    }

    .cart-popup.active {
        right: 10px;
    }

    #newsletterForm {
        flex-direction: column;
    }

    #newsletterForm input,
    #newsletterForm button {
        width: 100%;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.1em;
    }

    header {
        padding: 10px;
    }

    .hero {
        padding: 40px 15px;
        min-height: 250px;
    }

    .hero-content h2 {
        font-size: 1.4em;
    }

    .hero-content p {
        font-size: 0.9em;
    }

    .products {
        padding: 30px 15px;
    }

    .products h2,
    .testimonials h2,
    .newsletter h2,
    .contact h2 {
        font-size: 1.5em;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .product {
        padding: 15px;
    }

    .testimonials {
        padding: 30px 15px;
    }

    .newsletter {
        padding: 30px 15px;
    }

    .newsletter p {
        font-size: 0.95em;
    }

    .contact {
        padding: 30px 15px;
    }

    .contact-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .cart-popup {
        width: 250px;
        top: 10%;
        right: -250px;
    }

    .cart-popup.active {
        right: 5px;
    }

    .search-bar {
        font-size: 0.95em;
    }
}
