/* Premium MLink Product Detail Stylesheet */

.com-mlink-product-detail {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: #fff;
    padding: 2rem 0 2.5rem;
    box-sizing: border-box;
    font-family: "Sora", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: #0f172a;
}

.com-mlink-product-detail__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.com-mlink-product-detail__frame {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

/* Use Bootstrap columns inside the frame (do not force CSS Grid) */
.com-mlink-product-detail__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.com-mlink-product-detail__back {
    text-decoration: none;
    font-weight: 600;
    color: #0ea5e9;
}

.com-mlink-product-detail__image {
    min-height: 320px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem;
}

/* Premium product gallery styles */
.com-mlink-product-gallery {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.com-mlink-product-gallery__main {
    width: 100%;
    aspect-ratio: 1;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
    padding: 1rem;
    box-sizing: border-box;
}

.com-mlink-product-gallery__main img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.25s ease-in-out;
    display: block;
    cursor: zoom-in;
}

.com-mlink-product-gallery__slider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 420px;
    justify-content: center;
}

.com-mlink-product-gallery__arrow {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.com-mlink-product-gallery__arrow:hover {
    background: #f8fafc;
    color: #2885C7;
    border-color: #2885C7;
    box-shadow: 0 4px 8px rgba(40, 133, 199, 0.1);
}

.com-mlink-product-gallery__thumbnails-container {
    flex-grow: 1;
    overflow-x: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
    padding: 4px 0;
}

.com-mlink-product-gallery__thumbnails-container::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
}

.com-mlink-product-gallery__thumbnails {
    display: flex;
    gap: 0.5rem;
    transition: transform 0.3s ease;
    justify-content: center;
    flex-wrap: wrap;
}

.com-mlink-product-gallery__thumb {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    padding: 3px;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.com-mlink-product-gallery__thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.com-mlink-product-gallery__thumb:hover {
    border-color: #cbd5e1;
}

.com-mlink-product-gallery__thumb.is-active {
    border-color: #2885C7;
    box-shadow: 0 0 0 3px rgba(40, 133, 199, 0.15);
}

.com-mlink-product-detail__info h1 {
    margin: 0 0 0.6rem;
    font-size: 1.6rem;
    color: #0f172a;
}

.com-mlink-product-detail__sku {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 0.6rem;
}

.com-mlink-product-detail__price-box {
    background: #eaf8ff;
    border: 1px solid rgba(14, 165, 233, 0.12);
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: 0.5rem 0 0.9rem;
}

.com-mlink-product-detail__price-label {
    color: #0f172a;
    font-weight: 700;
    margin-right: 0.5rem;
}

.com-mlink-product-detail__price-pill {
    background: #2885C7;
    color: #fff;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
}

.com-mlink-product-detail__price-unit {
    color: #475569;
    font-weight: 600;
    font-size: 0.95rem;
}

.com-mlink-product-detail__meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-top: 1.5rem;
    width: 100%;
}

.com-mlink-product-detail__meta-field {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #0f172a;
    transition: all 0.2s ease;
}

.com-mlink-product-detail__meta-field:hover {
    border-color: #2885C7;
    background: #f1f5f9;
}

.com-mlink-product-detail__desc-box {
    border: 1px solid rgba(226, 246, 255, 0.6);
    background: #fbfdff;
    padding: 0.9rem;
    border-radius: 8px;
    color: #374151;
    line-height: 1.6;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.com-mlink-product-detail__meta {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}

.com-mlink-product-detail__price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0ea5e9;
    margin: 0.75rem 0 1rem;
}

.com-mlink-product-detail__price.is-quote {
    color: #0ea5e9;
    text-transform: none;
    font-size: 1rem;
}

.com-mlink-product-detail__stock {
    display: inline-flex;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

.com-mlink-product-detail__stock.is-out {
    background: rgba(248, 113, 113, 0.18);
    color: #b91c1c;
}

.com-mlink-product-detail__desc {
    margin-top: 1.2rem;
    line-height: 1.7;
    color: #1f2937;
}

@media (max-width: 900px) {
    .com-mlink-product-detail__inner {
        padding: 0 1rem;
    }

    .com-mlink-product-detail__meta-grid {
        grid-template-columns: 1fr;
    }

    .com-mlink-product-detail__frame>.row {
        display: block;
    }
}

/* Mobile Optimizations for Product Details Page */
@media (max-width: 768px) {
    .com-mlink-product-detail {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding: 1rem 0;
    }

    .com-mlink-product-detail__frame {
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
        border: 1px solid #f1f5f9;
    }

    .com-mlink-product-detail__image {
        padding: 1rem 1rem 0 !important;
        min-height: auto !important;
    }

    .com-mlink-product-gallery__thumbnails {
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding: 0 0.5rem;
    }

    .com-mlink-product-gallery__thumb {
        width: 55px;
        height: 55px;
        border-radius: 6px;
    }

    .com-mlink-product-detail__meta-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
        margin-top: 1.25rem !important;
    }

    .com-mlink-product-detail__meta-field {
        padding: 0.6rem 0.8rem !important;
        font-size: 0.88rem !important;
        border-radius: 8px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
    }

    .com-mlink-product-detail__info h1 {
        font-size: 1.3rem !important;
        margin-top: 0.5rem;
    }

    .com-mlink-product-detail__price-box {
        padding: 0.6rem 0.8rem !important;
        font-size: 0.9rem !important;
        gap: 0.5rem !important;
        border-radius: 8px;
    }

    .com-mlink-product-detail__price-pill {
        font-size: 0.9rem !important;
        padding: 0.2rem 0.6rem !important;
    }

    .com-mlink-lightbox__container {
        padding: 0 1rem;
    }

    .com-mlink-lightbox__arrow {
        width: 38px;
        height: 38px;
    }

    .com-mlink-lightbox__arrow.prev {
        left: 0.5rem;
    }

    .com-mlink-lightbox__arrow.next {
        right: 0.5rem;
    }

    .com-mlink-lightbox__close {
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .com-mlink-product-detail__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0 0.5rem;
    }

    .com-mlink-product-detail__header h2 {
        font-size: 1.25rem;
    }
}

