/* Main content padding adjustment */
main.section-padding {
    padding-bottom: 2rem;
}

/* --- Upgraded Product Gallery using Swiper --- */
.product-gallery-main {
    border-radius: 12px;
    margin-bottom: 1rem;
    --swiper-navigation-color: var(--primary-color);
}
.product-gallery-main .swiper-slide {
    background-color: var(--secondary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
}
.product-gallery-main .swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 550px;
    object-fit: contain;
}
.gallery-nav-btn {
    background-color: rgba(255,255,255,0.8);
    border-radius: 50%;
    width: 40px;
    height: 40px;
}
.gallery-nav-btn::after {
    font-size: 1rem;
    font-weight: bold;
}

.product-gallery-thumbs {
    height: 100px;
}
.product-gallery-thumbs .swiper-slide {
    width: 25%;
    height: 100%;
    opacity: 0.6;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: opacity 0.3s, border-color 0.3s;
}
.product-gallery-thumbs .swiper-slide-thumb-active {
    opacity: 1;
    border-color: var(--primary-color);
}
.product-gallery-thumbs .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Corrected Product Details Layout --- */
.product-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}
.product-info-layout {
    display: flex;
    flex-direction: column;
}
.product-description-text {
    order: 1; /* Mobile first: description appears first */
}
.product-purchase-details {
    order: 2;
    margin: 1.5rem 0;
}

/* Desktop two-column layout for product info */
@media (min-width: 992px) {
    .product-info-layout {
        flex-direction: row;
        gap: 2rem;
    }
    .product-description-text {
        flex: 1;
        min-width: 0;
    }
    .product-purchase-details {
        flex-basis: 280px; /* Fixed width for the right column */
        flex-shrink: 0;
        margin: 0;
    }
}

/* Product Specs Table */
.product-specs-table {
    margin-top: 1.5rem; /* Moved below purchase box */
    font-size: 0.9rem;
    background-color: #e6e6e6;
}
.product-specs-table td {
    border-bottom: 1px solid #000;
    padding: 0.75rem;
    background: transparent;
}
.product-specs-table tr td:first-child {
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap; /* Prevents text like "ISBN No." from wrapping */
}
.product-specs-table tr:last-child td {
    border-bottom: none;
}

/* Purchase Box */
.purchase-box {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}
.purchase-box .price-container { margin-bottom: 1rem; }
.purchase-box .current-price { font-size: 2rem; font-weight: 700; color: var(--price-color); margin-right: 1rem; }
.purchase-box .original-price { font-size: 1.2rem; color: var(--text-light); text-decoration: line-through; }
.purchase-box .actions-container { display: flex; gap: 1rem; margin-bottom: 1rem; align-items: center; }

/* ======================= UPDATED QUANTITY SELECTOR STYLES ======================= */
.quantity-selector { 
    display: flex; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    overflow: hidden;
    flex-shrink: 0; /* Prevents it from shrinking */
}
.quantity-selector .btn-quantity { 
    background: var(--white-color); 
    border: none; 
    font-weight: 700;
    font-size: 1.2rem; /* Makes + and - more prominent */
    line-height: 1;
    color: var(--primary-color); 
    padding: 0.5rem 0.75rem; /* Adjusted padding */
}
.quantity-selector .quantity-input { 
    width: 40px; /* Reduced width for a more compact look */
    text-align: center; 
    border: none; 
    border-left: 1px solid var(--border-color); 
    border-right: 1px solid var(--border-color); 
    font-weight: 600;
    background-color: #fff; /* Explicitly set background */
}
.quantity-selector .quantity-input:focus { 
    box-shadow: none; 
}
/* =============================================================================== */

.btn-add-to-cart-main { 
    flex-grow: 1; 
    background-color: var(--primary-color); 
    color: var(--white-color); 
    font-weight: 600; 
    border: none; 
    border-radius: 8px; 
    transition: background-color 0.3s;
    padding: 0.65rem 1.2rem; /* Adjusted padding to align height */
}
.btn-add-to-cart-main:hover { background-color: var(--accent-color); color: var(--white-color); }
.btn-wishlist { display: block; text-align: center; text-decoration: none; font-weight: 600; color: var(--primary-color); font-size: 0.9rem; }

/* Share Options */
.share-options { margin-top: 2rem; display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; color: var(--text-dark); }
.share-options a { color: var(--primary-color); font-size: 1.2rem; transition: color 0.3s; }
.share-options a:hover { color: var(--accent-color); }

/* Related Products Section */
.related-products { padding-top: 4rem; }
.related-nav-btn {
    color: var(--primary-color);
    background-color: #fff;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.related-nav-btn::after { font-size: 1.2rem; font-weight: bold; }
.related-nav-btn.swiper-button-prev { left: -15px; }
.related-nav-btn.swiper-button-next { right: -15px; }

/* Mobile-specific adjustments */
@media (max-width: 991.98px) {
    .product-title { font-size: 1.5rem; }
    .purchase-box .actions-container { flex-direction: column; }
    .related-nav-btn, .gallery-nav-btn { display: none; }
}
