/* =====================================================
   CASA NEGRA – MOBILE COMPLETE OPTIMIZATION
   Network • Store • Docs
   ===================================================== */

/* ===============================
   GLOBAL MOBILE RULES
   =============================== */
@media (max-width: 768px) {

    html {
        font-size: 16px;
        scroll-behavior: smooth;
    }

    body {
        font-size: 1rem;
        line-height: 1.6;
        overflow-x: hidden;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    /* ===============================
       NAVBAR + MENU
       =============================== */
    .navbar {
        min-height: 70px;
        padding: 1rem 0;
        backdrop-filter: blur(12px);
        z-index: 1002;
    }

    .navbar .container {
        padding: 0 1.25rem;
    }

    .logo img {
        height: 40px;
    }

    .menu-toggle {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        background: rgba(59,130,246,.1);
        border: 2px solid rgba(59,130,246,.3);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1003;
        -webkit-tap-highlight-color: transparent;
    }

    .menu-toggle:active {
        transform: scale(.95);
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        transform: translateX(-100%);
        transition: transform .35s ease;
        background: rgba(8,12,30,.98);
        backdrop-filter: blur(20px);
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        z-index: 1001;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li a {
        padding: 1.25rem 1.5rem;
        display: flex;
        justify-content: space-between;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255,255,255,.08);
    }

    .nav-links li a:active {
        background: rgba(59,130,246,.1);
    }

    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    body.menu-open::after {
        content: '';
        position: fixed;
        inset: 70px 0 0 0;
        background: rgba(0,0,0,.5);
        backdrop-filter: blur(4px);
        z-index: 1000;
    }

    /* ===============================
       TYPOGRAPHY
       =============================== */
    h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    h2 {
        font-size: 1.7rem;
    }

    h3 {
        font-size: 1.45rem;
    }

    h4 {
        font-size: 1.25rem;
    }

    p {
        font-size: 1rem;
        line-height: 1.65;
    }

    .hero h1,
    .hero-rp h1,
    .hero-pvp h1,
    .hero-store h1 {
        font-size: 2.3rem;
        letter-spacing: -0.02em;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-top: 1rem;
    }

    /* ===============================
       LAYOUT & SPACING
       =============================== */
    section {
        padding: 3rem 0;
    }

    .container {
        padding: 0 1.25rem;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* ===============================
       CARDS
       =============================== */
    .card,
    .feature-card,
    .server-card,
    .product-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    /* ===============================
       BUTTONS
       =============================== */
    .btn {
        width: 100%;
        min-height: 48px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-radius: 12px;
        touch-action: manipulation;
    }

    .btn:active {
        transform: scale(.97);
    }

    .btn-group {
        flex-direction: column;
        gap: 1rem;
    }

    /* ===============================
       FORMS
       =============================== */
    input,
    textarea,
    select {
        min-height: 48px;
        font-size: 1rem;
        padding: 1rem 1.25rem;
        border-radius: 12px;
        appearance: none;
    }

    input:focus,
    textarea:focus,
    select:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(59,130,246,.25);
    }

    /* ===============================
       STATS
       =============================== */
    .stats-grid,
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 2.2rem;
        font-weight: 700;
    }

    /* ===============================
       PRODUCTS / STORE
       =============================== */
    .products-grid,
    .products-grid-new {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .product-image {
        height: 220px;
        border-radius: 12px;
    }

    .product-title {
        font-size: 1.25rem;
    }

    .price {
        font-size: 1.75rem;
        font-weight: 700;
    }

    /* ===============================
       FOOTER
       =============================== */
    .footer {
        padding: 3rem 0 2rem;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 2.5rem;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-social a {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }
}

/* ===============================
   SMALL DEVICES < 480px
   =============================== */
@media (max-width: 480px) {

    .container {
        padding: 0 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .product-image {
        height: 200px;
    }

    .btn {
        font-size: .95rem;
        padding: .85rem 1.25rem;
    }
}

/* ===============================
   TOUCH & ACCESSIBILITY
   =============================== */
@media (hover: none) and (pointer: coarse) {

    a,
    button,
    .btn {
        min-width: 44px;
        min-height: 44px;
    }

    a:hover,
    .btn:hover {
        transform: none;
    }

    :focus-visible {
        outline: 3px solid rgba(59,130,246,.5);
        outline-offset: 2px;
    }
}

/* ===============================
   PERFORMANCE
   =============================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}


/* =====================================
   MOBILE CART / PANIER FIX
   ===================================== */
@media (max-width: 768px) {

    /* Cart container */
    .cart,
    .cart-sidebar,
    .shopping-cart {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh !important;
        z-index: 1005 !important;
        transform: translateX(100%);
        transition: transform .35s ease;
        border-radius: 0 !important;
    }

    /* Cart open */
    .cart.open,
    .cart.active,
    .shopping-cart.open {
        transform: translateX(0);
    }

    /* Prevent background scroll */
    body.cart-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    /* Overlay */
    body.cart-open::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.6);
        backdrop-filter: blur(4px);
        z-index: 1004;
    }

    /* Close button */
    .cart-close,
    .cart-header button {
        position: sticky;
        top: 0;
        height: 56px;
        font-size: 1.2rem;
        z-index: 1006;
    }
}
