/**
 * RESPONSIVE UTILITIES - 🌸Sakura Club py 🌸Sakura Club py
 * Clases helper y media queries reutilizables para todas las páginas
 * Autor: GitHub Copilot
 * Fecha: 30 Enero 2026
 */

/* ==================== BREAKPOINTS ==================== */
/* Mobile: 0-576px */
/* Tablet: 577-768px */
/* Desktop: 769-1024px */
/* Large Desktop: 1025px+ */

/* ==================== VISIBILITY UTILITIES ==================== */

/* Mostrar solo en móvil */
.mobile-only {
    display: block !important;
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

/* Mostrar solo en tablet y superior */
.tablet-up {
    display: none !important;
}

@media (min-width: 577px) {
    .tablet-up {
        display: block !important;
    }
}

/* Mostrar solo en desktop y superior */
.desktop-only {
    display: none !important;
}

@media (min-width: 769px) {
    .desktop-only {
        display: block !important;
    }
}

/* Ocultar en móvil */
.hide-mobile {
    display: block !important;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Ocultar en desktop */
.hide-desktop {
    display: block !important;
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ==================== RESPONSIVE CONTAINERS ==================== */

.container-responsive {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container-responsive {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container-responsive {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container-responsive {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container-responsive {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container-responsive {
        max-width: 1320px;
    }
}

/* ==================== RESPONSIVE GRID ==================== */

.grid-responsive {
    display: grid;
    gap: 1rem;
}

/* Mobile: 1 columna */
@media (max-width: 576px) {
    .grid-responsive {
        grid-template-columns: 1fr;
    }
}

/* Tablet: 2 columnas */
@media (min-width: 577px) and (max-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 columnas */
@media (min-width: 1025px) {
    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop grande: 4 columnas */
@media (min-width: 1400px) {
    .grid-responsive.grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ==================== RESPONSIVE SPACING ==================== */

@media (max-width: 768px) {
    .p-responsive {
        padding: 15px !important;
    }

    .py-responsive {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .px-responsive {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .m-responsive {
        margin: 15px !important;
    }

    .my-responsive {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }

    .mx-responsive {
        margin-left: 15px !important;
        margin-right: 15px !important;
    }
}

/* ==================== RESPONSIVE TEXT ==================== */

.text-responsive {
    font-size: 16px;
}

@media (max-width: 576px) {
    .text-responsive {
        font-size: 14px;
    }

    .h1-responsive {
        font-size: 1.75rem !important;
    }

    .h2-responsive {
        font-size: 1.5rem !important;
    }

    .h3-responsive {
        font-size: 1.25rem !important;
    }

    .h4-responsive {
        font-size: 1.1rem !important;
    }

    .h5-responsive {
        font-size: 1rem !important;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .h1-responsive {
        font-size: 2rem !important;
    }

    .h2-responsive {
        font-size: 1.75rem !important;
    }
}

/* ==================== RESPONSIVE BUTTONS ==================== */

@media (max-width: 768px) {
    .btn-responsive {
        min-height: 44px !important;
        padding: 0.7rem 1.2rem !important;
        font-size: 0.9rem !important;
    }

    .btn-responsive.btn-sm {
        min-height: 38px !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
    }

    .btn-responsive.btn-lg {
        min-height: 50px !important;
        padding: 0.9rem 1.5rem !important;
        font-size: 1rem !important;
    }
}

/* ==================== RESPONSIVE TABLES ==================== */

.table-responsive-mobile {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table-responsive-mobile table {
        min-width: 600px;
    }

    .table-responsive-mobile {
        border: 1px solid #dee2e6;
        border-radius: 0.25rem;
    }
}

/* ==================== RESPONSIVE CARDS ==================== */

.card-responsive {
    border-radius: 10px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .card-responsive {
        margin-bottom: 15px;
    }

    .card-responsive .card-body {
        padding: 1rem !important;
    }

    .card-responsive .card-title {
        font-size: 1rem !important;
    }

    .card-responsive .card-text {
        font-size: 0.875rem !important;
    }
}

/* ==================== RESPONSIVE MODALS ==================== */

@media (max-width: 768px) {
    .modal-responsive {
        margin: 0 !important;
    }

    .modal-responsive .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }

    .modal-responsive .modal-content {
        border-radius: 10px !important;
    }

    .modal-responsive .modal-header {
        padding: 1rem !important;
    }

    .modal-responsive .modal-body {
        padding: 1rem !important;
    }

    .modal-responsive .modal-footer {
        padding: 1rem !important;
    }
}

/* ==================== TOUCH IMPROVEMENTS ==================== */

@media (max-width: 768px) {
    /* Área táctil mínima 44x44px */
    .touchable {
        min-width: 44px;
        min-height: 44px;
        padding: 0.7rem;
    }

    /* Eliminar efectos hover en móvil */
    .no-hover-mobile:hover {
        transform: none !important;
        box-shadow: none !important;
    }

    /* Scroll suave en iOS */
    .scroll-smooth {
        -webkit-overflow-scrolling: touch;
    }

    /* Tap highlight */
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }

    /* Prevenir zoom al enfocar inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ==================== RESPONSIVE FLEX ==================== */

.flex-responsive {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 768px) {
    .flex-responsive {
        flex-direction: column;
    }

    .flex-responsive-row {
        flex-direction: row !important;
    }
}

/* ==================== RESPONSIVE FORMS ==================== */

@media (max-width: 768px) {
    .form-responsive label {
        font-size: 0.9rem;
    }

    .form-responsive input,
    .form-responsive select,
    .form-responsive textarea {
        font-size: 16px !important; /* Evita zoom en iOS */
    }

    .form-responsive .form-group {
        margin-bottom: 1rem;
    }
}

/* ==================== UTILITY CLASSES ==================== */

/* Aspect ratio helpers */
.aspect-ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.aspect-ratio-4-3 {
    aspect-ratio: 4 / 3;
}

.aspect-ratio-1-1 {
    aspect-ratio: 1 / 1;
}

/* Object fit */
.object-cover {
    object-fit: cover;
}

.object-contain {
    object-fit: contain;
}

/* Safe areas para notch en móviles */
@supports (padding: max(0px)) {
    .safe-area-inset-top {
        padding-top: max(env(safe-area-inset-top), 0px);
    }

    .safe-area-inset-bottom {
        padding-bottom: max(env(safe-area-inset-bottom), 0px);
    }

    .safe-area-inset-left {
        padding-left: max(env(safe-area-inset-left), 0px);
    }

    .safe-area-inset-right {
        padding-right: max(env(safe-area-inset-right), 0px);
    }
}

/* ==================== PRINT UTILITIES ==================== */

@media print {
    .no-print {
        display: none !important;
    }

    .page-break-before {
        page-break-before: always;
    }

    .page-break-after {
        page-break-after: always;
    }

    .page-break-inside-avoid {
        page-break-inside: avoid;
    }
}

