body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    display: flex; /* Use flexbox for overall page layout */
    flex-direction: column; /* Stack header, main, footer vertically */
    min-height: 100vh; /* Ensures body takes at least full viewport height */
}

main {
    flex-grow: 1; /* Allows main content to expand and push footer down */
    padding: 20px 0; /* Add padding above and below main content */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Add horizontal padding to containers */
}





/* Search Results and Product Grid */
.main-content-search h1 {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Responsive grid */
    gap: 25px;
    justify-content: center; /* Center items if they don't fill the row */
    padding-bottom: 30px; /* Space below grid */
}

.product-box {
    border: 1px solid #eee;
    padding: 15px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Push button to bottom */
    transition: transform 0.2s ease;
}

.product-box:hover {
    transform: translateY(-5px);
}

.product-box img {
    max-width: 100%;
    height: 180px; /* Fixed height for consistency */
    object-fit: contain; /* Ensures image fits without cropping */
    margin-bottom: 10px;
}

.product-box .name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
    font-size: 1.1em;
}

.product-box .price {
    color: #e67e22; /* Example accent color */
    font-size: 1.2em;
    margin-bottom: 15px;
}

.product-box .btn.view-product-btn {
    background-color: #007bff; /* Primary button color */
    color: white;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    margin-top: auto; /* Pushes button to the bottom of flex container */
}

.product-box .btn.view-product-btn:hover {
    background-color: #0056b3;
}

.no-results-message {
    text-align: center;
    grid-column: 1 / -1; /* Make message span all columns */
    padding: 50px 0;
    font-size: 1.2em;
    color: #777;
}

/* Footer Styles */
footer {
    width: 100%;
    background-color: #333;
    color: #fff;
    padding: 40px 0;
    text-align: center;
    margin-top: auto; /* Pushes footer to the bottom */
}

footer .footer-heading {
    text-align: center;
    color: #fff;
    margin-bottom: 30px;
    font-size: 2em;
}

footer .footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: flex-start;
    max-width: 1200px;
    margin: 40px auto 20px auto; /* Increased top margin for separation */
    padding: 0 15px;
    border-top: 1px solid #555; /* Separator line for main footer content */
    padding-top: 30px;
}

.footer-section {
    flex: 1;
    min-width: 280px;
    margin: 0 15px 20px 15px;
    text-align: left;
}

.footer-section.full-width {
    flex: 0 0 100%; /* Make this section take full width */
    margin-bottom: 30px;
}

.footer-section h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-section p, .footer-section ul li a {
    color: #ccc;
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li a {
    text-decoration: none;
    line-height: 1.8;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #fff;
}

.copyright {
    background-color: #222;
    padding: 15px 0;
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
    border-top: 1px solid #444;
}

.btn.continue-shopping-btn {
    padding: 12px 25px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

.btn.continue-shopping-btn:hover {
    background-color: #218838;
}

/* Responsive Adjustments */
@media (max-width: 768px) {



   

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }

    footer .footer-bottom {
        flex-direction: column;
        align-items: center;
    }

    .footer-section {
        text-align: center;
        margin: 0 0 20px 0;
    }
}


    .product-box img {
        height: 150px;
    }

        .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Responsive grid */
    gap: 25px;
    justify-content: center; /* Center items if they don't fill the row */
    padding-bottom: 30px; /* Space below grid */
}
  .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }
        /* Specific styles for product.php */
        :root {
            --primary-color: #4CAF50; /* A nice green, for example */
            --secondary-color: #FFA07A; /* Light Salmon */
            --text-dark: #333;
            --text-light: #f1f1f1;
            --bg-light: #fafafa;
            --border-color: #ddd;
            --border-radius: 8px;
            --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            --transition: all 0.3s ease;
        }

        body {
            background-color: var(--bg-light);
            font-family: sans-serif;
            color: var(--text-dark);
        }

    


      .product-detail-section {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 50px 25px;
    max-width: 1200px; /* keeps it centered and neat */
    margin: 100px auto 50px auto; 
    background-color: var(--bg-light);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    align-items: flex-start;
}

