/* cars.html — توسيط عمودي موحّد (RTL لا يزيح margin: auto أحيانًا على الجوال) */
html:has(.page-cars) {
    overflow-x: hidden;
    width: 100%;
}

.page-cars {
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.page-cars main {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: clip;
}

/* حاوية واحدة: هوامش فيزيائية متساوية + توسيط صريح */
.page-cars .container {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 1200px;
    padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
    position: relative;
}

@media (max-width: 768px) {
    .page-cars .container {
        max-width: 100%;
    }
}

.header-logo-link {
    display: inline-block;
    text-decoration: none;
    line-height: 0;
}

.header-logo-link:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
    border-radius: 0.5rem;
}

.cars-intro,
.tamer-banner,
.platforms-showcase,
.cars-catalog {
    background-color: var(--sayer-page-bg, #f0f8ff);
}

.page-all-cars .cars-catalog--all {
    padding-top: clamp(1.5rem, 4vw, 2.5rem);
}

.cars-intro {
    padding: 2.25rem 0 1.25rem;
    text-align: center;
}

.cars-intro__layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.cars-intro__copy {
    min-width: 0;
    width: 100%;
    max-width: 42rem;
    text-align: center;
}

.cars-intro__title {
    font-size: clamp(1.65rem, 4.5vw, 2.65rem);
    font-weight: 700;
    line-height: 1.35;
    color: var(--navy-blue, #1a1a2e);
    max-width: 20em;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(14px);
    animation: cars-intro-title-in 0.65s ease 0.32s forwards;
}

@keyframes cars-intro-title-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cars-intro__subtitle {
    margin-top: 0.9rem;
    margin-inline: auto;
    max-width: 36em;
    font-size: clamp(0.8125rem, 2.4vw, 0.9375rem);
    font-weight: 400;
    line-height: 1.5;
    color: #8b95a5;
    opacity: 0;
    transform: translateY(10px);
    animation: cars-intro-subtitle-in 0.6s ease 0.5s forwards;
}

@keyframes cars-intro-subtitle-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cars-intro__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 0.65rem;
    width: 100%;
    max-width: 18rem;
    margin-inline: auto;
    margin-top: 1.35rem;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(10px);
    animation: cars-intro-subtitle-in 0.6s ease 0.72s forwards;
}

@media (max-width: 380px) {
    .cars-intro__actions {
        grid-template-columns: 1fr;
        max-width: 15rem;
    }
}

.cars-intro__divider {
    width: 100%;
    max-width: min(22rem, 92vw);
    height: 1px;
    margin: 0.65rem auto 1.1rem;
    border: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(17, 45, 78, 0.07) 20%,
        rgba(17, 45, 78, 0.1) 50%,
        rgba(17, 45, 78, 0.07) 80%,
        transparent 100%
    );
    opacity: 0;
    transform: translateY(6px);
    animation: cars-intro-subtitle-in 0.55s ease 0.82s forwards;
}

.cars-intro__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border-radius: 2rem;
    font-family: 'TheYearofHandicrafts', sans-serif;
    font-size: clamp(0.875rem, 2.2vw, 1rem);
    font-weight: 400;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cars-intro__btn--primary {
    background: var(--primary-color);
    color: #fff;
    border: none;
    box-shadow: 0 4px 24px 0 rgba(59, 130, 246, 0.15);
}

.cars-intro__btn--primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px 0 rgba(59, 130, 246, 0.18);
}

.cars-intro__btn--primary:active {
    transform: scale(0.98);
}

.cars-intro__btn--secondary {
    background: #ffffff;
    color: var(--navy-blue, #1a1a2e);
    border: 1px solid rgba(17, 45, 78, 0.14);
    box-shadow: 0 1px 2px rgba(17, 45, 78, 0.06);
}

.cars-intro__btn--secondary:hover {
    background: #fafbfc;
    border-color: rgba(17, 45, 78, 0.22);
}

.cars-intro__btn--secondary:active {
    transform: scale(0.98);
}

.cars-intro__tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.65rem;
    margin: 0 0 1.15rem;
    padding: 0;
    list-style: none;
}

.cars-intro__tag {
    margin: 0;
    padding: 0.4rem 0.85rem;
    font-size: clamp(0.75rem, 2vw, 0.8125rem);
    font-weight: 400;
    line-height: 1.4;
    color: #8b95a5;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(17, 45, 78, 0.08);
    border-radius: 999px;
    opacity: 0;
    transform: translateY(8px);
    animation: cars-intro-tag-in 0.55s ease forwards;
}

.cars-intro__tag--with-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(76, 175, 122, 0.16);
    border-color: rgba(76, 175, 122, 0.28);
    color: #6b9e7e;
}

.cars-intro__tag-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: #4caf7a;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(76, 175, 122, 0.2);
}

.cars-intro__tag:nth-child(1) {
    animation-delay: 0s;
}

.cars-intro__tag:nth-child(2) {
    animation-delay: 0.08s;
}

.cars-intro__tag:nth-child(3) {
    animation-delay: 0.16s;
}

