/* ============================================================
   RESPONSIVE.CSS — Aurium Tienda Online
   Asegura que toda la aplicación frontend sea responsive
   ============================================================ */

/* ---------- Root & Base ---------- */
:root {
    --aurium-primary: #A99065;
    --aurium-dark: #1a1a1a;
    --aurium-breakpoint-sm: 576px;
    --aurium-breakpoint-md: 768px;
    --aurium-breakpoint-lg: 992px;
    --aurium-breakpoint-xl: 1200px;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Imágenes y media responsivas por defecto */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
}

/* ---------- Tipografía fluida ---------- */
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h5 { font-size: clamp(1rem, 2vw, 1.25rem); }

/* ---------- Contenedor ---------- */
.container {
    width: 100%;
    max-width: 1200px;
    padding-left: 15px;
    padding-right: 15px;
}

/* ============================================================
   HEADER / NAVBAR
   ============================================================ */
.site-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.site-navbar-top {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

/* Logo responsive */
.site-logo img {
    height: 45px;
}

/* Enlaces del menú principal */
.site-menu li a {
    font-size: 0.95rem;
    white-space: nowrap;
}

/* ---------- Menú móvil (offcanvas) ---------- */
.site-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: #fff;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
}

.offcanvas-menu .site-mobile-menu {
    transform: translateX(0);
}

.offcanvas-menu .site-wrap {
    position: relative;
    overflow: hidden;
}

.offcanvas-menu .site-wrap:before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.offcanvas-menu .site-wrap:before {
    opacity: 1;
}

.site-mobile-menu .site-mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: var(--aurium-primary);
}