/* Lightbox Modal Styles */
.com-mlink-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    padding: 2rem 0;
    box-sizing: border-box;
}

.com-mlink-lightbox.is-open {
    opacity: 1;
    pointer-events: auto;
}

.com-mlink-lightbox__close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 0.5rem;
    outline: none;
    z-index: 20;
}

.com-mlink-lightbox__close:hover {
    color: #2885C7;
    transform: scale(1.1);
}

.com-mlink-lightbox__container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1500px;
    flex-grow: 1;
    position: relative;
    padding: 0 5rem;
    box-sizing: border-box;
    max-height: calc(100vh - 150px);
}

.com-mlink-lightbox__content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-width: 1250px;
}

.com-mlink-lightbox.is-open .com-mlink-lightbox__content {
    transform: scale(1);
}

.com-mlink-lightbox__content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    transition: opacity 0.25s ease-in-out;
}

.com-mlink-lightbox__arrow {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s ease;
    padding: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.com-mlink-lightbox__arrow:hover {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.com-mlink-lightbox__arrow.prev {
    left: 2rem;
}

.com-mlink-lightbox__arrow.next {
    right: 2rem;
}

.com-mlink-lightbox__thumbnails {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    padding: 0 2rem;
}

.com-mlink-lightbox__thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 3px;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.com-mlink-lightbox__thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.com-mlink-lightbox__thumb:hover {
    border-color: rgba(255, 255, 255, 0.7);
}

.com-mlink-lightbox__thumb.is-active {
    border-color: #2885C7;
    box-shadow: 0 0 10px rgba(40, 133, 199, 0.5);
}

.com-mlink-search-form {
    display: block !important;
    width: 100% !important;
    max-width: 850px !important;
    margin: 0 auto !important;
    float: none !important;
    clear: both !important;
}

.com-mlink-search-outer-wrap {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    margin: 0 auto 1.5rem !important;
    clear: both !important;
}

/* Force parent container columns to be full-width block elements, preventing horizontal flex side-by-side bugs across templates */
.sp-column:has(.com-mlink-search-form),
.sp-module:has(.com-mlink-search-form),
.moduletable:has(.com-mlink-search-form),
[class*="col-"]:has(.com-mlink-search-form) {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    display: block !important;
    float: none !important;
    clear: both !important;
}

/* Dynamic FAQ section styles */
.com-mlink-product-faq {
    margin-top: 3rem;
    padding: 0 0.5rem;
}

.com-mlink-product-faq__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.com-mlink-product-faq__item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 0.6rem;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.com-mlink-product-faq__item:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.com-mlink-product-faq__item[open] {
    border-color: #0ea5e9;
}

.com-mlink-product-faq__item summary {
    padding: 0.9rem 1.1rem;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.98rem;
}

.com-mlink-product-faq__item summary::-webkit-details-marker {
    display: none;
}

.com-mlink-product-faq__item summary::before {
    content: "+";
    font-weight: 700;
    font-size: 1.2rem;
    color: #0ea5e9;
    flex-shrink: 0;
    width: 1.4rem;
    text-align: center;
    transition: transform 0.2s;
}

.com-mlink-product-faq__item[open] summary::before {
    content: "−";
}

.com-mlink-product-faq__answer {
    padding: 0 1.1rem 1rem 2.7rem;
    color: #374151;
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Related Products Styling */
.com-mlink-related-products {
    margin-top: 3rem;
    padding: 0 0.5rem;
}

.com-mlink-related-products__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

/* Card Grid Layout */
.mlink-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.mlink-product-card {
    border: 1px solid #e3e6ea;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.mlink-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

@keyframes mlinkPulseDetail {
    0% { background-color: #f8fafc; }
    50% { background-color: #f1f5f9; }
    100% { background-color: #f8fafc; }
}

.mlink-product-card__image {
    aspect-ratio: 1 / 1;
    background-color: #f8fafc;
    animation: mlinkPulseDetail 1.5s infinite ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #f1f5f9;
    padding: 0.5rem;
    position: relative;
}

.mlink-product-card__image.is-loaded {
    animation: none;
    background-color: #ffffff;
}

.mlink-product-card__image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.mlink-product-card__image img.is-loaded {
    opacity: 1;
}

.mlink-product-card__body {
    padding: 1rem 1.1rem 1.2rem;
    flex: 1;
    display: grid;
    grid-template-rows: minmax(2.8rem, auto) minmax(1.25rem, auto) minmax(2.5rem, auto) minmax(1.35rem, auto) minmax(1.7rem, auto);
    gap: 0.35rem;
    align-content: start;
}

.mlink-product-card__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
    color: #1a1a2e;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7rem;
}

.mlink-product-card__sku {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.35;
    color: #0d6efd;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 1.25rem;
}

.mlink-product-card__meta {
    font-size: 0.82rem;
    color: #495057;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5rem;
}

.mlink-product-card__price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0d6efd;
    margin-top: auto;
    min-height: 1.7rem;
}

.mlink-product-card__price.is-quote {
    color: #0ea5e9;
    text-transform: none;
    font-size: 1rem;
}

.mlink-stock {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    min-height: 1.35rem;
    width: fit-content;
}

.mlink-stock--in {
    background: #d1e7dd;
    color: #0f5132;
}

.mlink-stock--out {
    background: #f8d7da;
    color: #842029;
}

.mlink-product-card__link {
    color: inherit;
    text-decoration: none;
    display: block;
}

.mlink-product-card__link:hover {
    color: inherit;
}

@media (max-width: 1200px) {
    .mlink-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
        gap: 1rem !important;
    }
}

@media (max-width: 576px) {
    .mlink-product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        margin: 1rem 0 !important;
    }
    .mlink-product-card {
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }
    .mlink-product-card__image {
        aspect-ratio: 1 / 1;
        padding: 0.25rem;
    }
    .mlink-product-card__body {
        padding: 0.6rem 0.6rem 0.8rem;
        grid-template-rows: minmax(2.4rem, auto) minmax(1.1rem, auto) minmax(2rem, auto) minmax(1.2rem, auto) minmax(1.5rem, auto);
        gap: 0.2rem;
    }
    .mlink-product-card__title {
        font-size: 0.88rem;
        min-height: 2.4rem;
        line-height: 1.3;
    }
    .mlink-product-card__sku {
        font-size: 0.72rem;
        min-height: 1.1rem;
    }
    .mlink-product-card__meta {
        font-size: 0.72rem;
        min-height: 2rem;
        line-height: 1.3;
    }
    .mlink-stock {
        font-size: 0.68rem;
        padding: 0.1rem 0.4rem;
        min-height: 1.2rem;
    }
    .mlink-product-card__price {
        font-size: 0.95rem;
        min-height: 1.5rem;
    }
    .mlink-product-card__price.is-quote {
        font-size: 0.82rem;
    }
}

@media (max-width: 360px) {
    .mlink-product-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Related Products Horizontal Slider */
.com-mlink-related-products__slider-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}
.com-mlink-related-products__slider-wrap {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    width: 100%;
    padding: 15px 5px;
}
.com-mlink-related-products__slider-wrap::-webkit-scrollbar {
    display: none;
}
.com-mlink-related-products__slider-wrap .mlink-product-grid {
    display: flex !important;
    gap: 1.5rem;
    margin: 0 !important;
    width: max-content;
    padding: 0.2rem;
}
.com-mlink-related-products__slider-wrap .mlink-product-card {
    width: 280px;
    flex-shrink: 0;
}
.com-mlink-related-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s ease;
    padding: 0;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.com-mlink-related-slider__arrow:hover {
    background: #f8fafc;
    color: #2885C7;
    border-color: #2885C7;
    box-shadow: 0 6px 16px rgba(40, 133, 199, 0.15);
    transform: translateY(-50%) scale(1.05);
}
.com-mlink-related-slider__arrow.prev {
    left: -22px;
}
.com-mlink-related-slider__arrow.next {
    right: -22px;
}
.com-mlink-related-slider__arrow.is-hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}
@media (max-width: 768px) {
    .com-mlink-related-products__slider-container {
        padding: 0 1rem;
    }
    .com-mlink-related-products__slider-wrap .mlink-product-card {
        width: 220px;
    }
    .com-mlink-related-slider__arrow {
        width: 36px;
        height: 36px;
    }
    .com-mlink-related-slider__arrow.prev {
        left: 0px;
    }
    .com-mlink-related-slider__arrow.next {
        right: 0px;
    }
}
@media (max-width: 576px) {
    .com-mlink-related-products__slider-wrap .mlink-product-grid {
        gap: 0.75rem;
    }
    .com-mlink-related-products__slider-wrap .mlink-product-card {
        width: 180px;
    }
}