/* Product specification image sizing and mobile slider controls */
.spec-image {
    min-height: clamp(320px, 38vw, 520px);
    display: grid;
    place-items: center;
    padding: clamp(8px, 1.5vw, 20px);
    overflow: hidden;
}

.spec-image img {
    display: block;
    width: min(100%, 720px);
    height: auto;
    max-height: clamp(280px, 34vw, 470px);
    margin-inline: auto;
    object-fit: contain;
    object-position: center;
}

.spec-slider-controls {
    display: none;
}

/* Tablet: keep controls compact and product details immediately visible */
@media (min-width: 769px) and (max-width: 992px) {
    .specification .container,
    .spec-wrapper,
    .spec-content,
    .spec-image,
    .spec-info {
        min-width: 0;
        max-width: 100%;
    }

    .spec-wrapper {
        display: block;
    }

    .spec-menu {
        display: flex;
        gap: 10px;
        width: 100%;
        padding: 2px 2px 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .spec-menu::-webkit-scrollbar {
        display: none;
    }

    .spec-item {
        flex: 0 0 210px;
        min-width: 0;
        min-height: 88px;
        padding: 14px 12px;
        scroll-snap-align: start;
    }

    .spec-content {
        display: grid !important;
        grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
        gap: 22px;
        width: 100%;
        margin-top: 14px;
        padding: 22px;
        overflow: hidden;
        opacity: 1 !important;
        transform: none !important;
    }

    .spec-image {
        min-height: 300px;
        padding: 8px;
    }

    .spec-image img {
        width: min(100%, 520px);
        max-height: 330px;
    }

    .spec-info {
        align-self: center;
    }

    .spec-info table {
        width: 100%;
        table-layout: fixed;
    }

    .spec-info td {
        overflow-wrap: anywhere;
    }

    .spec-info td:first-child {
        width: 40%;
    }
}

@media (max-width: 820px) and (min-width: 769px) {
    .spec-content {
        grid-template-columns: 1fr;
    }

    .spec-image {
        min-height: 260px;
    }

    .spec-image img {
        max-height: 245px;
    }
}

@media (max-width: 768px) {
    .spec-content {
        position: relative;
        touch-action: pan-y;
        will-change: transform, opacity;
    }

    .spec-image {
        min-height: 265px !important;
        padding: 6px 2px;
    }

    .spec-image img {
        width: min(100%, 530px);
        max-width: 100%;
        max-height: 250px !important;
    }

    .spec-slider-controls {
        display: grid;
        grid-template-columns: 42px 1fr 42px;
        align-items: center;
        gap: 12px;
        width: 100%;
        margin-top: 14px;
    }

    .spec-slider-arrow {
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        padding: 0;
        border: 1px solid #dce8f7;
        border-radius: 50%;
        color: var(--primary);
        background: #fff;
        box-shadow: 0 8px 20px rgba(20, 54, 92, .10);
        cursor: pointer;
        transition: transform .2s ease, background .2s ease;
    }

    .spec-slider-arrow:active {
        transform: scale(.92);
        background: #edf5ff;
    }

    .spec-slider-dots {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        min-width: 0;
    }

    .spec-slider-dot {
        width: 8px;
        height: 8px;
        padding: 0;
        border: 0;
        border-radius: 999px;
        background: #c9d8ea;
        cursor: pointer;
        transition: width .25s ease, background .25s ease;
    }

    .spec-slider-dot.active {
        width: 24px;
        background: var(--primary);
    }

    .spec-slider-hint {
        margin: 9px 0 0;
        color: #7a8aa0;
        font-size: 11px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .spec-image {
        min-height: 235px !important;
        padding: 2px;
    }

    .spec-image img {
        max-height: 215px !important;
    }
}
