:root {
    --primary: #1a73e8;
    /* Azul profesional estilo Google/Dashboard */
    --primary-dark: #0d47a1;
    --grad-primary: linear-gradient(135deg, #1a73e8, #054792);
    --accent: #f44336;
    /* Rojo corporativo */
    --accent-dark: #d32f2f;
    --grad-accent: linear-gradient(135deg, #ff5252, #d32f2f);
    --secondary: #202124;
    /* Gris oscuro dashboard */
    --bg-color: #f0f4f8;
    /* Un gris-azul muy suave para mas profundidad */
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-gray: #5f6368;
    --danger: #d93025;
    --radius: 16px;
    /* Bordes mas organicos */
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 20px 25px -5px rgba(26, 115, 232, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--secondary);
}

.main-bg {
    position: relative;
}

.main-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/fondo.png') center/cover no-repeat;
    opacity: 0.2;
    /* Transparencia ajustable del fondo */
    z-index: -1;
    pointer-events: none;
}

/* FILTROS */
.filter-select {
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231a73e8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    min-width: 180px;
    padding-right: 45px;
}

.filter-select:hover {
    background-color: white;
    box-shadow: var(--shadow-soft);
    border-color: var(--primary);
}

.filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

/* HEADER MODIFICADO (Logo grande, barra delgada) */
header {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 0 5%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-actions.hidden {
    display: none !important;
}

.logo-container {
    height: 100%;
    display: flex;
    align-items: center;
}

.logo-container img {
    height: 75px;
    width: auto;
    object-fit: contain;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* CARRITO ICONO */
.cart-icon-container {
    position: relative;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary);
    padding: 10px;
    transition: transform 0.2s;
}

.cart-icon-container:hover {
    transform: scale(1.1);
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

/* BOTONES HEADER */
.btn-add {
    background: var(--grad-primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    /* Vuelve a ser redondeado para estilo amigable/premium */
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3);
}

.btn-add:hover {
    background: var(--primary-dark);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(26, 115, 232, 0.4);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-gray);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: var(--grad-accent);
    color: white;
    border-color: transparent;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.3);
}

/* UTILIDADES */
.hidden {
    display: none !important;
}

/* LAYOUT */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.filter-container {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    /* Changed from nowrap to wrap */
    padding: 10px 0;
}

.filter-container::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-gray);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: var(--shadow-soft);
}

.filter-chip:hover {
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.filter-chip.active {
    background: var(--grad-primary);
    color: white;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(26, 115, 232, 0.3);
}

/* GRID & CARDS REMOVED TO products.css */

/* ACCIONES DE USUARIO/ADMIN EN CARD */
.card-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e1e1e1;
}

.user-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.qty-input {
    width: 60px;
    padding: 8px;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    text-align: center;
}

.btn-add-cart {
    flex-grow: 1;
    background: var(--grad-primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(26, 115, 232, 0.2);
}

.btn-add-cart:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(26, 115, 232, 0.3);
}

.btn-add-cart:disabled {
    background: #b2bec3;
    cursor: not-allowed;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.btn-edit,
.btn-delete {
    flex-grow: 1;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: white;
}

.btn-edit {
    background: #f1c40f;
    color: #333;
}

.btn-delete {
    background: var(--danger);
}

/* MODALS */

.pdf-preview-content {
    width: 95% !important;
    max-width: 1100px !important;
    height: 90vh !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}

.pdf-preview-header {
    padding: 15px 25px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.pdf-preview-header h3 {
    margin: 0;
    color: var(--secondary);
}

.pdf-iframe {
    width: 100%;
    flex-grow: 1;
    border: none;
}

.btn-preview {
    background: #6c5ce7;
    /* Morado elegante para diferenciar */
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-preview:hover {
    background: #a29bfe;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

.btn-back-login {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-back-login:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.btn-back-login i {
    transition: transform 0.3s;
}

.btn-back-login:hover i {
    transform: translateX(-4px);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.9rem;
}

.optional-label {
    font-size: 0.8rem;
    color: #b2bec3;
    font-weight: 400;
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #dfe6e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
}

input[type="file"].form-input {
    padding: 9px;
    background: #f8f9fa;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-submit {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s;
    box-shadow: var(--shadow-sm);
}

.btn-submit:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-submit:disabled {
    background: #b2bec3;
    cursor: wait;
}

.close-modal {
    float: right;
    cursor: pointer;
    font-size: 1.5rem;
    color: #aaa;
}

/* CARRITO LISTA */
.cart-items-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cart-total {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: right;
    margin-bottom: 15px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* NUEVOS ESTILOS PARA GESTIÓN Y AUTORIZACIONES */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    border-left: 6px solid var(--primary);
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--secondary);
    font-weight: 700;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #f1f2f6;
}

.data-table th {
    background: #f1f4f9;
    color: var(--primary-dark);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    border-bottom: 2px solid #e0e6ed;
}

/* Switch Toggle Estilo */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}


.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Pedidos en Lista (Autorizaciones e Historial) */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.order-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--primary);
    margin-bottom: 10px;
}

.order-card.pending {
    border-left-color: #f1c40f;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.order-info h4 {
    margin: 0;
    font-size: 1.1rem;
}

.order-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pendiente {
    background: #fff3cd;
    color: #856404;
}

.status-finalizado {
    background: #d4edda;
    color: #155724;
}

.order-items-table {
    width: 100%;
    margin: 10px 0;
    font-size: 0.9rem;
    border-collapse: collapse;
}

.order-items-table td {
    padding: 5px 0;
}

.order-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.btn-small {
    padding: 6px 15px;
    font-size: 0.85rem;
}

/* Ajuste para input de precio en carrito */
.cart-edit-price {
    width: 110px;
    padding: 5px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    font-weight: 700;
    color: var(--primary);
    text-align: right;
}

/* Badge de Notificación para Autorizaciones */
.auth-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: pulseBadge 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    z-index: 10;
}

