/* Custom Options dropdown */
@media (min-width: 768px) {
    .custom-dropdown {
        width: 200px;
        /* Adjust as needed */
    }
}

@media (min-width: 992px) {
    .custom-dropdown {
        width: 220px;
        /* Adjust as needed */
    }
}

main {
    flex-grow: 1;
}


.cinco-input {
    border: 0 !important;
    border-bottom-right-radius: 0 !important;
    padding-left: 0.2rem !important;
    background-color: #00000000 !important;
    background-image: linear-gradient(0deg, #ccc 2px, transparent 0) !important;
    background-size: 0 2px !important;
    /* Initial background size */
    background-position: 50% 100%, 50% 100% !important;
    background-repeat: no-repeat !important;
    transition: background-size 0.3s ease-in-out !important;
    border-radius: 0rem !important;
    display: inline-block !important;
}

.cinco-input:not([disabled]) {
    background-image: linear-gradient(0deg, #ccc 2px, transparent 0), linear-gradient(0deg, #ccc 1px, transparent 0) !important;
    background-size: 100% 2px !important;
    background-position: 50% 100%, 50% 100% !important;
    background-repeat: no-repeat !important;
}

/* Turn off focus transition when the element is disabled */
.cinco-input:focus,
.cinco-input:focus+.input-group-text {
    box-shadow: none !important;
    outline: 0 !important;
}

.cinco-input:focus:not([disabled]) {
    background-size: 0 2px !important;
}

.custom-dropdown {
    position: relative;
    /* Adjust as needed */
    font-family: Arial, sans-serif;
    /* Your preferred font */
    margin-bottom: 15px;
}


.dropdown-label {
    display: block;
    background-color: #f8f9fa;
    /* Light grey background */
    border-bottom: 1px solid #ced4da;
    /* Grey border */
    padding: 8px 10px;
    padding-right: 2rem;
    border-bottom-right-radius: 0 !important;
    padding-left: 0.2rem !important;
    background-color: #00000000 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e"),
        linear-gradient(0deg, #ccc 2px, transparent 0);
    /* Initial gradient for underline */
    background-size: 0 2px;
    background-position: 50% 100%, 50% 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease-in-out, background-color 0.2s;
    cursor: pointer;
}

.dropdown-label::after {
    content: '';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    /* Center vertically */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    width: 16px;
    /* Width of the icon */
    height: 16px;
    /* Height of the icon */
    transition: transform 0.3s ease;
}

.dropdown-label:focus,
.dropdown-label:focus+.input-group-text {
    box-shadow: none !important;
    outline: 0 !important;
}

.dropdown-label:hover {
    background-color: #e2e6ea;
    /* Slightly darker grey on hover */
}

.dropdown-list {
    display: none;
    position: absolute;
    width: 100%;
    /* Match the width of dropdown label */
    background-color: #fff;
    /* White background */
    border: 1px solid #ced4da;
    /* Grey border */
    border-top: none;
    /* Remove top border to blend with label */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    /* Slight shadow for depth */
    z-index: 1000;
    /* Ensure dropdown appears above other content */
    max-height: 200px;
    /* Limit height of dropdown */
    overflow-y: auto;
    /* Enable scrolling for long lists */
}

.dropdown-item {
    padding: 8px 10px;
    border-bottom: 1px solid #e9ecef;
    /* Slight border for each item */
    color: #495057;
    /* Dark grey text */
    transition: background-color 0.2s;
    /* Smooth background transition */
}

.dropdown-item:last-child {
    border-bottom: none;
    /* No border for the last item */
}

.dropdown-item:hover {
    background-color: #f1f3f5;
    /* Light grey background on hover */
    color: #212529;
    /* Slightly darker text on hover */
}

/* Show the dropdown list */
.dropdown-list.show {
    display: block;
}

.custom-dropdown .focus-group[data-focus='true'] .dropdown-label {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e"),
        linear-gradient(0deg, #264115 2px, transparent 0);
    /* Updated gradient color */
    background-size: 100% 2px;
    /* Expand the underline across the field */
    border-radius: 4px;
}

.custom-dropdown .focus-group[data-focus='true'] .dropdown-label::after {
    /* Rotate the caret icon for the focused state */
    transform: translateY(-50%) rotate(180deg);
}

.custom-dropdown .focus-group:not([data-focus='true']) .dropdown-label {
    /* Styles for non-focused state */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e"),
        linear-gradient(0deg, #264115 2px, transparent 0);
    /* Updated gradient color */
    background-size: 0 2px;
}

/* Compare Button */
@media (max-width: 662px) {
    .compare-button {
        display: none;
    }
}

/* Font CSS */
.text-sm {
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.hidden {
    display: none;
}

.invisible {
    visibility: hidden;
}

/* Compare Off Canvas Styling */


#compareOffcanvas {
    height: 66px !important;
}

#compareOffcanvas .btn {
    vertical-align: middle;
    line-height: normal;
}

#compareOffcanvas .offcanvas-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: #384c2c;
    overflow-y: auto;
}


#compareOffcanvas .d-flex.bg-white {
    padding: 0;
    margin: 0 1%;
    overflow: hidden;
    background-color: transparent !important;
}

#compareOffcanvas .container-fluid>.row {
    justify-content: center;
}


#compareOffcanvas .text-primary,
#compareOffcanvas div {
    font-size: 0.7rem;
}

#compareOffcanvas .col-lg-2 {
    display: flex;
    align-items: center;
    /* vertically center its children */
    justify-content: center;
    /* horizontally center its children */
}