@keyframes cars-intro-tag-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 721px) {
    .cars-intro {
        padding: 2.75rem 0 1.35rem;
    }

    .cars-intro__divider {
        margin: 0.75rem auto 1.35rem;
    }
}

/* ——— شريط شعارات المنصات ——— */

.platforms-showcase {
    padding: 0.15rem 0 2.25rem;
}

.platforms-showcase__title {
    font-size: clamp(0.8125rem, 2.1vw, 0.9375rem);
    font-weight: 600;
    line-height: 1.55;
    color: #6b7685;
    letter-spacing: 0.02em;
    text-align: center;
    margin: 0 auto 0.5rem;
    max-width: 36em;
    opacity: 0;
    transform: translateY(8px);
    animation: cars-intro-subtitle-in 0.55s ease 0.88s forwards;
}

.page-cars .platforms-showcase__viewport {
    padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
}

.platforms-showcase__viewport {
    position: relative;
    display: flex;
    justify-content: center;
    overflow-x: visible;
    overflow-y: visible;
    margin: 0;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    direction: ltr;
    unicode-bidi: isolate;
    /* Reserve two logo rows so content below does not jump when logos paint */
    min-height: calc(3.35rem * 2 + 0.85rem + 0.7rem);
}

.platforms-showcase__track {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 0.85rem;
    padding-inline: 1.25rem;
    margin-inline: auto;
    opacity: 0;
    transform: translateY(10px);
}

.platforms-showcase.is-ready .platforms-showcase__track {
    animation: platforms-showcase-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes platforms-showcase-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.platforms-showcase__row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    gap: 0.75rem 1.75rem;
}

.platforms-showcase__logo-wrap {
    flex-shrink: 0;
    width: 6rem;
    height: 3.35rem;
    padding: 0.4rem;
    box-sizing: border-box;
    background: transparent;
    border: none;
    line-height: 0;
}

.platforms-showcase__logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.platforms-showcase.is-ready .platforms-showcase__logo.is-loaded {
    opacity: 1;
}

.platforms-showcase.is-ready .platforms-showcase__fallback-name {
    animation: platforms-showcase-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
}

@media (max-width: 768px) {
    .platforms-showcase__viewport {
        min-height: calc(2.35rem * 2 + 0.65rem + 0.7rem);
    }

    .platforms-showcase__track {
        gap: 0.65rem;
        padding-inline: 0.75rem;
    }

    .platforms-showcase__row {
        gap: 0.55rem 1rem;
    }

    .platforms-showcase__logo-wrap {
        width: 4.25rem;
        height: 2.35rem;
        padding: 0.25rem;
    }
}

@media (max-width: 380px) {
    .platforms-showcase__viewport {
        min-height: calc(2rem * 2 + 0.5rem + 0.7rem);
    }

    .platforms-showcase__track {
        gap: 0.5rem;
        padding-inline: 0.5rem;
    }

    .platforms-showcase__row {
        gap: 0.45rem 0.75rem;
    }

    .platforms-showcase__logo-wrap {
        width: 3.5rem;
        height: 2rem;
        padding: 0.2rem;
    }
}

.platforms-showcase--empty .platforms-showcase__viewport {
    display: none;
    min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
    .platforms-showcase__title,
    .platforms-showcase__track,
    .platforms-showcase__fallback-name {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .platforms-showcase__logo {
        opacity: 1 !important;
        transition: none !important;
    }
}

.platforms-showcase__logo-link {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    text-decoration: none;
    color: inherit;
    outline-offset: 2px;
    width: 100%;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
}

.platforms-showcase__logo-link:focus-visible {
    outline: 2px solid var(--accent-color, #4a63f6);
    border-radius: 0.35rem;
}

.platforms-showcase__fallback-name {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: clamp(0.65rem, 1.8vw, 0.75rem);
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    color: #5c6b7a;
    padding: 0.15rem;
    box-sizing: border-box;
}

/* ——— صفحة المعرض ——— */

.showroom-page {
    padding: 2.25rem 0 3rem;
    min-height: 50vh;
}

.showroom-page__card {
    max-width: 36rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(74, 99, 246, 0.12);
    box-shadow: 0 4px 24px rgba(28, 36, 48, 0.06);
    text-align: center;
}

.showroom-page__title {
    font-size: clamp(1.35rem, 3.5vw, 1.65rem);
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #1c2430;
}

.showroom-page__sub {
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    margin: 0 0 0.75rem;
    word-break: break-word;
}

.showroom-page__link {
    color: #4a63f6;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.showroom-page__stats {
    font-size: clamp(0.88rem, 2vw, 0.98rem);
    color: #5c6b7a;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

.showroom-page__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.35rem;
    border-radius: 0.65rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    background: linear-gradient(135deg, #4a63f6, #6366f1);
    color: #fff;
    border: none;
    cursor: pointer;
}

.showroom-page__cta:focus-visible {
    outline: 2px solid #1c2430;
    outline-offset: 3px;
}

.showroom-page__err {
    text-align: center;
    color: #b45309;
    margin: 2rem 0;
}

