/*  Product Details Page + Suppliers Table (view_product.html, view_product_multiple_suppliers.html)*/
.product-details {
    padding: 20px 0 40px;
}

.continue-shop {
    background-color: orange;
    color: #fff;
    padding: 10px 24px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.continue-shop-cart {
    background-color: orange;
    min-width:250px;
    color: #000 !important;
    padding: 10px 20px;
    border-radius: 999px;
    text-align:center;
    justify-content: center;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.continue-shop:hover {
    background-color: rgb(255, 183, 49);
}
.continue-shop-cart:hover {    
    background-color: rgb(255, 183, 49);
}
.continue-cart {
    background-color: var(--accent-color);
    color: #fff;
    padding: 10px 24px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.continue-cart:hover {
    background-color: #3091e6;
}
.back-link {
    margin-bottom: 30px;
}

.back-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 14px;
    transition: color var(--transition-speed);
}

.back-link a:hover {    
    color: var(--text-light);
}

/* Product View Layout - Equal Heights */
.product-view {
     background-image: 
    linear-gradient(#1a1e37, #0170e1); 
    /* linear-gradient(rgba(31, 51, 71, 0.05), rgba(13, 52, 83, 0.1));    */
    background-size: cover;
    background-position: center;
    padding: 2rem;
    border-radius: 1rem; 

}
.product-info-detailed {
    background-color:#ffff; 
    background-size: cover;
    background-position: center;
    flex-grow: 1;
    padding: 2rem; 
    border-radius: 1rem; 
    box-shadow: var(--shadow-small);
    height: 536px; /* Match main-image height */
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    position: relative;

}
.product-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: stretch;
}


/* Product Images Layout */
.product-images {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: flex-start;
    height: 100%;
    overflow: hidden;
    min-width: 0;
}

/* Vertical Thumbnail Gallery */
.thumbnail-gallery.vertical-gallery {
    display: flex;
    flex-direction: column;
    gap: 23px;
    width: 80px;
    flex-shrink: 0;
}

/* Scrollable thumbnail column wrapper (desktop/default) */
.thumbnail-scroll-wrapper {
    width: 100px;
    flex-shrink: 0;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.thumbnail-gallery.vertical-gallery .thumbnail {
    width: 80px;
    height: 80px;
    padding-top: 0;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background-color: var(--bg-white);
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail-gallery.vertical-gallery .thumbnail.active {
    border-color: orange;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.thumbnail-gallery.vertical-gallery .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}
/*
.product-images {
    position: sticky;
    top: 100px;
    height: fit-content;
}
*/
/*
.product-info-detailed {
    position: relative;
    max-height: 550px;
    overflow-y: auto;
    padding-right: 20px;
    padding-bottom: 80px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}
*/
/* Product Info Detailed - Match height */
.product-info-detailed {
    background-color: #ffff;
    background-size: cover;
    background-position: center;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-small);
    height: 500px; /* Match main-image height */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
}
.product-info-detailed::-webkit-scrollbar {
    width: 6px;
}

.product-info-detailed::-webkit-scrollbar-track {
    background: transparent;
}

.product-info-detailed::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.product-info-detailed::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

.product-options {
    display: flex;
    flex-direction: column; /* Changed from flex-wrap to column */
    gap: 20px;
    margin-bottom: 10px;
}

.option-group {
   /* flex: 1;
    min-width: 200px; */
    width: 100%; /* Take full width instead of flex: 1 */
    margin-bottom: 1px;
}

.option-group h3 {
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 500;
}

.color-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px white;
}

.storage-options {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping for storage options */
    gap: 8px;
}

.storage-option {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: var(--bg-white);
}

.storage-option:hover {
    border-color: var(--accent-color);
    background-color: rgba(0, 113, 227, 0.05);
}

.storage-option.active {
    background-color: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.product-actions-detailed {
    /*There are 2 .product-actions-detailed classed defined -just check*/
    /* margin-top: -40px; */
    align-self: self-end;
   
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    padding-top: 5px;
    border-radius: 1rem;
    border: 1px solid transparent;
    display: flex;
    
   /* box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05); /* Optional: adds subtle shadow */
}

.quantity-selector {
    height: 44px;
    border-radius: 22px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.qty-btn {
    width: 44px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-dark);
    transition: background-color 0.3s ease;
}

.qty-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

#product-quantity {
    width: 44px;
    text-align: center;
    border: none;
    font-size: 16px;
    font-weight: 500;
}

.add-to-cart-btn-large {
    flex-grow: 1;
    height: 44px;
    border-radius: 22px;
    font-size: 16px;
    font-weight: 500;
    background-image:linear-gradient(#8ad631, #578d19); 
    border: 0px solid var(--bg-dark-gray);
    color: var(--text-light);
    transition: all 0.3s ease;
}

.add-to-cart-btn-large:hover {
    background-color: #6aaa22;
    background-image:linear-gradient(#8ad631, #73b825); 
    border: 0px solid var(--bg-dark-gray);
}

/* Custom scrollbar styling for WebKit browsers */
.product-info-detailed::-webkit-scrollbar {
    width: 6px;
}

.product-info-detailed::-webkit-scrollbar-track {
    background: transparent;
}

.product-info-detailed::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.product-info-detailed::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}
/*
.product-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
*/
.product-images {
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: flex-start;
    height: 100%; /* Ensure both columns stretch to same height */
    overflow: hidden;
    min-width: 0;
}
/* Main Image Container */
.main-image {
    flex-grow: 1;
    min-width: 0;
    position: relative;
    width: 100%;
    height: 500px;
    background-color: var(--bg-white);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-small);
}

.main-image img.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 30px;
    transition: transform 0.3s ease;
}
/*
.main-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%; 
    background-color: var(--bg-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-small);
    margin-bottom: 20px;
}
*/


/*
.main-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
}
    */

    .thumbnail-gallery {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
        margin-top: 20px;
    }
    
    .thumbnail {
        position: relative;
        width: 100%;
        padding-top: 100%; /* Creates perfect square aspect ratio */
        border-radius: 8px;
        overflow: hidden;
        cursor: pointer;
        background-color: var(--bg-white);
        border: 2px solid transparent;
        transition: all 0.3s ease;
    }
    
    .thumbnail:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    .thumbnail.active {
        border-color: orange;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }
    
    .thumbnail img.product-thumbnail {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain; /* Contains the entire image within the square */
        padding: 8px; /* Adds some padding so the image doesn't touch the edges */
        transition: transform 0.3s ease;
    }

/* Responsive adjustments */
@media (max-width: 992px) {
        .back-link {
    margin-bottom: 30px;
    }

    .back-link a {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: var(--text-light);
        font-size: 14px;
        transition: color var(--transition-speed);
    }

    .back-link a:hover {    
        color: var(--text-light);
    }
    .product-view {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 0;
        padding-left: 5px;
        padding-right: 5px;
    }

    .product-images {
        display: flex;
        flex-direction: column;
        height: auto;
        width: 100%;
        padding-left: 0;
    }

    .thumbnail-scroll-wrapper {
        order: 1;
        width: 100%;
        height: auto;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        margin-right: 0;
        -webkit-overflow-scrolling: touch;
        border: 0px solid #ddd;
        padding: 5px 0;
    }

    .thumbnail-gallery.vertical-gallery {
        flex-direction: row;
        width: max-content;
        height: auto;
        overflow-x: visible;
        gap: 10px;
        padding: 5px 10px;
        margin-bottom: 0;
    }

    .thumbnail-gallery.vertical-gallery .thumbnail {
        width: 70px;
        height: 70px;
        flex-shrink: 0;
    }

    .main-image {
        order: 2;
        height: 400px;
        width: 100%;
        position: relative;
    }

    .main-image img.product-image {
        padding: 20px;
    }

    .product-info-detailed {
        height: auto;
        max-height: none;
        overflow-y: visible;
        position: relative;
    }
}

@media (max-width: 768px) {
            .back-link {
    margin-bottom: 30px;
    }

    .back-link a {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: var(--text-light);
        font-size: 10px;
        transition: color var(--transition-speed);
    }

    .back-link a:hover {    
        color: var(--text-light);
    }
    .product-view {
        display: flex;
        flex-direction: column;

    }
    .main-image {
        height: 350px;
    }

    .product-info-detailed {
        padding: 1.5rem;
    }

    .thumbnail-gallery.vertical-gallery .thumbnail {
        width: 60px;
        height: 60px;
    }

    .thumbnail-scroll-wrapper::-webkit-scrollbar {
        height: 4px;
    }

    .thumbnail-scroll-wrapper::-webkit-scrollbar-track {
        background: transparent;
    }

    .thumbnail-scroll-wrapper::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 3px;
    }

    .product-options {
        gap: 15px;
    }

    .storage-options {
        gap: 6px;
    }

    .storage-option {
        padding: 5px 10px;
        font-size: 12px;
    }
}
@media (max-width: 480px) {
    .product-view {
        display: flex;
        flex-direction: column;

    }
    .main-image {
        height: 280px;
    }

    .main-image img.product-image {
        padding: 15px;
    }

    .thumbnail-gallery.vertical-gallery .thumbnail {
        width: 50px;
        height: 50px;
    }

    .thumbnail-gallery.vertical-gallery .thumbnail img {
        padding: 4px;
    }

    .add-to-cart-btn-large .btn-text {
        display: none;
    }
}
@media (max-width: 400px) {
    .product-view {
        display: flex;
        flex-direction: column;

    }
    .main-image {
        height: 280px;
    }

    .main-image img.product-image {
        padding: 15px;
    }

    .thumbnail-gallery.vertical-gallery .thumbnail {
        width: 40px;
        height: 40px;
    }

    .thumbnail-gallery.vertical-gallery .thumbnail img {
        padding: 4px;
    }

    .add-to-cart-btn-large .btn-text {
        display: none;
    }
}
/* Remove all the conflicting absolute positioning styles from responsive queries */
@media (max-width: 992px) {
    .product-images,
    .main-image,
    .product-info-detailed {
        position: relative !important; /* Force relative positioning */
        display: block !important;
        z-index: auto !important;
    }
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .thumbnail-gallery {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .thumbnail-gallery {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    
    .thumbnail img.product-thumbnail {
        padding: 4px;
    }
}

.thumbnail:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

.thumbnail.active {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--accent-color);
}

.product-info-detailed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-info-detailed h2 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 24px;
    font-weight: 600;
    color: var(--accent-color);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #fd9a16;
}

