/* ==========================================================================
   Tyre Videos - Thumbnail Cards + Video Modal
   Shared by tyre page video section and gallery view
   Supports MP4 portrait videos and YouTube landscape videos
   ========================================================================== */

/* --- Video Section Container --- */
.tyre-videos-section {
    margin: 1rem 0 1.5rem;
}

.tyre-videos-heading {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tyre-videos-heading i {
    color: var(--tyre-reviews-blue);
}

/* --- Scrollable Row --- */
.tyre-videos-row {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.tyre-videos-row::-webkit-scrollbar {
    height: 4px;
}

.tyre-videos-row::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* --- Video Item Wrapper (card + title below) --- */
.tyre-video-item {
    flex: 0 0 auto;
    width: 140px;
}

.tyre-video-item--solo.tyre-video-item--youtube {
    width: 75%;
}

@media (max-width: 768px) {
    .tyre-video-item--solo.tyre-video-item--youtube {
        width: 100%;
    }
}

/* --- Video Thumbnail Card (base — portrait MP4) --- */
.tyre-video-card {
    position: relative;
    width: 100%;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tyre-video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tyre-video-card__thumb {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    display: block;
}

/* YouTube variant — landscape 16:9, matched to portrait card height (249px) */
.tyre-video-item--youtube {
    width: 443px;
}

.tyre-video-card--youtube .tyre-video-card__thumb {
    aspect-ratio: auto;
    width: 443px;
    height: 249px;
}

/* Solo video — centered 75% width with subtle shadow */
.tyre-videos-row--solo {
    justify-content: center;
    overflow-x: visible;
}

.tyre-video-card--solo {
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.tyre-video-card--solo.tyre-video-card--youtube .tyre-video-card__thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

/* Play overlay circle */
.tyre-video-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    pointer-events: none;
    transition: background 0.2s ease;
}

/* Play triangle inside the circle */
.tyre-video-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-35%, -50%);
    z-index: 1;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent #fff;
    pointer-events: none;
}

.tyre-video-card:hover::after {
    background: rgba(13, 177, 231, 0.7);
}

/* Video title below thumbnail */
.tyre-video-card__title {
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    line-height: 1.3;
    color: #555;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Gallery Video Card (larger, within grid) --- */
.gallery-video-card {
    position: relative;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    background: #f8f9fa;
}

.gallery-video-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
}

/* Play overlay for gallery cards */
.gallery-video-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    pointer-events: none;
    transition: background 0.2s ease;
}

.gallery-video-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-35%, -50%);
    z-index: 1;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #fff;
    pointer-events: none;
}

.gallery-video-card:hover::after {
    background: rgba(13, 177, 231, 0.7);
}

/* --- Video Modal Overlay --- */
.video-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
}

.video-modal-overlay.show {
    display: flex;
}

/* --- Video Modal Container --- */
.video-modal {
    position: relative;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.video-modal video {
    width: 100%;
    max-height: 85vh;
    display: block;
}

/* YouTube iframe container */
.video-modal__youtube {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
}

.video-modal__youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Widen modal when showing YouTube (landscape) — class toggled by JS */
.video-modal--youtube {
    max-width: 720px;
}

/* --- Close Button --- */
.video-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.video-modal-close:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* --- Single View Video Container --- */
.single-video-container {
    max-width: 480px;
    margin: 0 auto;
}

.single-video-container video {
    width: 100%;
    border-radius: 8px;
    display: block;
}