.site-mobile-menu .site-mobile-menu-close span {
    font-size: 32px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

.site-mobile-menu .site-mobile-menu-logo a {
    border: none;
    display: inline-block;
}

.site-mobile-menu .site-mobile-menu-logo img {
    height: 40px;
}

.site-mobile-menu .site-mobile-menu-body {
    padding: 20px 0;
}

.site-mobile-menu .site-nav-wrap {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-mobile-menu .site-nav-wrap > li {
    display: block;
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
}

.site-mobile-menu .site-nav-wrap > li > a {
    display: block;
    padding: 12px 20px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.site-mobile-menu .site-nav-wrap > li > a:hover {
    color: var(--aurium-primary);
    background: #f8f5f1;
    padding-left: 25px;
}

/* ============================================================
   PÁGINA DE INICIO
   ============================================================ */
/* Sección de canje de código */
.site-section {
    padding: 60px 0;
}

/* Tarjetas de productos en carousel */
.block-4 {
    height: 100%;
}

.block-4-image {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.block-4-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.block-4-text h3 {
    font-size: 1.1rem;
}

/* Tarjetas de cursos */
.card .card-body {
    padding: 1.25rem;
}

/* ============================================================
   PÁGINA DE PRODUCTOS
   ============================================================ */
.filter-sidebar {
    margin-bottom: 20px;
}

/* ============================================================
   PÁGINA DE CURSOS (course-player)
   ============================================================ */
/* Cabecera del curso */
.course-header .row {
    margin: 0;
}

.course-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 200px;
}

/* Módulos del curso */
.course-module .card-header {
    flex-wrap: wrap;
    gap: 10px;
}

.course-module .module-info {
    flex: 1 1 100%;
}

.course-module .module-actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Recursos del módulo */
.module-resource {
    flex-wrap: wrap !important;
    gap: 12px !important;
}

.module-resource .resource-info {
    flex: 1 1 60%;
    min-width: 200px;
}

.module-resource .resource-action {
    flex: 0 0 auto;
}

/* ============================================================
   TABLAS RESPONSIVE
   ============================================================ */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    margin-bottom: 1rem;
}

.table th,
.table td {
    padding: 0.75rem;
    vertical-align: middle;
    white-space: nowrap;
}

/* ============================================================
   FORMULARIOS
   ============================================================ */
.form-control,
.form-select {
    width: 100%;
    max-width: 100%;
}

.form-group {
    margin-bottom: 1rem;
}

/* Input groups responsive */
.input-group {
    flex-wrap: wrap;
}

.input-group .form-control {
    min-width: 0;
    flex: 1 1 auto;
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
    word-wrap: break-word;
}

.btn-group {
    flex-wrap: wrap;
}

/* ============================================================
   PAGINACIÓN
   ============================================================ */
.pagination {
    flex-wrap: wrap;
    justify-content: center;
}

.pagination .page-item {
    margin-bottom: 5px;
}

/* ============================================================
   BADGES Y ALERTAS
   ============================================================ */
.badge {
    white-space: normal;
    word-break: break-word;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
}

/* ============================================================
   MEDIA QUERIES
   ============================================================ */

/* ---------- Móviles pequeños (< 576px) ---------- */
@media (max-width: 575.98px) {
    .site-section {
        padding: 40px 0;
    }

    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Header */
    .site-logo img {
        height: 38px;
    }

    .site-top-icons ul {
        gap: 12px !important;
    }

    /* Homepage redeem section */
    .site-section > .container > .row > [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Cuadro blanco semi-transparente */
    .site-section .container > .row > div > div[style*="backdrop-filter"] {
        padding: 25px 18px !important;
        border-radius: 18px !important;
    }

    /* Carousel de productos */
    .nonloop-block-3 .block-4-text {
        padding: 15px !important;
    }

    /* Course player */
    .course-header .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .course-header img {
        min-height: 180px;
    }

    /* Módulos */
    .module-resource {
        padding: 12px 15px !important;
    }

    .module-resource .resource-info {
        flex: 1 1 100%;
    }

    /* Tablas: transformar en tarjetas */
    .table-mobile-cards thead {
        display: none;
    }

    .table-mobile-cards,
    .table-mobile-cards tbody,
    .table-mobile-cards tr,
    .table-mobile-cards td {
        display: block;
        width: 100%;
    }

    .table-mobile-cards tr {
        margin-bottom: 15px;
        border: 1px solid #dee2e6;
        border-radius: 8px;
        background: #fff;
    }

    .table-mobile-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        text-align: right;
    }

    .table-mobile-cards td::before {
        content: attr(data-title);
        font-weight: 600;
        color: #333;
        text-align: left;
        padding-right: 15px;
    }

    /* Botones de acción */
    .table-actions {
        flex-wrap: wrap;
        gap: 5px;
    }

    .table-actions .btn {
        font-size: 0.8rem;
        padding: 4px 10px;
    }

    /* Footer */
    .site-footer {
        text-align: center;
    }
}

/* ---------- Móviles y tablets (< 768px) ---------- */
@media (max-width: 767.98px) {
    /* Header */
    .site-navbar-top .row {
        row-gap: 12px;
    }

    /* Navegación oculta, se usa menú móvil */
    .site-navigation {
        display: none;
    }

    /* Búsqueda móvil visible */
    .mobile-search {
        display: block;
    }

    /* Homepage */
    .block-4-text h3 a {
        font-size: 1rem;
    }

    /* Course player - módulos */
    .course-module .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .course-module .module-info {
        width: 100%;
    }

    .course-module .module-actions {
        width: 100%;
        justify-content: flex-start;
    }

    /* Recursos */
    .module-resource {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .module-resource .resource-info {
        width: 100%;
    }

    .module-resource .resource-action {
        width: 100%;
        margin-top: 8px;
    }

    .module-resource .resource-action .btn {
        width: 100%;
    }

    /* Formularios backend */
    .form-row {
        flex-direction: column;
    }

    .form-row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 10px;
    }
}

/* ---------- Tablets (< 992px) ---------- */
@media (max-width: 991.98px) {
    /* Ajustes de tarjetas del dashboard */
    .stretch-card {
        margin-bottom: 15px;
    }
}

/* ---------- Desktop pequeño (< 1200px) ---------- */
@media (max-width: 1199.98px) {
    /* Ajustes menores */
}

/* ---------- Orientación landscape en móviles ---------- */
@media (max-width: 768px) and (orientation: landscape) {
    .site-mobile-menu {
        height: 100vh;
    }
}

/* ---------- Reducción de movimiento (accesibilidad) ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Print ---------- */
@media print {
    .site-navbar,
    .site-footer,
    .site-mobile-menu {
        display: none !important;
    }

    .site-wrap {
        position: static !important;
    }
}