/* assets/css/main.css */
/* ========================================
   BASE & MOBILE-FIRST (default)
   ======================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    padding-top: 70px; /* Space for fixed navbar (mobile) */
}

/* Logo responsivo */
.logo-header {
    height: 35px;
}

/* Navbar mobile-first */
.navbar {
    padding: 0.5rem 0;
}

.navbar-brand {
    font-size: 1.1rem;
}

/* ========================================
   CAROUSEL / HERO (Mobile)
   ======================================== */

#heroCarousel {
    max-height: 250px; /* Menor en móvil */
    overflow: hidden;
    margin-bottom: 1.5rem;
}

#heroCarousel .carousel-item img {
    height: 250px;
    object-fit: cover;
    object-position: center;
}

#heroCarousel .carousel-control-prev-icon,
#heroCarousel .carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
}

/* ========================================
   IMÁGENES UNIFORMES (Mobile)
   ======================================== */

.img-uniforme {
    width: 100%;
    height: 200px; /* Menor en móvil */
    object-fit: contain;
    background: #f9f9f9;
    padding: 0.5rem;
    border-radius: 4px;
}

.producto-imagen {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* ========================================
   TIPOGRAFÍA (Mobile)
   ======================================== */

h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}

/* ========================================
   COMPONENTES (Mobile)
   ======================================== */

.btn {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    border-radius: 4px;
}

/* Botón "Agregar" de la card de producto: mismo padding vertical que
   .form-control (default de Bootstrap) para que quede la misma altura
   que el input de cantidad dentro del input-group. */
.btn-agregar {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* Bug de Chrome: con align-items:stretch (default de .input-group de
   Bootstrap), un <button> dentro del input-group se infla varios px más
   alto que un <input> con el mismo padding/font-size/line-height/border
   -- confirmado inspeccionando el DOM real con Chrome DevTools. Sin
   stretch, el botón mide lo mismo que el input de forma natural. */
.input-group {
    align-items: flex-start;
}

.btn-sm {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

.btn-lg {
    font-size: 1rem;
    padding: 0.7rem 1.5rem;
    width: 100%;
}

.card {
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-img-top {
    height: 200px;
    object-fit: contain;
    padding: 0.5rem;
    background: #f9f9f9;
}

/* ========================================
   FORMULARIOS (Mobile)
   ======================================== */

.form-control,
.form-select {
    font-size: 16px; /* Evita zoom en iOS */
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

label {
    font-weight: 500;
    margin-bottom: 0.3rem;
}

input[type="checkbox"],
input[type="radio"] {
    cursor: pointer;
}

/* ========================================
   TABLA (Mobile - convertir a cards)
   ======================================== */

@media (max-width: 576px) {
    table {
        font-size: 0.9rem;
    }
    
    table thead {
        display: none;
    }
    
    table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 1rem;
        background: #fff;
    }
    
    table td {
        display: block;
        text-align: right;
        padding: 0.5rem;
        border: none;
    }
    
    table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 500;
    }
}

/* ========================================
   ANIMACIONES
   ======================================== */

.btn-rotate-izq svg,
.btn-rotate-der svg {
    transition: transform 0.2s ease, color 0.2s ease;
}

.btn-rotate-izq:hover svg {
    transform: rotate(-15deg);
    color: #0d6efd;
}

.btn-rotate-der:hover svg {
    transform: rotate(15deg);
    color: #0d6efd;
}

/* ========================================
   BREADCRUMB (Mobile)
   ======================================== */

.breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ========================================
   DROPDOWN FILTERS (Mobile)
   ======================================== */

.dropdown-menu {
    font-size: 0.95rem;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-item label {
    margin-bottom: 0;
    cursor: pointer;
    padding: 0.5rem 0;
}

/* ========================================
   TABLET (576px+)
   ======================================== */

@media (min-width: 576px) {
    body {
        padding-top: 70px;
    }
    
    .logo-header {
        height: 38px;
    }
    
    #heroCarousel {
        max-height: 320px;
    }
    
    #heroCarousel .carousel-item img {
        height: 320px;
    }
    
    .img-uniforme {
        height: 220px;
    }
    
    .card-img-top {
        height: 220px;
    }
    
    .btn-lg {
        width: auto;
    }
}

/* ========================================
   DESKTOP (768px+)
   ======================================== */

@media (min-width: 768px) {
    body {
        padding-top: 80px;
    }
    
    .logo-header {
        height: 40px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    #heroCarousel {
        max-height: 400px;
        margin-bottom: 2rem;
    }
    
    #heroCarousel .carousel-item img {
        height: 400px;
    }
    
    #heroCarousel .carousel-control-prev-icon,
    #heroCarousel .carousel-control-next-icon {
        width: 3rem;
        height: 3rem;
    }
    
    .img-uniforme {
        height: 250px;
    }
    
    .card-img-top {
        height: 250px;
    }
    
    .producto-imagen {
        max-height: 500px;
    }
    
    .btn {
        font-size: 1rem;
        padding: 0.7rem 1.5rem;
    }

    .btn-agregar {
        padding: 0.375rem 0.75rem;
        font-size: 1rem;
        line-height: 1.5;
    }

    .form-control,
    .form-select {
        font-size: 1rem;
    }
}

/* ========================================
   LARGE DESKTOP (992px+)
   ======================================== */

@media (min-width: 992px) {
    .container {
        max-width: 1200px;
    }
    
    h1 {
        font-size: 2.2rem;
    }
}