/* ============================================
   MANOS DE BARRO - Taller de Cerámica
   Paleta de colores pastel
   ============================================ */

:root {
    /* Colores principales pastel */
    --pastel-pink: #F8E1E7;
    --pastel-peach: #FDEBD3;
    --pastel-cream: #FDF6EC;
    --pastel-sage: #D4E2D4;
    --pastel-lavender: #E8E0F0;
    --pastel-blue: #DAE8F5;

    /* Colores de acento */
    --terracotta: #C67B5C;
    --terracotta-light: #D4967C;
    --terracotta-dark: #A65D3F;
    --clay-brown: #8B6914;

    /* Colores de texto */
    --text-dark: #4A4A4A;
    --text-medium: #6B6B6B;
    --text-light: #8B8B8B;

    /* Otros */
    --white: #FFFFFF;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-hover: rgba(0, 0, 0, 0.12);
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */

/* Reducir movimiento para usuarios con sensibilidad */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Focus visible para navegación con teclado */
*:focus-visible {
    outline: 3px solid var(--terracotta);
    outline-offset: 2px;
}

/* ============================================
   ESTILOS BASE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevenir scroll horizontal en móviles */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--pastel-cream);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

/* Imágenes responsive por defecto */
img {
    max-width: 100%;
    height: auto;
}

/* Contenedores no deben exceder el viewport */
.container, .container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    color: var(--terracotta-dark);
}

a {
    color: var(--terracotta);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--terracotta-dark);
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    background-color: var(--white) !important;
    box-shadow: 0 2px 15px var(--shadow);
    padding: 15px 0;
}

.navbar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--terracotta) !important;
    font-weight: 700;
}

.navbar-brand span {
    color: var(--terracotta-dark);
}

.navbar-brand img {
    height: 80px;
}

.nav-link {
    color: var(--text-medium) !important;
    font-weight: 500;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--terracotta) !important;
}

.nav-link.active {
    color: var(--terracotta) !important;
}

/* Navbar desktop - reducir altura */
@media (min-width: 992px) {
    .navbar {
        padding: 5px 0;
    }
}

/* Dropdown del navbar - asegurar visibilidad */
.navbar .container {
    overflow: visible !important;
}

.navbar .dropdown {
    position: relative;
}

.navbar .dropdown-menu {
    background-color: var(--white);
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    z-index: 1060;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
}

.navbar .dropdown-menu.show {
    display: block;
}

.navbar .dropdown-item {
    color: var(--text-dark);
    padding: 10px 20px;
}

.navbar .dropdown-item:hover {
    background-color: var(--pastel-cream);
    color: var(--terracotta);
}

/* Navbar mobile menu */
@media (max-width: 991px) {
    .navbar {
        position: relative;
    }

    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1050;
        background: var(--white);
        padding: 20px;
        border-radius: 0 0 15px 15px;
        margin-top: 0;
        box-shadow: 0 8px 30px rgba(0,0,0,0.12);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .navbar-nav {
        align-items: flex-start !important;
    }

    .nav-link {
        padding: 12px 0 !important;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        width: 100%;
    }

    .nav-item.ms-lg-3,
    .nav-item.ms-lg-2 {
        margin-left: 0 !important;
        margin-top: 15px;
        width: 100%;
    }

    .nav-item .btn {
        width: 100%;
        justify-content: center;
    }

    .navbar .dropdown {
        width: 100%;
    }

    .navbar .dropdown-menu {
        position: static !important;
        transform: none !important;
        border: 1px solid rgba(198, 123, 92, 0.18);
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
        background: var(--white);
        margin-top: 10px;
        width: 100%;
        border-radius: 16px;
        padding: 0;
        overflow: hidden;
    }

    .navbar .dropdown-menu.show {
        display: block !important;
    }

    /* Header con info del usuario */
    .nav-user-dropdown-header {
        display: flex !important;
        align-items: center;
        gap: 14px;
        padding: 16px 20px;
        background: linear-gradient(135deg, var(--pastel-peach) 0%, var(--pastel-cream) 100%);
        border-bottom: 1px solid rgba(198, 123, 92, 0.12);
        list-style: none;
    }

    .nav-user-avatar-circle {
        width: 46px;
        height: 46px;
        border-radius: 50%;
        background: var(--terracotta);
        color: var(--white);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 1rem;
        font-family: 'Playfair Display', serif;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(198, 123, 92, 0.3);
    }

    .nav-user-info-block {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .nav-user-full-name {
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--text-dark);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-user-role-badge {
        display: inline-block;
        font-size: 0.72rem;
        color: var(--terracotta);
        background: rgba(198, 123, 92, 0.12);
        padding: 2px 10px;
        border-radius: 20px;
        margin-top: 4px;
        font-weight: 500;
        width: fit-content;
    }

    /* Items del dropdown */
    .navbar .dropdown-menu .dropdown-item {
        padding: 14px 20px;
        font-size: 0.95rem;
        border-bottom: 1px solid rgba(0,0,0,0.04);
        border-radius: 0;
    }

    .navbar .dropdown-menu .dropdown-item:last-child {
        border-bottom: none;
    }

    /* Ocultar el divider estándar (reemplazado por border en items) */
    .navbar .dropdown-menu .dropdown-divider {
        display: none;
    }

    /* Logout con color de peligro */
    #btn-logout {
        color: #c0392b !important;
    }

    #btn-logout:hover,
    #btn-logout:active {
        background: #fff5f5 !important;
        color: #a93226 !important;
    }
}

