/* General container and section styles */
.container {
    display: flex;
    flex-wrap: wrap;
}
.product-image-section {
    flex: 1;
    padding-right: 20px;
    min-width: 400px;
}
.product-details-section {
    flex: 1;
    padding-left: 20px;
    min-width: 400px;
    display: flex;
    flex-direction: column;
}
.breadcrumbs {
    font-size: 0.9em;
    color: #777;
    margin-bottom: 20px;
    width: 100%;
}
.breadcrumbs a {
    color: #777;
    text-decoration: none;
}
.image-gallery-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 15px;
}
.thumbnail-gallery {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.main-image-container {
    flex: 1;
    max-width: 100%;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    /* New: Set a fixed aspect ratio for the main image container */
    width: 100%;
    padding-top: 100%; /* Creates a square container */
    position: relative;
}
#mainProductImage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Prevents stretching and fits the image */
    display: block;
}
.thumbnail {
    width: 70px;
    height: 70px;
    object-fit: cover; /* Ensures the thumbnail fills its space */
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, border-color 0.2s;
}
.thumbnail.active, .thumbnail:hover {
    opacity: 1;
    border-color: #000;
}
h1 {
    font-size: 2.5em;
    margin: 0 0 10px;
}
.price-info {
    margin-bottom: 20px;
}
.price-info .current-price {
    font-size: 2.2em;
    font-weight: bold;
    color: #333;
}
.price-info .mrp-price {
    text-decoration: line-through;
    color: #888;
    margin-left: 10px;
}
.price-info .discount-percent {
    color: #e53935;
    font-weight: bold;
    margin-left: 10px;
}
.rating {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    color: #555;
}
.rating .stars {
    color: #ffc107;
}
.color-options, .size-options {
    margin-bottom: 20px;
}
.color-swatch {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid #ccc;
    cursor: pointer;
    transition: border-color 0.2s;
}
.color-swatch.active {
    border-color: #000;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}
.size-item {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-right: 10px;
    cursor: pointer;
    background-color: #f9f9f9;
    transition: background-color 0.2s, border-color 0.2s;
}
.size-item.active, .size-item:hover {
    background-color: #e0e0e0;
    border-color: #000;
}
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}
.action-buttons button, .action-buttons a {
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}
.add-to-cart {
    background-color: #f0c14b;
    color: #111;
}
.buy-now {
    background-color: #ff9900;
    color: #111;
}
.customize-now {
    background-color: #4CAF50;
    color: #fff;
}
.add-to-cart:hover, .buy-now:hover, .customize-now:hover {
    opacity: 0.9;
}
.hidden {
    display: none;
}
.description {
    margin-top: 40px;
}
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}
.tag {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* Modal Specific Styles */
.modal-content {
    border-radius: 10px;
    overflow: hidden;
}
.modal-header, .modal-footer {
    border: none;
}

/* Related Products Section */
.related-products {
    margin-top: 50px;
    padding: 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}
.related-products h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2em;
}
.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%; /* Ensure cards are same height in a row */
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.product-card img {
    width: 100%;
    height: 200px; /* Fixed height for image consistency */
    object-fit: cover;
}
.product-card-body {
    padding: 15px;
}
.product-card-title {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
}
.product-card-price {
    font-size: 1.2em;
    color: #333;
    font-weight: bold;
}
.product-card-price .mrp {
    text-decoration: line-through;
    font-size: 0.8em;
    color: #888;
}

/* --- Responsive Styles for Small Screens (e.g., mobile devices) --- */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .product-image-section {
        padding-right: 0;
        min-width: 100%;
    }
    .product-details-section {
        padding-left: 0;
        min-width: 100%;
        padding-bottom: 150px; /* Add space for sticky buttons */
    }
    .image-gallery-container {
        flex-direction: column;
    }
    .thumbnail-gallery {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        order: 2; /* Move thumbnails below the main image */
    }
    .main-image-container {
        order: 1; /* Keep the main image at the top */
    }
    .action-buttons {
        position: fixed;
        bottom: 0;
        width: 100%;
        background-color: #fff;
        padding: 10px 20px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 1000;
        flex-direction: row; /* Display buttons side by side */
        gap: 10px;
        justify-content: space-between;
    }
    .action-buttons button, .action-buttons a {
        flex: 1; /* Make buttons fill the available space */
    }
    .action-buttons .d-flex {
        display: none !important; /* Hide quantity input on sticky bar */
    }
}