/* Tablet */
@media (max-width: 992px) {
    .product-detail-section {
        gap: 30px;
        padding: 40px 20px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .product-detail-section {
        flex-direction: column; /* stack image and details */
        gap: 20px;
        padding: 30px 15px;
        margin: 80px auto 30px auto;
    }
}

/* Extra small */
@media (max-width: 480px) {
    .product-detail-section {
        padding: 20px 10px;
        gap: 15px;
        margin: 60px auto 20px auto;
    }
}


        .product-image-container {
            flex: 1 1 450px; /* Allows image to take up space, minimum 450px */
            max-width: 50%; /* Max width for larger screens */
            border-radius: var(--border-radius);
            overflow: hidden;
        
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .product-image-container img {
            width: 100%;
            height: 450px; /* Fixed height for consistency */
            object-fit: contain; /* Ensures entire image is visible, no cropping */
            display: block;
        }

        .product-info {
            flex: 1 1 450px; /* Allows info to take up space, minimum 450px */
            max-width: 50%; /* Max width for larger screens */
            display: flex;
            flex-direction: column;
            justify-content: flex-start; /* Align content to the top */
        }

        .product-info .product-name {
            font-size: 2.8rem;
            font-weight: 700;
            color: var(--text-dark);
            margin-bottom: 15px;
            line-height: 1.2;
        }

        .product-info .product-category-detail {
            font-size: 1.1rem;
            color: var(--secondary-color);
            margin-bottom: 10px;
            text-transform: uppercase;
            font-weight: 500;
            letter-spacing: 0.5px;
        }

        .product-info .product-description-detail {
            font-size: 1.05rem;
            color: var(--text-dark);
            line-height: 1.7;
            margin-bottom: 25px;
            border-left: 3px solid var(--primary-color);
            padding-left: 15px;
            background-color: rgba(76, 175, 80, 0.05); /* Light tint for description background */
            padding: 15px;
            border-radius: 5px;
        }

        .product-info .product-price-detail {
            font-size: 2.2rem;
            font-weight: 700;
            color: var(--primary-color);
            margin-bottom: 20px;
        }

        .product-info .product-price-detail span {
            font-size: 1.8rem; /* Dollar sign can be slightly smaller */
        }

        .product-info .product-availability {
            font-size: 1rem;
            color: var(--text-dark);
            margin-bottom: 30px;
            font-weight: 500;
        }

        .product-actions {
            display: flex;
            flex-direction: column; /* Stack buttons */
            gap: 15px;
            margin-top: auto; /* Pushes forms to the bottom of the info box */
        }

        .product-actions .btn {
            width: 100%; /* Make button full width */
            padding: 15px 25px;
            font-size: 1.1rem;
            letter-spacing: 1px;
            text-transform: capitalize;
            border-radius: var(--border-radius);
            transition: var(--transition);
        }

        .product-actions .btn-primary {
            background-color: var(--primary-color);
            color: white;
            border: 1px solid var(--primary-color);
        }
        .product-actions .btn-primary:hover {
            background-color: #45a049;
            border-color: #45a049;
        }

        .product-actions .btn-secondary-outline {
            background-color: transparent;
            color: var(--primary-color);
            border: 1px solid var(--primary-color);
        }
        .product-actions .btn-secondary-outline:hover {
            background-color: var(--primary-color);
            color: white;
        }
        .product-actions .btn-wishlist {
            background-color: #f0f0f0;
            color: #E74C3C; /* Red heart */
            border: 1px solid #ccc;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }
        .product-actions .btn-wishlist:hover {
            background-color: #e0e0e0;
        }
        .product-actions .btn-wishlist.added {
            background-color: #e74c3c; /* Red background when added */
            color: white; /* White heart when added */
            border-color: #e74c3c;
        }
        .product-actions .btn-wishlist.added:hover {
            background-color: #c0392b;
            border-color: #c0392b;
        }


        .quantity-selector {
            display: flex;
            align-items: center;
            justify-content: center; /* Center quantity selector */
            margin-bottom: 15px;
        }

        .quantity-selector button {
            background-color: var(--secondary-color);
            color: var(--text-dark);
            border: none;
            padding: 8px 15px;
            font-size: 1.2rem;
            cursor: pointer;
            border-radius: var(--border-radius);
            transition: var(--transition);
        }
        .quantity-selector button:hover {
            background-color: #8C9998; /* Darker secondary on hover */
        }

        .quantity-selector input[type="number"] {
            width: 70px;
            text-align: center;
            font-size: 1.1rem;
            padding: 8px;
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            margin: 0 10px;
            color: var(--text-dark);
            background-color: var(--bg-light);
        }

        /* "You Might Also Like" section styling (reusing existing product box styles) */
        .related-products-section {
            padding: 60px 25px;
            max-width: 1300px;
            margin: 0 auto 50px auto;
            text-align: center;
        }

        .related-products-section .heading {
            margin-bottom: 40px;
            color: var(--text-dark);
        }

        .related-products-section .box-container {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 30px;
            justify-content: center;
        }

        .related-products-section .box {
            background-color: #fff;
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius);
            padding: 20px;
            text-align: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            transition: var(--transition);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }
        .related-products-section .box:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        }

        .related-products-section .box img {
            max-width: 100%;
            height: 180px;
            object-fit: contain;
            margin-bottom: 15px;
            display: block;
            margin-left: auto;
            margin-right: auto;
        }

        .related-products-section .box .name {
            font-size: 1.2rem;
            font-weight: 600;
            color: var(--text-dark);
            margin-bottom: 10px;
            flex-grow: 1; /* Allows name to take available space */
        }

        .related-products-section .box .price {
            font-size: 1.1rem;
            color: var(--primary-color);
            font-weight: 700;
            margin-bottom: 15px;
        }

        .related-products-section .box .btn,
        .related-products-section .box .option-btn {
            display: block;
            width: 100%;
            padding: 10px 15px;
            margin-top: 10px;
            border-radius: 5px;
            text-align: center;
            text-decoration: none;
            font-weight: 600;
            transition: var(--transition);
        }

        .related-products-section .box .btn {
            background-color: var(--primary-color);
            color: white;
            border: 1px solid var(--primary-color);
        }
        .related-products-section .box .btn:hover {
            background-color: #45a049;
            border-color: #45a049;
        }

        .related-products-section .box .option-btn {
            background-color: transparent;
            color: var(--text-dark);
            border: 1px solid var(--border-color);
        }
        .related-products-section .box .option-btn:hover {
            background-color: var(--border-color);
        }

        .message {
            padding: 10px;
            margin: 20px auto;
            border-radius: 5px;
            font-weight: bold;
            max-width: 800px;
            text-align: center;
        }
        .message.success {
            background-color: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
        .message.error {
            background-color: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }
        .message.info {
            background-color: #d1ecf1;
            color: #0c5460;
            border: 1px solid #bee5eb;
        }

        /* Responsiveness for product detail page */
        @media (max-width: 992px) {
            .product-detail-section {
                flex-direction: column; /* Stack image and info on medium screens */
                align-items: center;
                gap: 30px;
                padding: 40px 20px;
            }
            .product-image-container,
            .product-info {
                max-width: 100%; /* Allow full width */
            }
            .product-image-container img {
                height: 400px; /* Adjust image height */
            }
            .product-info .product-name {
                font-size: 2.2rem;
                text-align: center;
            }
            .product-info .product-category-detail,
            .product-info .product-description-detail,
            .product-info .product-price-detail,
            .product-info .product-availability {
                text-align: center;
                padding-left: 0;
                border-left: none;
            }
            .product-info .product-description-detail {
                background-color: transparent; /* Remove tint on smaller screens */
            }
            .product-actions {
                width: 70%; /* Constrain form width */
                margin: 0 auto;
            }
        }

        @media (max-width: 768px) {
            .product-detail-section {
                margin-top: 80px; /* Less margin */
            }
            .product-image-container img {
                height: 300px; /* Further adjust image height */
            }
            .product-info .product-name {
                font-size: 1.8rem;
            }
            .product-actions {
                width: 90%; /* Wider on smaller screens */
            }
            .related-products-section .box-container {
                grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
                gap: 20px;
            }
        }

        @media (max-width: 480px) {
            .product-detail-section {
                padding: 25px 15px;
                gap: 20px;
            }
            .product-image-container img {
                height: 250px;
            }
            .product-info .product-name {
                font-size: 1.6rem;
            }
            .product-info .product-category-detail {
                font-size: 0.95rem;
            }
            .product-info .product-description-detail {
                font-size: 0.9rem;
                padding: 10px;
            }
            .product-info .product-price-detail {
                font-size: 1.8rem;
            }
            .product-actions .btn {
                font-size: 0.95rem;
                padding: 12px 20px;
            }
            .related-products-section .box-container {
                grid-template-columns: 1fr; /* Single column on very small screens */
            }
        }