/* Product page tabs — mobile layout (below 768px) */
@media (max-width: 767px) {

    /* PRE-JS: immediately put titles in one row before JS wrapper is added */
    .product.data.items {
        display: block !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .product.data.items > .item.title {
        display: inline-block !important;
        float: none !important;
        width: auto !important;
        white-space: nowrap;
        vertical-align: middle;
        margin: 0 !important;
    }
    .product.data.items > .item.title > .switch {
        display: inline-block !important;
        border-bottom: 1px solid hsl(0deg 0% 7% / 15%) !important;
        border-top: 0px;
        background: transparent !important;
        font-size: 18px !important;
        line-height: inherit !important;
        height: inherit !important;
        padding: 10px 35px !important;
        border: 0px !important;
    }
    .product.data.items > .item.title.active > .switch,
    .product.data.items > .item.title.active > .switch:focus,
    .product.data.items > .item.title.active > .switch:hover {
        padding-bottom: 10px !important;
        border-bottom: #1C75AE 2px solid !important;
        font-weight: 500 !important;
        background: transparent !important;
    }
    .product.data.items > .item.title a:after {
        display: none !important;
    }
    /* Hide non-active content without !important so JS show/hide still works */
    .product.data.items > .item.content {
        display: none;
    }
    .product.data.items > .item.content.active {
        display: block;
    }

    /* POST-JS: once wrapper exists, move scroll behaviour to it */
    .mobile-tab-titles ~ .item.content,
    .mobile-tab-titles ~ .item.content.active {
        display: revert;
    }
    .product.data.items:has(.mobile-tab-titles) {
        overflow-x: visible;
        white-space: normal;
        border-bottom: 0;
    }

    /* Scrollable single-row title wrapper */
    .mobile-tab-titles {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        border-bottom: 1px solid hsl(0deg 0% 7% / 15%);
    }

    .mobile-tab-titles .item.title {
        display: inline-block !important;
        float: none !important;
        width: auto !important;
        white-space: nowrap;
        vertical-align: middle;
        margin: 0 !important;
		        
    }

    /* Same design as desktop, just smaller font.
       Use 2px border always (transparent when inactive) so all tabs are same height */
    .mobile-tab-titles .item.title .switch {
        display: inline-block !important;
        border-bottom: 1px solid hsl(0deg 0% 7% / 15%) !important;
        border-top: 0px;
        background: transparent !important;
        font-size: 18px !important;
        line-height: inherit !important;
        height: inherit !important;
        padding: 10px 35px !important;
        border: 0px !important;
		color: #6d6d6d;
    }
	 .mobile-tab-titles .item.title.active .switch {
	
	color: #333 !important;
	 }

    .mobile-tab-titles .item.title.active .switch,
    .mobile-tab-titles .item.title.active .switch:focus,
    .mobile-tab-titles .item.title.active .switch:hover,
    .mobile-tab-titles .item.title:not(.disabled) .switch:active {
        padding-bottom: 10px !important;
        border-bottom: #1C75AE 2px solid !important;
        font-weight: 500 !important;
        background: transparent !important;
    }

    /* Remove accordion arrows */
    .mobile-tab-titles .item.title a:after {
        display: none !important;
    }

    /* Content: keep Magento's natural 10px side padding, just override top/border/bg */
    .product.data.items > .item.content {
        white-space: normal;
        background: transparent !important;
        border: 0 !important;
        border-top: 1px solid hsl(0deg 0% 7% / 15%) !important;
        padding-top: 20px !important;
        margin-top: 0 !important;
    }
}

/* Specs tab attributes — 2 per row below 786px */
@media (max-width: 786px) {
    .product.attribute.specs .value {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px 16px;
    }
    .product.attribute.specs .attrbmn {
        width: 100%;
    }
}

/* Below 530px — show visible thin scrollbar under tab titles */
@media (max-width: 530px) {
    .mobile-tab-titles {
        overflow-x: scroll;
    }
    .mobile-tab-titles::-webkit-scrollbar {
        height: 4px;
    }
    .mobile-tab-titles::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    .mobile-tab-titles::-webkit-scrollbar-thumb {
        background: #bbb;
        border-radius: 2px;
    }
}

/* ── Tire sizes grid (product detail Sizes tab) ───────────────────── */
.tire-sizes-header { margin-bottom: 12px; }
.tire-sizes-header p { margin: 2px 0; font-size: 14px; }

.tire-sizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.tire-size-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border: 2px solid #dde5ef;
    border-radius: 8px;
    background: #f7f9fc;
    color: #1a1a2e;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    cursor: pointer;
}

.tire-size-item:hover {
    border-color: #0094FE;
    background: #e8f4ff;
    color: #0070BF;
    text-decoration: none;
}

.tire-size-item.current-size {
    border-color: #0094FE;
    background: #0094FE;
    color: #fff;
    pointer-events: none;
}

span.tire-size-item {
    background: #f0f0f0;
    border-color: #d0d0d0;
    color: #aaa;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

/* Fix brand_features ul starting at different positions across cards */
.tire-card {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    box-sizing: border-box !important;
}
.ch-package .image-box {
    height: 148px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* You May Also Like — slider */
.matched-products { padding: 40px 0; margin-top: 30px; }
.ymal-slider-wrap { position: relative; overflow: hidden; padding: 0 36px; }
.ymal-slider-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
    gap: 16px;
}
.ymal-slider-row::-webkit-scrollbar { display: none; }
.ymal-card {
    flex: 0 0 23% !important;
    width: 23% !important;
    max-width: 23% !important;
    min-width: 0;
    scroll-snap-align: start;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
}
.ymal-slider-prev,
.ymal-slider-next {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    font-size: 24px;
    color: #333;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ymal-slider-prev { left: 0; }
.ymal-slider-next { right: 0; }
.ymal-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}
.ymal-slider-dots button {
    width: 10px; height: 10px;
    border-radius: 50%;
    border: none;
    background: #ccc;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, width 0.2s, border-radius 0.2s;
}
.ymal-slider-dots button.active { background: #0094FE; width: 26px; border-radius: 5px; }
@media (max-width: 991px) {
    .ymal-card { flex: 0 0 46% !important; width: 46% !important; max-width: 46% !important; }
}
@media (max-width: 575px) {
    .ymal-slider-wrap { padding: 0 28px; }
    .ymal-card { flex: 0 0 85% !important; width: 85% !important; max-width: 85% !important; }
}

/* You May Also Like — image box matching Choose Your Package style */
.ymal-image-box {
    background: #F5F5F5;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
    text-align: center;
    height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ymal-image-box img {
    width: 100%;
    max-width: 120px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* You May Also Like — tier badge + price */
.ymal-tier-badge {
    display: inline-block;
    width: fit-content;
    align-self: flex-start;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 2px 7px;
    border-radius: 3px;
    margin-bottom: 8px;
    color: #fff;
    white-space: nowrap;
}
.ymal-tier-1 { background: #6c757d; }
.ymal-tier-2 { background: #0094FE; }
.ymal-tier-3 { background: #28a745; }
.ymal-tier-4 { background: #c8a400; }
.ymal-price {
    font-size: 15px;
    font-weight: 700;
    color: #111;
    margin-top: 6px;
}
.ymal-price span { font-size: 12px; font-weight: 400; color: #777; margin-left: 2px; }

@media (max-width: 480px) {
    .tire-sizes-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }
    .tire-size-item { font-size: 12px; padding: 8px 6px; }
}
