/* --- Global Styles & Variables --- */
:root {
    --primary-color: #ff9900; /* Amazon's orange */
    --secondary-color: #232f3e; /* Amazon's dark blue */
    --background-light: #f4f4f4;
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}

body {
    background-color: var(--background-light);
    color: #333;
    line-height: 1.6;
}

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

/* --- Header & Footer --- */
.header, .footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 20px 0;
    text-align: center;
}

/* --- Search Section --- */
.search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

#searchInput {
    flex-grow: 1;
    padding: 12px 15px;
    border: 2px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#searchInput:focus {
    border-color: var(--primary-color);
    outline: none;
}

#searchButton {
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}

#searchButton:hover {
    background-color: #cc7a00;
}

/* --- AI Recommendations Grid --- */
.recommendations-section {
    margin-top: 40px;
}

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

.recommendation-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 15px;
    text-align: center;
    transition: transform 0.3s;
}

.recommendation-card:hover {
    transform: translateY(-5px);
}

.recommendation-card img {
    max-width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
}

.recommendation-card .view-details-btn {
    display: block;
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    background-color: #1994b6; /* Lighter blue/cyan */
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.recommendation-card .view-details-btn:hover {
    background-color: #157997;
}

/* --- Product List (Search Results) --- */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
}

.product-card {
    display: flex;
    background: white;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    padding: 20px;
}

.product-image-container {
    flex-shrink: 0;
    width: 250px;
    margin-right: 20px;
    text-align: center;
}

.product-image-container img {
    max-width: 100%;
    height: 250px;
    object-fit: contain;
}

.product-details {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 2fr 1fr; /* Details | Sidebar/Reviews */
    gap: 20px;
}

.product-main-info h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 1.5em;
}

.price-container {
    margin-top: 10px;
    margin-bottom: 10px;
}

.discounted-price {
    font-size: 1.8em;
    color: #b12704; /* Amazon's price color */
    font-weight: bold;
    margin-right: 15px;
}

.original-price {
    text-decoration: line-through;
    color: #888;
    font-size: 0.9em;
}

.availability {
    font-weight: bold;
    color: green;
    margin-bottom: 10px;
}

.features-list {
    list-style: disc;
    margin-left: 20px;
    color: #555;
    font-size: 0.9em;
}

/* Sidebar (Ratings and Shop Button) */
.product-sidebar {
    border-left: 1px solid #eee;
    padding-left: 20px;
}

.rating-info {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.rating-info p {
    margin-bottom: 5px;
}

.star-rating {
    font-size: 1.2em;
    color: var(--primary-color);
}

.shop-button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: bold;
    transition: opacity 0.3s;
}

.shop-button:hover {
    opacity: 0.85;
}

/* Reviews Section (Full width below main info) */
.reviews-section {
    grid-column: 1 / -1; /* Span across both columns */
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.review-item {
    background-color: var(--background-light);
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    border-left: 3px solid #ddd;
    font-size: 0.9em;
}

.review-item p {
    margin: 5px 0;
}

/* --- Responsive Adjustments --- */
@media (max-width: 900px) {
    .product-card {
        flex-direction: column;
        padding: 15px;
    }

    .product-image-container {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }

    .product-details {
        grid-template-columns: 1fr;
    }

    .product-sidebar {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #eee;
        padding-top: 15px;
        margin-top: 15px;
    }
}