/* ==========================================================================
   MOBILE & COMPACT VIEWPORT OPTIMIZATIONS (Under 700px Wide OR Under 608px Tall)
   ========================================================================== */
@media (max-width: 700px), (max-height: 608px) {
    body {
        background-image: url('../../Images/222.webp') !important;
    }

    /* --- Clean & Minimal Header --- */
    header {
        padding: 10px 12px;
    }

    .logo img {
        height: 40px;
        width: auto;
    }

    header .sticky-title {
        font-size: 1rem;
        margin-left: 10px;
    }

    /* --- Toggle Button Text Swap --- */
    .text-desktop {
        display: none !important;
    }

    .text-mobile {
        display: inline !important;
    }

    /* --- Hero Section Fixes --- */
    .hero {
        height: 70vh;
        padding: 20px 10px;
    }

    .hero h1 {
        font-size: 28px;
        line-height: 1.2;
    }

    .hero p {
        font-size: 26px;
        margin: 15px 0;
    }

    /* --- General Section Spacing --- */
    section {
        padding: 40px 15px;
    }

    h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    /* --- YouTube Video Trailer Aspect Ratio Fix --- */
    .about iframe {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9;
    }

    .second-text {
        font-size: 26px;
        margin: 20px 0;
    }

    /* ==========================================================================
       PRODUCT GALLERY & CARDS (.product-gallery & .product)
       For versions.html (Cards stacked perfectly on top of each other)
       ========================================================================== */
    #products {
        padding: 2rem 12px;
    }

    .product-gallery {
        display: flex;
        flex-direction: column; /* Forces updates to pile directly on top of each other */
        gap: 20px; /* Tight, clean spacing between the blocks */
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 0;
    }

    .product-anchor-container {
        width: 100%;
    }

    .product-anchor {
        top: -80px; /* Adjust smooth-scroll target position for sticky header */
    }

    .product {
        width: 100% !important; /* Forces full width of content column */
        max-width: 100%;
        padding: 15px; /* Compact padding */
        background: rgba(28, 28, 28, 0.95);
        border: 1px solid #444;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
        display: block; /* Normal layout flow */
        height: auto;
    }

    /* Keep the product header in line or stacked neatly */
    .product-header {
        display: flex;
        flex-direction: row; /* Horizontal icon next to text is cleaner in stacked cards */
        align-items: center;
        gap: 15px;
        padding-bottom: 10px;
        margin-bottom: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: left;
    }

    .product img {
        width: 60px; /* Shrunk image size to save precious screen vertical space */
        height: 60px;
        min-width: 60px;
        border-radius: 4px;
        object-fit: cover;
    }

    .product h3 {
        font-size: 16px; /* Tight, highly legible font size for version title */
        line-height: 1.2;
        margin: 0;
        word-break: break-word;
    }

    /* Shrink the update descriptions body text */
    .product-body p {
        font-size: 18px; /* High legibility but tightly packed */
        line-height: 1.35;
        margin: 0 0 12px 0;
    }

    /* Footer area of version log */
    .product-footer {
        display: flex;
        flex-direction: row; /* Aligns date and action button horizontally */
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding-top: 10px;
        margin-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        text-align: left;
    }

    .product h6 {
        font-size: 10px; /* Micro dates */
        margin: 0;
    }

    /* Universal Buttons on Mobile */
    .button {
        font-size: 16px;
        padding: 8px 16px;
        width: auto; /* Buttons only take up space they need within the row card */
        display: inline-block;
        text-align: center;
    }

    /* --- Info Boxes / About Text Wrapper --- */
    .about {
        padding: 18px;
        font-size: 22px;
        margin: 10px auto;
        max-width: 100%;
    }

    /* --- Modals --- */
    .modal-content {
        width: 92%;
        padding: 25px 15px;
        margin: 15% auto;
    }

    .modal-content h2 {
        font-size: 16px !important;
    }

    .platforms-container {
        gap: 15px;
        margin-top: 15px;
    }

    .platform-title {
        font-size: 12px;
    }

    .store-btn {
        height: 42px;
    }

    .divider {
        margin: 20px 0;
    }

    footer {
        padding: 20px;
        font-size: 9px;
    }
}