/* El header solo se muestra en mobile */
@media (min-width: 992px) {
    .nav-user-dropdown-header {
        display: none !important;
    }
}

/* ============================================
   BOTONES
   ============================================ */

.btn-primary {
    background-color: var(--terracotta);
    border-color: var(--terracotta);
    color: var(--white);
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--terracotta-dark);
    border-color: var(--terracotta-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(198, 123, 92, 0.3);
}

.btn-outline-primary {
    color: var(--terracotta);
    border-color: var(--terracotta);
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: var(--terracotta);
    border-color: var(--terracotta);
    color: var(--white);
}

.btn-secondary {
    background-color: var(--pastel-sage);
    border-color: var(--pastel-sage);
    color: var(--text-dark);
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 500;
}

.btn-secondary:hover {
    background-color: #c2d4c2;
    border-color: #c2d4c2;
    color: var(--text-dark);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    background: linear-gradient(135deg, var(--pastel-peach) 0%, var(--pastel-pink) 100%);
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 70%;
    height: 200%;
    background: var(--pastel-cream);
    border-radius: 50%;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--terracotta-dark);
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-medium);
    margin-bottom: 30px;
}

.hero-image {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    max-width: 80%;
    max-height: 550px;
    object-fit: cover;
    border-radius: 30px 30px 30px 30px;
    box-shadow: 0 20px 60px var(--shadow-hover);
    margin-top: -30px;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 5px 25px var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--shadow-hover);
}

.card-pastel-pink {
    background-color: var(--pastel-pink);
}

.card-pastel-peach {
    background-color: var(--pastel-peach);
}

.card-pastel-sage {
    background-color: var(--pastel-sage);
}

.card-pastel-lavender {
    background-color: var(--pastel-lavender);
}

.card-pastel-blue {
    background-color: var(--pastel-blue);
}

.card-title {
    color: var(--terracotta-dark);
    font-weight: 600;
}

.card-text {
    color: var(--text-medium);
}

/* ============================================
   GALERIA CARRUSEL
   ============================================ */

.galeria-carousel {
    margin: 0 auto;
    overflow: hidden;
}

.galeria-carousel .carousel-inner {
    border-radius: 20px;
    overflow: hidden;
    background-color: var(--pastel-cream);
}

.galeria-carousel .carousel-img {
    height: 450px;
    object-fit: contain;
    object-position: center;
}

.galeria-carousel .carousel-control-prev,
.galeria-carousel .carousel-control-next {
    width: 50px;
    height: 50px;
    background-color: var(--terracotta);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.9;
}

.galeria-carousel .carousel-control-prev {
    left: 10px;
}

.galeria-carousel .carousel-control-next {
    right: 10px;
}

