/* ================================================================
   ESTILOS GENERALES Y BOTONES NAHARA
   ================================================================ */

:root {
    /* Paleta base de marca */
    --nahara-rosado: #f2cad3;
    --nahara-rosado-oscuro: #d99fae;
    --nahara-plomo-claro: #e2e6ea;
    --nahara-negro: #111111;
    /* Tokens de diseño */
    --nahara-crema: #fdfbfa;
    --nahara-sombra: 0 4px 18px rgba(17, 17, 17, 0.08);
    --nahara-sombra-fuerte: 0 10px 28px rgba(17, 17, 17, 0.16);
    --nahara-radio: 12px;
    --nahara-radio-chico: 8px;
    --nahara-transicion: all 0.25s ease;
}

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

.btn-nahara {
    background-color: var(--nahara-negro);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 20px;
    transition: var(--nahara-transicion);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-nahara:hover {
    background-color: #333333;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--nahara-sombra);
}

.btn-nahara:active {
    transform: translateY(0);
}

.btn-outline-nahara {
    border: 2px solid var(--nahara-negro);
    color: var(--nahara-negro);
    background: transparent;
    border-radius: 10px;
    font-weight: 600;
    padding: 8px 16px;
    transition: var(--nahara-transicion);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-outline-nahara:hover {
    background: var(--nahara-negro);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--nahara-sombra);
}

.btn-nahara-sm {
    background: var(--nahara-negro);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: var(--nahara-transicion);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-nahara-sm:hover {
    background: #333;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--nahara-sombra);
}

.btn-outline-danger-sm {
    border: 2px solid #dc2626;
    color: #dc2626;
    background: transparent;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: var(--nahara-transicion);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-outline-danger-sm:hover {
    background: #dc2626;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

/* ================================================================
   TARJETAS MODERNAS
   ================================================================ */

.card-moderno {
    background: #fff;
    border-radius: var(--nahara-radio);
    border: 1px solid #f0f0f0;
    box-shadow: var(--nahara-sombra);
    overflow: hidden;
    transition: var(--nahara-transicion);
    margin-bottom: 18px;
}

.card-moderno:hover {
    box-shadow: var(--nahara-sombra-fuerte);
}

.card-moderno .card-header {
    background: #fafbfc;
    border-bottom: 1px solid #f0f0f0;
    padding: 14px 20px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-moderno .card-header i {
    color: var(--nahara-rosado);
    width: 20px;
    text-align: center;
}

.card-moderno .card-body {
    padding: 20px;
}

/* ================================================================
   TARJETAS DE CATEGORÍA (Verticales y centradas)
   ================================================================ */

.categoria-tile {
    position: relative;
    height: 360px;
    border-radius: var(--nahara-radio);
    overflow: hidden;
    background-color: #f8f9fa;
    box-shadow: var(--nahara-sombra);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.categoria-tile:hover {
    transform: translateY(-5px);
    box-shadow: var(--nahara-sombra-fuerte);
}

.categoria-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.categoria-tile-sinfoto {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #e9ecef;
    color: #495057;
    font-weight: 600;
    text-transform: uppercase;
}

.categoria-tile-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.1) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    color: #ffffff;
}

.categoria-tile-nombre {
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.categoria-tile-explorar {
    font-size: 0.875rem;
    color: #f8f9fa;
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.categoria-tile:hover .categoria-tile-explorar {
    opacity: 1;
    transform: translateX(4px);
}

/* ================================================================
   TARJETAS DE PRODUCTOS
   ================================================================ */

.tarjeta-producto {
    border: 1px solid #eee;
    border-radius: var(--nahara-radio-chico);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
}

.tarjeta-producto:hover {
    transform: translateY(-3px);
    box-shadow: var(--nahara-sombra-fuerte);
}

.tarjeta-producto .card-img-container {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.tarjeta-producto .card-img-container img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.tarjeta-producto:hover .card-img-container img {
    transform: scale(1.04);
}

/* ================================================================
   BADGES / INSIGNIAS
   ================================================================ */

.badge-producto,
.badge-status,
.card-img-container .badge {
    padding: 3px 10px !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    border-radius: 50rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-destacado {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

.badge-oferta {
    background-color: #dc3545 !important;
    color: #ffffff !important;
}

.badge-nuevo {
    background-color: #d929d0 !important;
    color: #ffffff !important;
}

.badge-mas-vendido {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

.badge-inactivo {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

.badge-activo {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
}

.badge-sin-oferta {
    background-color: #f1f5f9 !important;
    color: #94a3b8 !important;
}

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

.form-label-moderno {
    font-weight: 600;
    font-size: 0.85rem;
    color: #0f172a;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-label-moderno .required {
    color: #dc2626;
    font-size: 1.1rem;
}

.form-control-moderno {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    transition: var(--nahara-transicion);
    font-size: 0.95rem;
    width: 100%;
    background: #fff;
}

.form-control-moderno:focus {
    border-color: var(--nahara-negro);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
    outline: none;
}

.form-control-moderno:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.form-select-moderno {
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    transition: var(--nahara-transicion);
    font-size: 0.95rem;
    width: 100%;
    background: #fff;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-select-moderno:focus {
    border-color: var(--nahara-negro);
    box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
    outline: none;
}

.form-text-moderno {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-text-moderno i {
    color: var(--nahara-rosado);
}

/* ================================================================
   TABLAS MODERNAS
   ================================================================ */

.table-moderna {
    font-size: 0.85rem;
    border-collapse: separate;
    border-spacing: 0 4px;
    margin-bottom: 0;
    width: 100%;
}

.table-moderna thead th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.table-moderna tbody tr {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--nahara-sombra);
    transition: var(--nahara-transicion);
}

.table-moderna tbody tr:hover {
    box-shadow: var(--nahara-sombra-fuerte);
    transform: translateY(-2px);
}

.table-moderna tbody tr.seleccionado {
    border-left: 3px solid var(--nahara-negro);
    background: #fafbfc;
}

.table-moderna tbody td {
    border: none;
    padding: 10px 12px;
    vertical-align: middle;
}

/* ================================================================
   TARJETAS PARA MÓVIL (en lugar de tablas)
   ================================================================ */

.tarjeta-movil {
    display: none;
    background: #fff;
    border-radius: var(--nahara-radio);
    border: 1px solid #f0f0f0;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: var(--nahara-sombra);
    transition: var(--nahara-transicion);
}

.tarjeta-movil:hover {
    box-shadow: var(--nahara-sombra-fuerte);
    transform: translateY(-2px);
}

.tarjeta-movil.seleccionado {
    border-left: 3px solid var(--nahara-negro);
    background: #fafbfc;
}

/* ================================================================
   SELECTOR DE TIPO DE ENTREGA
   ================================================================ */

.tipo-entrega-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tipo-entrega-opcion {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: var(--nahara-transicion);
    background: #fafbfc;
}

.tipo-entrega-opcion:hover {
    border-color: var(--nahara-rosado);
    background: #fdf8f9;
}

.tipo-entrega-opcion.active {
    border-color: var(--nahara-negro);
    background: #f8f9fa;
}

.tipo-entrega-opcion i {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 4px;
    color: #94a3b8;
}

.tipo-entrega-opcion.active i {
    color: var(--nahara-negro);
}

.tipo-entrega-opcion .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
}

.tipo-entrega-opcion .sub {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* ================================================================
   CHECKBOXES MODERNOS
   ================================================================ */

.check-moderno {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    transition: var(--nahara-transicion);
    cursor: pointer;
    margin-bottom: 8px;
    background: #fafbfc;
}

.check-moderno:hover {
    border-color: var(--nahara-rosado);
    background: #fdf8f9;
}

.check-moderno.checked {
    border-color: var(--nahara-negro);
    background: #f8f9fa;
}

.check-moderno input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--nahara-negro);
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.check-moderno .check-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #0f172a;
    cursor: pointer;
}

.check-moderno .check-desc {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 1px;
}

/* ================================================================
   RESPONSIVE - AJUSTES GLOBALES
   ================================================================ */

@media (max-width: 991.98px) {

    .table-moderna thead th:nth-child(4),
    .table-moderna tbody td:nth-child(4),
    .table-moderna thead th:nth-child(6),
    .table-moderna tbody td:nth-child(6),
    .table-moderna thead th:nth-child(7),
    .table-moderna tbody td:nth-child(7),
    .table-moderna thead th:nth-child(8),
    .table-moderna tbody td:nth-child(8) {
        display: none;
    }
}

@media (max-width: 767.98px) {

    /* Ocultar tablas en móvil */
    .table-wrapper-escritorio {
        display: none;
    }

    /* Mostrar tarjetas móviles */
    .tarjeta-movil {
        display: block;
    }

    .tipo-entrega-selector {
        grid-template-columns: 1fr;
    }

    .card-moderno .card-body {
        padding: 14px;
    }

    .btn-nahara,
    .btn-outline-nahara {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .tarjeta-movil {
        padding: 12px;
    }

    .form-control-moderno,
    .form-select-moderno {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .card-moderno .card-header {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .card-moderno .card-body {
        padding: 12px;
    }
}

/* ================================================================
   ANIMACIONES
   ================================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.85);
    }
}

/* ================================================================
   TOAST / NOTIFICACIONES
   ================================================================ */

.toast-flotante {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #0f172a;
    color: #fff;
    padding: 14px 22px;
    border-radius: var(--nahara-radio);
    font-size: 0.9rem;
    z-index: 9999;
    box-shadow: var(--nahara-sombra-fuerte);
    display: none;
    align-items: center;
    gap: 12px;
    border-left: 4px solid #22c55e;
    max-width: 380px;
}

.toast-flotante i {
    color: #22c55e;
    font-size: 1.2rem;
}

.toast-flotante.error {
    border-left-color: #dc2626;
}

.toast-flotante.error i {
    color: #dc2626;
}

.toast-flotante.visible {
    display: flex;
    animation: slideInRight 0.4s ease;
}

/* ================================================================
   VOLVER LINK
   ================================================================ */

.volver-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: var(--nahara-transicion);
    margin-top: 16px;
}

.volver-link:hover {
    color: var(--nahara-negro);
    transform: translateX(-4px);
}

/* ================================================================
   LOGOTIPO DE NAVBAR
   ================================================================ */

.navbar-logo {
    height: auto;
    max-height: 48px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    transition: var(--nahara-transicion);
}

@media (max-width: 991.98px) {
    .navbar-logo {
        max-height: 40px;
        max-width: 140px;
    }
}

@media (max-width: 575.98px) {
    .navbar-logo {
        max-height: 35px;
        max-width: 120px;
    }
}

/* ================================================================
   HERO CAROUSEL (ANCHO Y ALTO DINÁMICO)
   ================================================================ */
.hero-carousel {
    width: 100%;
    /* En escritorio: 100vh menos navbar (70px) y mega menu (40px) */
    height: calc(100vh - 110px);
    min-height: 500px;
}

.hero-carousel .carousel-inner,
.hero-carousel .carousel-item {
    height: 100%;
}

.hero-carousel .carousel-item {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Overlay para contraste de texto */
.hero-overlay {
    background: rgba(0, 0, 0, 0.4);
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.hero-content {
    max-width: 850px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    animation: fadeInUp 0.8s ease forwards;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    animation: fadeInUp 1s ease forwards;
}

.hero-text {
    font-size: clamp(0.9rem, 1.2vw, 1.15rem);
    font-weight: 400;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    animation: fadeInUp 1.2s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991.98px) {

    /* En móvil/tablet: no hay mega menu, y la altura cambia */
    .hero-carousel {
        height: calc(100vh - 120px);
        min-height: 400px;
    }
}

/* ================================================================
   EXPORTACIÓN A PDF MEDIANTE 
   ================================================================ */

.pdf-export-mode {
    width: 100% !important;
    max-width: 750px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #ffffff !important;
}

.pdf-export-mode .card {
    border: 1px solid #e0e0e0 !important;
    box-shadow: none !important;
    margin-bottom: 10px !important;
}

.pdf-export-mode .row {
    display: flex !important;
    flex-wrap: nowrap !important;
}