@keyframes pulseBadge {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}



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

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

/* RESPONSIVE DESIGN */
@media (max-width: 992px) {
    .container {
        padding: 0 15px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    header {
        height: 70px;
        padding: 0 15px;
    }

    .logo-container img {
        height: 50px;
    }

    .header-actions {
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 5px 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .header-actions::-webkit-scrollbar {
        display: none;
    }

    .btn-add span {
        display: none;
    }

    /* Show only icons in header buttons on mobile */
    .btn-add {
        padding: 0;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        justify-content: center;
        flex-shrink: 0;
    }

    .btn-add i {
        margin: 0;
        font-size: 1.1rem;
    }

    .search-sort-container {
        flex-direction: column;
        gap: 15px;
    }

    .search-box,
    .filter-select {
        max-width: none !important;
        width: 100% !important;
    }

    .category-chips {
        justify-content: center;
    }

    .section-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .header-actions {
        gap: 5px;
    }

    .cart-icon-container {
        font-size: 1.2rem;
        padding: 5px;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .filter-chip {
        padding: 8px 15px;
        font-size: 0.8rem;
        flex-grow: 1;
        text-align: center;
    }

    .filter-container {
        gap: 8px;
        margin-bottom: 20px;
        justify-content: center;
    }
}

/* SISTEMA DE SNACKBAR (Vibrant Top-Right) */
#snackbar-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.snackbar {
    min-width: 320px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    animation: slideInRight 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    color: #1e293b;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.snackbar.success {
    background: #10b981;
    color: white;
    border: none;
}

.snackbar.error {
    background: #ef4444;
    color: white;
    border: none;
}

.snackbar.warning {
    background: #f59e0b;
    color: white;
    border: none;
}

.snackbar.info {
    background: #3b82f6;
    color: white;
}

.snackbar i {
    font-size: 1.25rem;
    color: inherit;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

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

.snackbar.fadeOut {
    animation: slideOutRight 0.5s forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* BOTÓN DE WHATSAPP FLOTANTE */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    background-color: #20BA56;
}

.whatsapp-tooltip {
    position: absolute;
    right: 75px;
    background-color: white;
    color: #202124;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    border-width: 8px 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent white;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
    right: 80px;
}

/* Responsividad para móviles */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 25px;
    }

    .whatsapp-tooltip {
        display: none;
    }
}

/* ==========================================
   MÉTODOS DE PAGO (Tarjetas)
========================================== */
.payment-methods-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-method-card {
    cursor: pointer;
    display: block;
}

.payment-method-card input[type="radio"] {
    display: none;
}

.payment-card-content {
    background: #fff;
    border: 2px solid #dfe6e9;
    border-radius: 12px;
    padding: 12px 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
}

.payment-card-content:hover {
    border-color: #b2bec3;
    transform: translateX(4px);
}

.payment-logo {
    width: 60px;
    height: 40px;
    object-fit: contain;
}

.payment-method-card input[type="radio"]:checked+.payment-card-content {
    border-color: var(--primary);
    background: rgba(26, 115, 232, 0.05);
    box-shadow: 0 0 0 1px var(--primary);
}

.payment-card-content span {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-dark);
}