.galeria-carousel .carousel-control-prev:hover,
.galeria-carousel .carousel-control-next:hover {
    opacity: 1;
    background-color: var(--terracotta-dark);
}

.galeria-carousel .carousel-indicators {
    bottom: 10px;
}

.galeria-carousel .carousel-indicators button {
    width: 30px;
    height: 4px;
    border-radius: 2px;
    background-color: white;
    opacity: 0.5;
}

.galeria-carousel .carousel-indicators button.active {
    opacity: 1;
}

@media (max-width: 576px) {
    .galeria-carousel .carousel-img {
        height: 300px;
    }

    .galeria-carousel .carousel-control-prev,
    .galeria-carousel .carousel-control-next {
        width: 40px;
        height: 40px;
    }

    .galeria-carousel .carousel-control-prev {
        left: 10px;
    }

    .galeria-carousel .carousel-control-next {
        right: 10px;
    }
}

/* ============================================
   SECCIONES
   ============================================ */

section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-title p {
    color: var(--text-medium);
    font-size: 1.1rem;
}

.section-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--terracotta-light), var(--terracotta));
    margin: 0 auto;
    border-radius: 2px;
}

/* ============================================
   FEATURES / SERVICIOS
   ============================================ */

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--terracotta-light), var(--terracotta));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--white);
    font-size: 2rem;
}

.feature-card {
    text-align: center;
    padding: 40px 30px;
}

/* ============================================
   FORMULARIOS
   ============================================ */

