/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .header-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: auto auto;
        gap: 1.2rem;
    }
    
    .header-col:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 2; }
    .header-col:nth-child(2) { grid-column: 2 / 3; grid-row: 1 / 2; }
    .header-col:nth-child(3) { grid-column: 3 / 4; grid-row: 1 / 2; }
    .header-col:nth-child(4) { grid-column: 1 / 2; grid-row: 2 / 3; }
    .header-col:nth-child(5) { grid-column: 2 / 3; grid-row: 2 / 3; }
    .header-col:nth-child(6) { grid-column: 3 / 4; grid-row: 2 / 3; }
    
    .rbs-gallery-container {
        margin-top: 140px;
    }
    
    .rbs-gallery-slider,
    .rbs-slider {
        height: 60vh !important;
        min-height: 400px !important;
    }
    
    .header-text {
        font-size: 1.05rem !important; /* 16.8px en tablet */
        font-weight: 400 !important;    /* Normal weight */
    }
    
    /* Solo "Carlos Lara" mantiene el bold en tablet */
    .header-col:nth-child(1) .header-text {
        font-weight: 700 !important;
    }
    
    .rbs-slider-prev,
    .rbs-slider-next,
    .rbs-gallery-prev,
    .rbs-gallery-next {
        width: 45px !important;
        height: 45px !important;
    }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {
    :root {
        --gutter: 1rem;
    }
    
    body {
        font-size: 17px !important;
    }
    
    .fixed-header {
        padding: 1rem 0.8rem;
        position: relative;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: white;
    }
    
    .header-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, auto);
        gap: 0.8rem;
    }
    
    .header-col {
        grid-column: 1 / 2 !important;
        justify-content: flex-start;
        padding: 0.4rem 0;
    }
    
    .header-col:nth-child(1) { 
        grid-row: 1 / 2; 
        font-size: 1.1rem !important;   /* 17.6px para el nombre en móvil */
        font-weight: 700 !important;     /* Bold solo para el nombre */
    }
    .header-col:nth-child(2) { display: none; }
    .header-col:nth-child(3) { display: none; }
    .header-col:nth-child(4) { 
        grid-row: 2 / 3; 
        font-size: 1rem !important;     /* 16px */
        font-weight: 400 !important;     /* Normal */
    }
    .header-col:nth-child(5) { 
        grid-row: 3 / 4; 
        font-size: 1rem !important;     /* 16px */
        font-weight: 400 !important;     /* Normal */
    }
    .header-col:nth-child(6) { 
        grid-row: 4 / 5; 
        font-size: 1rem !important;     /* 16px */
        font-weight: 400 !important;     /* Normal */
    }
    
    /* Texto general en móvil */
    .header-text {
        font-size: 1rem !important;     /* 16px en móvil */
        font-weight: 400 !important;     /* Normal weight */
        line-height: 1.5 !important;
    }
    
    /* Solo el enlace "Carlos Lara" mantiene bold */
    .name-link {
        font-weight: 700 !important;
    }
    
    .text-right, .text-left {
        text-align: left;
    }
    
    .rbs-gallery-container {
        margin-top: 0;
        padding: 0 10px;
    }
    
    .rbs-gallery-slider,
    .rbs-slider {
        height: 50vh !important;
        min-height: 300px !important;
        border-radius: 4px;
    }
    
    .rbs-slider-prev,
    .rbs-slider-next,
    .rbs-gallery-prev,
    .rbs-gallery-next {
        width: 40px !important;
        height: 40px !important;
    }
    
    .rbs-slider-prev,
    .rbs-gallery-prev {
        left: 10px !important;
    }
    
    .rbs-slider-next,
    .rbs-gallery-next {
        right: 10px !important;
    }
    
    .rbs-slider-dots,
    .rbs-gallery-dots {
        bottom: 15px !important;
        padding: 6px 12px;
    }
    
    .rbs-slider-dot,
    .rbs-gallery-dot {
        width: 8px !important;
        height: 8px !important;
    }
    
    .admin-gallery-notice {
        padding: 12px 15px;
        margin: 15px 10px;
        font-size: 0.95rem !important;
    }
    
    .fallback-slide {
        width: 90vw;
        height: 50vh;
    }
}

/* Mobile Pequeño (≤ 480px) */
@media (max-width: 480px) {
    .header-text {
        font-size: 0.95rem !important;  /* 15.2px en móviles pequeños */
        font-weight: 400 !important;     /* Normal */
    }
    
    .header-col:nth-child(1) {
        font-size: 1.05rem !important;  /* 16.8px para el nombre */
        font-weight: 700 !important;     /* Bold */
    }
    
    .rbs-gallery-slider,
    .rbs-slider {
        height: 40vh !important;
        min-height: 250px !important;
    }
    
    .rbs-slider-prev,
    .rbs-slider-next,
    .rbs-gallery-prev,
    .rbs-gallery-next {
        width: 35px !important;
        height: 35px !important;
    }
    
    .rbs-image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 10px !important;
    }
    
    .rbs-grid-item img {
        height: 150px !important;
    }
    
    .site-footer {
        padding: 1.5rem;
        font-size: 0.85rem !important;
        font-weight: 400 !important;     /* Normal */
    }
}

/* Tablet en orientación horizontal */
@media (max-width: 1024px) and (orientation: landscape) {
    .rbs-gallery-slider,
    .rbs-slider {
        height: 80vh !important;
    }
    
    .fixed-header {
        padding: 0.8rem;
    }
    
    .header-grid {
        gap: 1rem;
    }
}

/* Pantallas grandes (≥ 1440px) */
@media (min-width: 1440px) {
    .header-grid {
        max-width: 1400px;
    }
    
    .rbs-gallery-container {
        max-width: 1600px;
    }
    
    .rbs-gallery-slider,
    .rbs-slider {
        height: 75vh !important;
        min-height: 600px !important;
    }
    
    .header-text {
        font-size: 1.125rem !important; /* Mantener 18px */
        font-weight: 400 !important;     /* Normal */
    }
    
    /* Solo "Carlos Lara" en bold en pantallas grandes */
    .header-col:nth-child(1) .header-text {
        font-weight: 700 !important;
    }
}

/* Ajustes para preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    body {
        opacity: 1 !important;
    }
    
    .rbs-grid-item:hover {
        transform: none !important;
    }
    
    .rbs-slider-prev:hover,
    .rbs-slider-next:hover,
    .rbs-gallery-prev:hover,
    .rbs-gallery-next:hover {
        transform: none !important;
    }
}