.product-rating span {
    color: var(--text-gray);
    font-size: 14px;
    margin-left: 5px;
}

.product-description {
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.7;
}

.product-specs h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.product-specs ul {
    list-style: none;
}

.product-specs li {
    margin-bottom: 10px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-specs li::before {
    content: '•';
    color: var(--accent-color);
}

.product-actions-detailed {
    display: flex;
    gap: 15px;
    margin-top: -15px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    overflow: hidden;
    background: var(--bg-white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    max-width: 120px;
}

.qty-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background-color var(--transition-speed);
}

.qty-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

#product-quantity, .cart-quantity {
    width: 40px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 16px;
}

#product-quantity::-webkit-inner-spin-button,
#product-quantity::-webkit-outer-spin-button,
.cart-quantity::-webkit-inner-spin-button,
.cart-quantity::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-to-cart-btn-large {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--lime-accent);
    color: var(--text-light);
    border-radius: 25px;
    padding: 0 30px;
    font-weight: 500;
    letter-spacing: 0.5px;
    height: 40px;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.add-to-cart-btn-large:hover {
    background-color: #6aaa22;
}

.add-to-cart-btn-large .btn-icon {
    margin-left: 5px;
}

.product-extras {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delivery-info, .warranty-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-gray);
}

/* Suppliers Table */
.suppliers-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #000000ab;
    box-shadow: var(--shadow-small);
}