/* Styling for compare containers and items */
.col-lg-10.d-flex {
    display: flex;
    justify-content: space-between;
    /* Distributes the items with equal spacing */
}


.compare-container {
    display: flex;
    background-color: white;
    flex: 0 0 24%;
    max-width: 24%;
    box-sizing: border-box;
    position: relative;
    padding: 0;
    margin: 0;
    max-height: 60px;
    overflow: hidden;
    background-color: transparent;
}

.compare-item {
    background-color: white;
    display: flex;
    align-items: center;
    flex-grow: 0;
    width: 100%;
    padding: 8px 0;
    max-height: 56px;
    /* Set maximum height */
    overflow: hidden;
}

.compare-item>.icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 0;
    height: 100%;
    font-size: 40px;
    width: 100%;
}

.product-info {
    text-align: left;
    margin-left: 8px;
}

.remove-icon {
    position: absolute;
    top: 0;
    right: 0;
    margin-top: 8px;
    margin-right: 8px;
    cursor: pointer;
}

.product-compare {
    overflow-y: auto;
    max-height: 450px;
    overflow: auto;
}

.product-compare table {
    display: table !important;
}

.product-compare table th {
    padding: 0.75rem;
    min-width: 170px;
    font-size: 0.8rem;
}


.category-attributes-overflow {
    flex: none !important;
}

.category-attributes-overflow th {
    min-width: 193.47px !important;
    /* This is the width you mentioned from the first table */
}

.product-compare table td {
    padding: 4px 30px 10px 1px;
    min-width: 230px;
    max-width: 230px;
    vertical-align: top;
    text-align: left;
    font-size: 0.8rem;
}

.compare tr {
    line-height: 12px;
}

.custom-compare-img {
    width: auto;
    height: 120px;
}

.feco-compare-popup-td-size {
    width: 230px;
}

.compare-input-sm {
    width: 75px !important;
    flex: none !important;
}

.scrollable-container {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.scroll-col {
    flex: 0 0 auto;
    min-width: 200px;
    max-width: 300px;
    margin-right: 10px;
    /* Additional styles to prevent wrapping */
    display: inline-block;
    vertical-align: top;
}

/* ========================================
   Product Detail Slider - Prevent FOUC
   ======================================== */

/* Prevent FOUC without breaking tiny-slider measurement.
   IMPORTANT: Do not use display:none on slides; tiny-slider needs to measure them. */
.product#product {
    visibility: hidden;
}

.product#product.tns-slider {
    visibility: visible;
}

/* Container constrains height before slider init */
.product,
#product {
    position: relative;
    max-height: 500px;
    overflow: hidden;
}

/* Once tiny-slider wraps it, remove the constraint */
.tns-outer #product,
.tns-inner #product {
    max-height: none;
    overflow: visible;
}

/* Fixed aspect ratio container for consistent image sizing */
.product .zoom,
#product .zoom {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 500px;
    background-size: contain;
    /* Default zoom.js "resting" position */
    background-position: 50% 0%;
    background-repeat: no-repeat;
    background-color: #fff;
    overflow: hidden;
}

/* Hover zoom behavior (works with `zoom.js` which updates background-position).
   We hide the <img> on hover so the zoomed background-image is what you see. */
#product .zoom {
    cursor: zoom-in;
}

#product .zoom:hover {
    background-size: 200%;
}

/* Product images constrained within container */
.product .product-img,
#product .product-img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#product .product-img {
    transition: opacity 120ms ease-in-out;
}

#product .zoom:hover .product-img {
    opacity: 0;
}

/* ========================================
   Product Thumbnails
   ======================================== */

.thumbnails-img {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
}

.thumbnails-img img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   Related Items - uniform card sizing
   (scoped so global `.card-product` remains theme-controlled)
   Target sizes (approx):
   - md/lg: 240x340 (card box)
   - sm/xs: 160x280 (card box)
   ======================================== */

.card.related-card-product {
    height: 280px;
}

@media (min-width: 768px) {
    .card.related-card-product {
        height: 340px;
    }
}

.card.related-card-product .card-body {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Fixed media area so images can't change card height */
.card.related-card-product .card-product-media {
    width: 100%;
    flex: 0 0 auto;
    height: 140px;
    overflow: hidden;
    /* Keep normal flow here so theme positioning for `.card-product-action` works. */
    display: block;
    /* Encourage a square image area, but cap height so content below fits. */
    aspect-ratio: 1 / 1;
}

@media (min-width: 768px) {
    .card.related-card-product .card-product-media {
        height: 210px;
    }
}

.card.related-card-product .card-product-media>a {
    display: block;
    width: 100%;
    height: 100%;
}

.card.related-card-product .card-product-media img.img-fluid {
    width: 100%;
    height: 100%;
    /* Fill the square area like the slider thumbnails (crop as needed). */
    object-fit: cover;
    /* Remove bottom margin so it doesn't steal vertical space */
    margin-bottom: 0 !important;
}

/* Keep text area from stretching cards unevenly */
.card.related-card-product h2.fs-6 {
    margin-bottom: 0.25rem;
}

/* Ensure the bottom row (type + button) stays inside the card */
.card.related-card-product .d-flex.justify-content-between.align-items-center.mt-3 {
    margin-top: auto !important;
}

/* Related Items: keep quick-view / compare as two square buttons on one row. */
.card.related-card-product .card-product-action {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.card.related-card-product .card-product-action .quick-view-btn,
.card.related-card-product .card-product-action .compare-button {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
