/* ==========================================================================
   RECKLESS STORE — RESPONSIVE
   ========================================================================== */

/* Large laptops */
@media (max-width: 1200px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--rt-space-8);
    }

    .admin-layout {
        grid-template-columns: 220px 1fr;
    }
}

/* Tablets landscape */
@media (max-width: 1024px) {
    :root {
        --rt-space-24: 4.5rem;
    }

    .nav-menu {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-actions .btn-login-desktop {
        display: none;
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps-grid,
    .discord-grid {
        grid-template-columns: 1fr;
        max-width: 520px;
        margin-inline: auto;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        border-inline-end: none;
        border-bottom: 1px solid var(--rt-border);
        padding: var(--rt-space-4);
        gap: var(--rt-space-1);
    }

    .admin-sidebar-label {
        width: 100%;
        padding-bottom: var(--rt-space-1);
    }

    .admin-link {
        flex: 1 1 auto;
        justify-content: center;
        min-width: 130px;
    }

    .admin-content {
        padding: var(--rt-space-6);
    }
}

/* Tablets portrait */
@media (max-width: 820px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
    }

    /* تابلت: النافبار صفين (124px) — الهيرو الفول-بليد يعوض فوق */
    .page-home .hero {
        min-height: 100vh;
        padding-top: calc(124px + var(--rt-space-8));
    }

    .hero-actions .btn {
        width: 100%;
    }

    .profile-head {
        flex-direction: column;
        text-align: center;
        padding: var(--rt-space-6);
    }

    .profile-badges {
        justify-content: center;
    }

    .rules-toolbar,
    .catalog-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--rt-space-8);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Mobile */
@media (max-width: 640px) {
    :root {
        --rt-nav-height: 64px;
        --rt-space-24: 3.5rem;
        --rt-space-16: 3rem;
    }

    .container {
        padding-inline: var(--rt-space-4);
    }

    .section {
        padding-block: var(--rt-space-16);
    }

    .nav-brand-tag {
        display: none;
    }

    .product-grid,
    .sector-grid,
    .app-grid {
        grid-template-columns: 1fr;
    }

    .stat-cards,
    .admin-stats {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-block: var(--rt-space-16) var(--rt-space-20);
    }

    /* هيرو الرئيسية فول-بليد: تعويض ارتفاع النافبار (صفين) فوق */
    .page-home .hero {
        min-height: 100vh;
        padding-top: calc(124px + var(--rt-space-8));
    }

    /* على الموبايل يرجع في النص عشان المساحة ضيقة */
    .hero-content {
        text-align: center;
        align-items: center;
        margin-inline: auto;
        max-width: 100%;
    }

    .hero-content::before {
        display: none;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-logo {
        width: 76px;
        height: 76px;
        font-size: 1.6rem;
    }

    .hero-scroll {
        display: none;
    }

    .modal {
        max-height: 92vh;
        border-radius: var(--rt-radius-md) var(--rt-radius-md) 0 0;
    }

    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .toast-container {
        inset-inline: 0.75rem;
        top: auto;
        bottom: 0.75rem;
        max-width: none;
    }

    .toast {
        transform: translateY(140%);
    }

    .toast.is-visible {
        transform: translateY(0);
    }

    .admin-link {
        min-width: 0;
        flex: 1 1 45%;
        font-size: var(--rt-fs-xs);
        padding: var(--rt-space-3) var(--rt-space-2);
        justify-content: center;
    }

    .admin-link .icon {
        width: 16px;
        height: 16px;
    }

    .admin-content {
        padding: var(--rt-space-4);
    }

    .auth-card {
        padding: var(--rt-space-8) var(--rt-space-5);
    }

    .table th,
    .table td {
        padding: var(--rt-space-3);
        font-size: var(--rt-fs-xs);
    }

    .page-hero {
        padding-block: var(--rt-space-12) var(--rt-space-8);
    }

    /* منع زوم الآيفون التلقائي عند التركيز في الحقول */
    .form-input,
    .form-select,
    .form-textarea {
        font-size: 16px;
    }

    /* نصوص طويلة بلا مسافات (أرقام طلبات/روابط) ما تكسرش العرض */
    .badge {
        overflow-wrap: anywhere;
    }

    /* قائمة البروفايل ما تطلعش بره الشاشات الصغيرة */
    .user-dropdown {
        width: min(264px, calc(100vw - 24px));
    }

    /* جداول الأدمن: تمرير أفقي بدل ضغط الأعمدة */
    .table {
        min-width: 560px;
    }

    /* رؤوس صفحات الأدمن فوق بعض بدل الزنقة */
    .admin-page-head {
        flex-direction: column;
        align-items: stretch;
    }

    /* شاشة البان أريح على الموبايل */
    .ban-card {
        padding: var(--rt-space-8) var(--rt-space-5);
    }
}

/* Small mobile */
@media (max-width: 380px) {
    .btn {
        padding-inline: var(--rt-space-3);
    }

    .hero-actions {
        max-width: 100%;
    }

    .dropdown-stats {
        flex-direction: column;
    }

    .dropdown-stat + .dropdown-stat {
        border-inline-start: none;
        border-top: 1px solid var(--rt-border);
    }
}

/* Hover-capable devices only */
@media (hover: none) {
    .card:hover,
    .step-card:hover,
    .discord-card:hover,
    .app-card:hover {
        transform: none;
    }
}