.suppliers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
/* Ensure table body has white background */
.suppliers-table tbody {
    background-color: var(--bg-white);
}

.suppliers-table thead {
    background:linear-gradient(to right,#8ad631,#8ad631); 
    border-bottom: 1px solid rgba(17, 17, 17, 0.418);
    color: var(--text-light);
}

.suppliers-table th {
    padding: 12px;
    text-align: left;
    font-weight: 500;
}

.suppliers-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.suppliers-table tbody tr:last-child {
    border-bottom: none;
}

/* Enhance hover effect slightly for better visibility */
.suppliers-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.09); /* Light grey hover effect */
}

/* Ensure even rows maintain consistent styling */
.suppliers-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.03); /* Very subtle alternating row color */
}

.suppliers-table td {
    padding: 12px;
}

.supplier-add-btn {
    padding: 6px 12px;
    background: linear-gradient(to right, #0170e1,#3844a1);
    color: var(--text-light);
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.supplier-add-btn:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .filter-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-group, .search-group {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .suppliers-table {
        font-size: 13px;
    }
    
    .suppliers-table th, 
    .suppliers-table td {
        padding: 8px;
    }
}

@media (max-width: 640px) {
    /* On very small screens, create a card view instead of a table */
    .suppliers-table thead {
        display: none;
    }
    
    .suppliers-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 12px;
    }
    
    .suppliers-table td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px dashed var(--border-color);
    }
    
    .suppliers-table td:last-child {
        border-bottom: none;
        justify-content: flex-end;
    }
    
    .suppliers-table td:before {
        content: attr(data-label);
        font-weight: 600;
    }
}