.form-control {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

/* Inputs de código de verificación */
.codigo-digit {
    color: var(--text-dark) !important;
    font-weight: 700;
    caret-color: var(--terracotta);
    background-color: var(--white) !important;
    padding: 5px !important;
    line-height: 1 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.codigo-digit:focus {
    border-color: var(--terracotta);
    box-shadow: 0 0 0 3px rgba(198, 123, 92, 0.15);
}

.codigo-digit.is-valid {
    border-color: #198754;
    background-color: #d1e7dd !important;
}

.codigo-digit.is-invalid {
    border-color: #dc3545;
    background-color: #f8d7da !important;
}

.form-control:focus {
    border-color: var(--terracotta);
    box-shadow: 0 0 0 3px rgba(198, 123, 92, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.form-floating > .form-control {
    padding: 1rem 0.75rem;
}

/* ============================================
   AUTH PAGES (Login/Register)
   ============================================ */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--pastel-cream) 0%, var(--pastel-peach) 100%);
}

.auth-card {
    background: var(--white);
    border-radius: 25px;
    box-shadow: 0 20px 60px var(--shadow);
    padding: 50px;
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo h1 {
    font-family: 'Playfair Display', serif;
    color: var(--terracotta);
    font-size: 2rem;
}

.auth-title {
    text-align: center;
    margin-bottom: 30px;
}

.auth-title h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.auth-title p {
    color: var(--text-medium);
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    padding: 0 15px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ============================================
   DASHBOARD
   ============================================ */

.dashboard-header {
    background: linear-gradient(135deg, var(--pastel-peach) 0%, var(--pastel-pink) 100%);
    padding: 40px 0;
    margin-bottom: 30px;
}

.welcome-text h2 {
    color: var(--terracotta-dark);
    margin-bottom: 5px;
}

.welcome-text p {
    color: var(--text-medium);
}

.stat-card {
    background: var(--white);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 25px var(--shadow);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--terracotta);
}

.stat-label {
    color: var(--text-medium);
    font-size: 0.9rem;
}

/* ============================================
   CLASES / HORARIOS
   ============================================ */

.class-card {
    background: var(--white);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 3px 15px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.class-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 25px var(--shadow-hover);
}

.class-info h5 {
    color: var(--terracotta-dark);
    margin-bottom: 5px;
}

.class-info p {
    color: var(--text-medium);
    margin: 0;
    font-size: 0.9rem;
}

.class-time {
    background: var(--pastel-sage);
    padding: 10px 20px;
    border-radius: 10px;
    text-align: center;
}

.class-time .hour {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

.class-time .day {
    font-size: 0.8rem;
    color: var(--text-medium);
}

/* ============================================
   CALENDARIO
   ============================================ */

.calendar-container {
    background: var(--white);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 25px var(--shadow);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-nav {
    background: none;
    border: none;
    color: var(--terracotta);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.calendar-nav:hover {
    color: var(--terracotta-dark);
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    background-color: var(--white);
    padding: 60px 0 30px;
    margin-top: 50px;
}

.footer-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--terracotta);
    margin-bottom: 15px;
}

.footer-text {
    color: var(--text-medium);
    margin-bottom: 20px;
}

.footer-links h5 {
    color: var(--terracotta-dark);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: var(--text-medium);
}

.footer-links ul li a:hover {
    color: var(--terracotta);
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--pastel-peach);
    border-radius: 50%;
    color: var(--terracotta);
    margin-right: 10px;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background: var(--terracotta);
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid #e0e0e0;
    padding-top: 30px;
    margin-top: 40px;
    text-align: center;
    color: var(--text-light);
}

/* ============================================
   ALERTAS
   ============================================ */

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

.alert-success {
    background-color: var(--pastel-sage);
    color: #2d5a2d;
}

.alert-danger {
    background-color: var(--pastel-pink);
    color: #8b3a3a;
}

.alert-warning {
    background-color: var(--pastel-peach);
    color: #8b5a2b;
}

.alert-info {
    background-color: var(--pastel-blue);
    color: #2b4a6b;
}

/* ============================================
   UTILIDADES
   ============================================ */

.bg-pastel-pink { background-color: var(--pastel-pink) !important; }
.bg-pastel-peach { background-color: var(--pastel-peach) !important; overflow-x: hidden; }
.bg-pastel-cream { background-color: var(--pastel-cream) !important; }
.bg-pastel-sage { background-color: var(--pastel-sage) !important; }
.bg-pastel-lavender { background-color: var(--pastel-lavender) !important; }
.bg-pastel-blue { background-color: var(--pastel-blue) !important; }
.bg-terracotta { background-color: var(--terracotta) !important; }

.text-terracotta { color: var(--terracotta) !important; }
.text-terracotta-dark { color: var(--terracotta-dark) !important; }

/* ============================================
   LOADING SPINNER
   ============================================ */

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-clay {
    width: 60px;
    height: 60px;
    border: 4px solid var(--pastel-peach);
    border-top-color: var(--terracotta);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-section {
        min-height: auto;
        padding: 80px 0;
    }

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

    .auth-card {
        padding: 30px 25px;
        margin: 20px;
    }

    section {
        padding: 50px 0;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    /* Footer responsive */
    .footer-links {
        margin-bottom: 30px;
    }

    /* Navbar mobile */
    .navbar {
        padding: 10px 0;
    }

    .navbar-brand img {
        height: 50px !important;
    }

    /* Ocultar elementos decorativos grandes */
    .promo-banner::before {
        display: none;
    }
}

@media (max-width: 576px) {
    /* Contenedores centrados */
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .row > * {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Compensar navbar fixed */
    .hero-section {
        padding-top: 80px;
        padding-bottom: 30px;
        min-height: auto;
    }

    .hero-content {
        text-align: center;
    }

    .hero-content .d-flex {
        justify-content: center;
        flex-direction: column;
        align-items: center;
        gap: 10px !important;
    }

    .hero-content .d-flex .btn {
        width: 80%;
    }

    .hero-content .row.mt-5 {
        justify-content: center;
        margin-top: 1.5rem !important;
        padding-top: 1rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        text-align: center;
    }

    .hero-content .row.mt-5 .col-4 {
        padding-left: 5px;
        padding-right: 5px;
    }

    .hero-image {
        margin-top: 1.5rem !important;
    }

    .hero-image img {
        margin-top: 0;
    }

    .hero-title {
        font-size: 1.75rem;
        line-height: 1.25;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
    }

    .navbar-brand {
        font-size: 1.4rem;
    }

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

    .feature-card {
        padding: 25px 20px;
    }

    .btn-lg {
        padding: 10px 20px;
        font-size: 1rem;
    }

}

/* Mobile (480px) - iPhone 14 Pro y similares */
@media (max-width: 480px) {
    /* Prevenir overflow */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .row {
        margin-left: -10px;
        margin-right: -10px;
    }

    .row > * {
        padding-left: 10px;
        padding-right: 10px;
    }

    .hero-title {
        font-size: 1.7rem;
        word-wrap: break-word;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .hero-content {
        padding: 0 10px;
    }

    section {
        padding: 40px 0;
    }

    .section-title h2 {
        font-size: 1.6rem;
    }

    .section-title p {
        font-size: 0.95rem;
    }

    .auth-card {
        padding: 25px 20px;
        margin: 15px;
        width: calc(100% - 30px);
    }

    .feature-card {
        padding: 20px 15px;
    }

    .promo-banner {
        padding: 20px;
    }

    .promo-title {
        font-size: 1.4rem;
    }

    /* Modales responsive */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-lg,
    .modal-xl {
        max-width: calc(100% - 20px);
        margin: 10px;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-header {
        padding: 12px 15px;
    }

    /* Botones minimo 44px para touch */
    .btn {
        min-height: 44px;
        padding: 10px 16px;
    }

    .btn-sm {
        min-height: 38px;
        padding: 8px 12px;
    }

    /* Cards */
    .card-body {
        padding: 15px;
    }

    /* Carrito flotante */
    .carrito-flotante {
        width: 50px;
        height: 50px;
        bottom: 15px;
        right: 15px;
    }

    .carrito-flotante i {
        font-size: 1.3rem;
    }

    .carrito-cantidad {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }

    /* Tablas responsive */
    .table-responsive {
        margin: 0 -15px;
        width: calc(100% + 30px);
    }

    /* Formularios */
    .form-control {
        font-size: 16px; /* Previene zoom en iOS */
    }
}

/* Mobile extra pequeno (360px) */
@media (max-width: 360px) {
    .hero-section {
        padding: 85px 0 35px;
    }

    .hero-title {
        font-size: 1.35rem;
        line-height: 1.25;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .section-title h2 {
        font-size: 1.4rem;
    }

    section {
        padding: 30px 0;
    }

    .auth-card {
        padding: 20px 15px;
        margin: 10px;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-brand img {
        height: 45px !important;
    }

    .feature-card {
        padding: 15px 12px;
    }

    .btn-lg {
        padding: 8px 16px;
        font-size: 0.95rem;
    }

}

/* ============================================
   TIENDA - SECCION DE PRODUCTOS
   ============================================ */

/* Banner de promocion */
.promo-banner {
    background: linear-gradient(135deg, var(--terracotta) 0%, var(--terracotta-dark) 100%);
    border-radius: 20px;
    padding: 30px 40px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.promo-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.promo-badge {
    background: var(--white);
    color: var(--terracotta-dark);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

.promo-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: var(--white);
}

.promo-text {
    opacity: 0.9;
}

.promo-timer {
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
}

/* Categorias */
.categoria-card {
    background: var(--white);
    border-radius: 15px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 3px 15px var(--shadow);
}

.categoria-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-hover);
}

.categoria-card.active {
    border-color: var(--terracotta);
    background: var(--pastel-peach);
}

/* Categorias colapsables en mobile */
@media (max-width: 767px) {
    #categorias-container {
        margin-bottom: 0.5rem !important;
    }

    /* Forzar 4 columnas */
    #categorias-container .categoria-item {
        flex: 0 0 25% !important;
        max-width: 25% !important;
        padding-left: 3px !important;
        padding-right: 3px !important;
    }

    .categoria-oculta {
        display: none !important;
    }

    .categoria-oculta.categoria-visible {
        display: flex !important;
    }

    .categoria-card {
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 52px;
        padding: 6px 3px !important;
    }

    .categoria-card span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        font-size: 0.55rem !important;
    }

    .categoria-card i {
        font-size: 0.95rem !important;
        margin-bottom: 2px !important;
    }
}

.btn-outline-terracotta {
    color: var(--terracotta);
    border-color: var(--terracotta);
    background: transparent;
    border-radius: 12px;
    font-size: 0.6rem;
    padding: 3px 8px;
    min-height: auto !important;
}

.btn-outline-terracotta:hover {
    background: var(--terracotta);
    color: white;
}

.categoria-card i {
    font-size: 2rem;
    color: var(--terracotta);
    display: block;
    margin-bottom: 10px;
}

.categoria-card span {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

/* Productos */
.producto-item {
    display: flex;
}

.producto-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 25px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.producto-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px var(--shadow-hover);
}

.producto-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--terracotta);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.producto-badge.descuento {
    background: #e74c3c;
}

.producto-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}

.producto-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.producto-card:hover .producto-img img {
    transform: scale(1.1);
}

.producto-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.producto-card:hover .producto-overlay {
    opacity: 1;
    transform: translateY(0);
}

.producto-overlay .btn {
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.producto-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.producto-nombre {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--terracotta-dark);
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.producto-descripcion {
    color: var(--text-medium);
    font-size: 0.85rem;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.producto-precio {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.precio-actual {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--terracotta);
}

.precio-anterior {
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.precio-desde {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-right: 5px;
}

/* Botones de variantes */
.variante-btn {
    transition: all 0.2s ease;
}

.variante-btn.active {
    background-color: var(--terracotta) !important;
    border-color: var(--terracotta) !important;
    color: white !important;
}

.variante-btn:hover:not(.active) {
    background-color: var(--pastel-cream);
}

/* Carrito flotante */
.carrito-flotante {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--terracotta) 0%, var(--terracotta-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(198, 123, 92, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    transform: scale(0);
}

.carrito-flotante:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 8px 35px rgba(198, 123, 92, 0.5);
}

.carrito-flotante.pulse {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.carrito-contador {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: var(--white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal carrito */
.carrito-items {
    max-height: 400px;
    overflow-y: auto;
}

.carrito-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.carrito-item:last-child {
    border-bottom: none;
}

.carrito-item-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
}

.carrito-item-info {
    flex: 1;
}

.carrito-item-info h6 {
    margin-bottom: 5px;
    color: var(--terracotta-dark);
}

.carrito-item-cantidad {
    display: flex;
    align-items: center;
}

.carrito-item-total {
    min-width: 80px;
    text-align: right;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive tienda */
@media (max-width: 768px) {
    .promo-banner {
        padding: 20px;
        text-align: center;
    }

    .promo-title {
        font-size: 1.4rem;
    }

    .promo-timer {
        display: block;
        margin-top: 15px;
    }

    .carrito-flotante {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
    }

    .carrito-item {
        flex-wrap: wrap;
    }

    .carrito-item-img {
        width: 60px;
        height: 60px;
    }

    .carrito-item-total {
        width: 100%;
        text-align: left;
        margin-top: 10px;
    }
}

/* ============================================
   MEJORAS MOBILE ADICIONALES
   ============================================ */

/* Safe area para iPhones con notch */
@supports (padding-top: env(safe-area-inset-top)) {
    .navbar.fixed-top {
        padding-top: calc(env(safe-area-inset-top) + 10px);
    }

    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Mejoras para pantallas pequenas (iPhone 14 Pro = 393px) */
@media (max-width: 430px) {
    /* Hero section - compensar navbar fixed */
    .hero-section {
        padding: 90px 0 40px;
    }

    .hero-title {
        font-size: 1.5rem;
        line-height: 1.3;
        letter-spacing: -0.01em;
        hyphens: none;
        -webkit-hyphens: none;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
    }

    .hero-subtitle {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* Botones hero */
    .hero-content .btn-lg {
        width: 100%;
        margin-bottom: 10px;
    }

    .hero-content .d-flex.gap-3 {
        flex-direction: column;
        gap: 10px !important;
    }

    /* Stats en hero */
    .hero-content .row.mt-5 h3 {
        font-size: 1.3rem;
    }

    .hero-content .row.mt-5 p {
        font-size: 0.75rem;
    }

    /* Cards de clases */
    .card-body.p-4 {
        padding: 20px !important;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    /* Footer */
    footer {
        padding: 40px 0 20px;
        text-align: center;
    }

    .footer-links {
        margin-bottom: 25px;
    }

    .social-icons {
        justify-content: center;
        display: flex;
    }

    /* Modales */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    /* Formularios checkout */
    .metodo-entrega-card .card-body {
        padding: 15px 10px !important;
    }

    .metodo-entrega-card h6 {
        font-size: 0.9rem;
    }

    .metodo-entrega-card small {
        font-size: 0.75rem;
    }

    /* Carrito */
    .carrito-items {
        max-height: 250px;
    }

    .carrito-item-img {
        width: 50px;
        height: 50px;
    }

    /* Productos */
    .producto-info {
        padding: 15px;
    }

    .producto-nombre {
        font-size: 1rem;
    }

    .precio-actual {
        font-size: 1.1rem;
    }

    /* Navbar brand */
    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-brand img {
        height: 45px !important;
    }

    /* Section titles */
    .section-title h2 {
        font-size: 1.5rem;
    }

    .section-title p {
        font-size: 0.9rem;
        padding: 0 10px;
    }

    /* Alerts */
    .alert {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

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

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

/* Touch-friendly improvements */
@media (pointer: coarse) {
    /* Aumentar areas de toque */
    .btn {
        min-height: 44px;
    }

    .nav-link {
        padding: 12px 15px !important;
    }

    .form-check-input {
        width: 1.2em;
        height: 1.2em;
    }

    /* Mejor scroll en mobile */
    .carrito-items {
        -webkit-overflow-scrolling: touch;
    }

    /* Espaciado para dedos */
    .dropdown-item {
        padding: 12px 20px;
    }
}

/* ============================================
   TABLAS RESPONSIVE
   ============================================ */

.table {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .table {
        font-size: 0.85rem;
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: block;
        margin-bottom: 15px;
        background: var(--white);
        border-radius: 10px;
        box-shadow: 0 2px 10px var(--shadow);
        padding: 15px;
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .table tbody td:last-child {
        border-bottom: none;
    }

    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--terracotta-dark);
    }
}

/* ============================================
   ADMIN PAGES RESPONSIVE FIXES
   ============================================ */

/* Menu mobile admin - fix color de links */
#mobileMenu .nav-link {
    color: rgba(255,255,255,0.85) !important;
}
#mobileMenu .nav-link:hover,
#mobileMenu .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.15) !important;
}

@media (max-width: 992px) {
    /* Fix para main content en admin */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Sidebar oculto en mobile */
    .sidebar {
        display: none !important;
    }
}

@media (max-width: 576px) {
    /* Stat cards en admin */
    .stat-card-admin .d-flex {
        flex-direction: column;
        text-align: center;
    }

    .stat-card-admin .stat-icon {
        margin: 0 auto 15px;
    }

    /* Top bar en admin */
    .top-bar h5 {
        font-size: 1rem;
    }

    .top-bar .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    /* Cards de clases */
    .clase-hoy-card {
        padding: 12px;
    }

    .clase-hoy-card h6 {
        font-size: 0.95rem;
    }

    /* Alumno items */
    .alumno-item {
        padding: 10px 12px;
    }
}

/* ============================================
   BOTONES DASHBOARD ALUMNA - MOBILE
   ============================================ */

.btn-dashboard-action {
    white-space: nowrap;
}

@media (max-width: 576px) {
    .btn-dashboard-action {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .btn-dashboard-action .btn-text {
        display: inline;
    }
}

@media (max-width: 380px) {
    .btn-dashboard-action {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* ============================================
   OVERFLOW PROTECTION
   ============================================ */

/* Proteccion global contra overflow */
.container,
.container-fluid,
.row,
section,
.card,
.modal-body,
.offcanvas-body {
    max-width: 100%;
}

/* Palabras largas */
h1, h2, h3, h4, h5, h6, p, span, a, li, td, th {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Tablas */
table {
    table-layout: fixed;
    width: 100%;
}

/* Pre y code */
pre, code {
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
}

/* Inputs no deben causar overflow */
input, select, textarea {
    max-width: 100%;
}
