/* Reset y fuentes */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    --azul-principal: #0d2b62;
    --naranja-acento: #ff6b00;
    --gris-claro: #f8f9fa;
    --blanco: #ffffff;
}

body {
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
    font-family: 'League Spartan', sans-serif;
}

/* ---------------------------------- Hero Section ---------------------------------- */
/* ---------------------------------- Hero Section ---------------------------------- */
/* ---------------------------------- Hero Section ---------------------------------- */
/* ---------------------------------- Hero Section ---------------------------------- */
/* ---------------------------------- Hero Section ---------------------------------- */

.presupuesto-hero {
    background-color: var(--gris-claro); /* Color de respaldo */
    background-image: url('/assets/heroBackground.webp'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 80px 0;
    color: white;
    position: relative;
}

.hero-content-wrapper {
    background: linear-gradient(90deg, rgba(13, 43, 98, 0.9) 40%, rgba(13, 43, 98, 0.7));
    padding: 60px 40px;
    border-radius: 12px;
    position: relative;
    flex-direction: column;
    justify-content: space-between;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    z-index: 2;
}

.hero-main-content h1 {
    font-weight: 900;
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.hero-main-content h1 .highlight {
    color: var(--naranja-acento);
    display: block;
}

.hero-main-content .subtitle {
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 2rem;
    line-height: 1.6;
    opacity: 0.9;
}

.hero-cta-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 3rem;
}

.hero-benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.benefit-item i {
    font-size: 1.8rem;
    color: var(--naranja-acento);
    min-width: 30px;
}

.benefit-item p {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

.hero-calculator-preview {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.calculator-header {
    text-align: center;
    margin-bottom: 10px;
}

.calculator-header h3 {
    color: var(--azul-principal);
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.calculator-header p {
    color: #666;
    font-size: 1rem;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, var(--azul-principal), #1a4082);
    border-radius: 12px;
    color: white;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--naranja-acento);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.benefit-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(13, 43, 98, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--naranja-acento);
}

.benefit-icon {
    min-width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--naranja-acento), #ff8533);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.benefit-icon i {
    font-size: 1.1rem;
}

.benefit-text h4 {
    color: var(--azul-principal);
    font-size: 1rem;
    margin-bottom: 3px;
    font-weight: bold;
}

.benefit-text p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.3;
}

/* Decorative elements */
.hero-decoration {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.decoration-circle {
    position: absolute;
    border: 2px solid rgba(255, 107, 0, 0.2);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.decoration-circle:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 20%;
    right: 10%;
    animation-delay: 0s;
}

.decoration-circle:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 60%;
    right: 20%;
    animation-delay: 2s;
}

.decoration-circle:nth-child(3) {
    width: 80px;
    height: 80px;
    top: 40%;
    right: 5%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Responsive */
@media (max-width: 992px) {
    .hero-content-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-main-content h1 {
        font-size: 2.8rem;
    }

    .hero-cta-buttons {
        justify-content: center;
    }

    .quick-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-main-content h1 {
        font-size: 2.2rem;
    }

    .hero-cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-benefits {
        grid-template-columns: 1fr;
    }

    .quick-stats {
        grid-template-columns: 1fr;
    }

    .hero-calculator-preview {
        padding: 25px;
    }
}

@media (max-width: 576px) {
    .presupuesto-hero {
        padding: 60px 0;
    }

    .hero-main-content h1 {
        font-size: 1.8rem;
    }

    .hero-main-content .subtitle {
        font-size: 1.1rem;
    }
}

/* ---------------------------------- Presupuesto ---------------------------------- */
/* ---------------------------------- Presupuesto ---------------------------------- */
/* ---------------------------------- Presupuesto ---------------------------------- */
/* ---------------------------------- Presupuesto ---------------------------------- */
/* ---------------------------------- Presupuesto ---------------------------------- */

.presupuesto-intro {
    text-align: center;
    padding: 3rem 0;
    background: white;
    margin: 2rem 0;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.presupuesto-intro h2 {
    color: #1e3c72;
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.presupuesto-intro p {
    font-size: 1.1rem;
    color: #666;
}

/* Sección de descuentos */
.descuentos-info {
    margin: 2rem 0;
}

.descuentos-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.descuentos-card h3 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.descuentos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.descuento-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

.descuento-item:hover {
    transform: translateY(-5px);
}

.descuento-item.destacado {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.descuento-item .cantidad {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.descuento-item .porcentaje {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
}

/* Layout de dos columnas */
.presupuesto-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    margin: 2rem 0;
    align-items: start;
}

/* Columna de productos */
.productos-columna {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    height: fit-content;
}

/* Filtros */
.filtros-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.filtros-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: end;
}

.filtro-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #1e3c72;
    font-weight: 600;
    font-size: 0.9rem;
}

.filtro-group select,
.filtro-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.filtro-group select:focus,
.filtro-group input:focus {
    outline: none;
    border-color: #1e3c72;
}

/* ---------------------------------- Productos ----------------------------- */
/* ---------------------------------- Productos ----------------------------- */
/* ---------------------------------- Productos ----------------------------- */
/* ---------------------------------- Productos ----------------------------- */
/* ---------------------------------- Productos ----------------------------- */

/* Estilos para el indicador de carga (Spinner) */
.loader {
  border: 6px solid #f3f3f3; /* Gris claro */
  border-top: 6px solid #0d2b62; /* Azul principal */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 50px auto; /* Para centrarlo */
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.productos-section h3 {
    color: #1e3c72;
    font-size: 1.5rem;
    margin: 1.5rem;
    margin-bottom: 1rem;
}

.productos-lista {
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.producto-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.producto-item:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

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

.producto-sku {
  font-size: 0.8rem;
  color: #888;
  margin-top: 4px;
}

.producto-imagen {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 1rem;
    border: 2px solid #e0e0e0;
    flex-shrink: 0;
}

.producto-imagen-placeholder {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border-radius: 8px;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.producto-detalles {
    flex-grow: 1;
    min-width: 0;
}

.producto-nombre {
    font-size: 1rem;
    font-weight: 600;
    color: #1e3c72;
    margin-bottom: 0.3rem;
}

.producto-rubro {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-bottom: 0.3rem;
}

.producto-precio-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.producto-precio {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2e7d32;
}

.producto-unidad {
    color: #666;
    font-size: 0.8rem;
}

.btn-agregar {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-left: 1rem;
    flex-shrink: 0;
}

.btn-agregar:hover {
    background: linear-gradient(135deg, #2a5298, #1e3c72);
    transform: translateY(-2px);
}

/* Columna del presupuesto */
.presupuesto-columna {
    position: sticky;
    top: 2rem;
}

.mi-presupuesto {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
}

.presupuesto-header {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.presupuesto-header h3 {
    font-size: 1.3rem;
    margin: 0;
}

.btn-limpiar {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-limpiar:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.presupuesto-contenido {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Items del presupuesto */
.presupuesto-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    max-height: 40vh;
}

.presupuesto-item {
    padding: 1.2rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.presupuesto-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.presupuesto-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.presupuesto-item-nombre {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e3c72;
    margin: 0;
    flex-grow: 1;
    line-height: 1.3;
}

.btn-eliminar {
    background: #d32f2f;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-left: 1rem;
    transition: all 0.3s ease;
}

.btn-eliminar:hover {
    background: #c62828;
    transform: scale(1.1);
}

.presupuesto-item-detalles {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
}

.presupuesto-item-precio {
    color: #2e7d32;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
}

.precio-unitario {
    font-size: 0.85rem;
    color: #666;
}

.cantidad-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.cantidad-control label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.cantidad-input-group {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.cantidad-input-group:focus-within {
    border-color: #1e3c72;
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
}

.cantidad-input-group .btn-cantidad {
    background: #1e3c72;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cantidad-input-group .btn-cantidad:hover {
    background: #2a5298;
}

.cantidad-input-group .btn-cantidad:active {
    background: #1a2f5f;
}

.cantidad-input {
    border: none;
    width: 50px;
    height: 32px;
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    color: #1e3c72;
    background: transparent;
}

.cantidad-input:focus {
    outline: none;
    background: #f8f9fa;
}

.cantidad-input::-webkit-outer-spin-button,
.cantidad-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cantidad-input[type=number] {
    -moz-appearance: textfield;
}

.presupuesto-item-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.total-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.2rem;
}

.total-valor {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2e7d32;
}

/* Resumen del presupuesto */
.presupuesto-resumen {
    padding: 1.5rem;
    border-top: 2px solid #e0e0e0;
    flex-shrink: 0;
    background: #f8f9fa;
}

.descuento-aplicado {
    background: #e8f5e8;
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.descuento-aplicado i {
    color: #2e7d32;
}

.totales-presupuesto {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    font-size: 1rem;
}

.descuento-row {
    color: #d32f2f;
}

.total-final {
    border-top: 2px solid #1e3c72;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    font-size: 1.2rem;
    color: #1e3c72;
    font-weight: bold;
}

.acciones-presupuesto {
    display: flex;
    gap: 0.8rem;
}

.acciones-presupuesto button {
    flex: 1;
    font-size: 0.9rem;
    padding: 0.8rem;
}

/* Estado vacío */
.presupuesto-vacio {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.presupuesto-vacio i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

.presupuesto-vacio p {
    font-size: 1rem;
}

/* Botones */
.btn-primario {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primario:hover {
    background: linear-gradient(135deg, #2a5298, #1e3c72);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
}

.btn-secundario {
    background: #6c757d;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-secundario:hover {
    background: #5a6268;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-whatsapp:hover {
    background: #1da851;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 8% auto;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.close {
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 1.5rem;
}

.producto-modal-info {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.producto-modal-imagen {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    margin-right: 1rem;
    border: 2px solid #e0e0e0;
}

.producto-modal-detalles h4 {
    color: #1e3c72;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.producto-modal-detalles p {
    color: #2e7d32;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.producto-modal-detalles small {
    color: #666;
    font-size: 0.9rem;
}

.cantidad-selector {
    margin-bottom: 1.5rem;
}

.cantidad-selector label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: #1e3c72;
    font-size: 1rem;
}

.cantidad-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.cantidad-controls .btn-cantidad {
    background: #1e3c72;
    color: white;
    border: none;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: bold;
    transition: all 0.2s;
}

.cantidad-controls .btn-cantidad:hover {
    background: #2a5298;
    transform: scale(1.05);
}

#cantidadInput {
    width: 80px;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
}

#cantidadInput:focus {
    outline: none;
    border-color: #1e3c72;
}

.modal-acciones {
    display: flex;
    gap: 1rem;
}

.modal-acciones button {
    flex: 1;
}

/* Estilos para el Selector de Lista de Precios */
.selector-precios {
    padding: 1rem 1.5rem 0.5rem 1.5rem; /* Espaciado */
    background: #f8f9fa; /* Fondo claro */
    border-top: 1px solid #eee;
}

.selector-precios label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--azul-principal);
    font-weight: 600;
    font-size: 0.9rem;
}

.selector-precios select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'League Spartan', sans-serif;
    cursor: pointer;
    background-color: white;
}

.selector-precios select:focus {
    outline: none;
    border-color: var(--azul-principal);
}

/* --- Estilos para el Modal de Vista Previa --- */
/* --- Estilos para el Modal de Vista Previa --- */
/* --- Estilos para el Modal de Vista Previa --- */
/* --- Estilos para el Modal de Vista Previa --- */
/* --- Estilos para el Modal de Vista Previa --- */

.modal-content.preview-content {
    max-width: 50%;
    padding: 0;
}

.preview-layout {
    display: flex;
    flex-direction: row;
}

.preview-galeria {
    flex-basis: 50%;
    position: relative;
    background-color: #f1f1f1;
}

.slider-container {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Proporción 1:1 */
    overflow: hidden;
}

.slider-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* 'contain' para que se vea completo */
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slider-img.active {
    opacity: 1;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(13, 43, 98, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    padding: 15px;
    font-size: 20px;
    z-index: 10;
    transition: background-color 0.3s;
}
.slider-btn:hover { background-color: #0d2b62; }
.prev { left: 10px; }
.next { right: 10px; }

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: #bbb;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}
.dot.active { background-color: #0d2b62; }

.preview-detalles {
    flex-basis: 50%;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

#previewNombre {
    color: #0d2b62;
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 15px;
}

#previewDescripcion {
    font-size: 1rem;
    color: #666;
    flex-grow: 1; /* Empuja las acciones hacia abajo */
    margin-bottom: 20px;
}

.preview-precio-sku {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-bottom: 20px;
}

#previewPrecio { font-size: 1.8rem; }

.preview-acciones {
    display: flex;
    gap: 20px;
    align-items: center;
}

.preview-acciones .btn-agregar {
    flex-grow: 1;
    padding: 1rem;
    font-size: 1rem;
}

/* Responsive para el modal */
@media (max-width: 768px) {
    .preview-layout { flex-direction: column; }

    .modal-content.preview-content {
    max-width: 80%;
    }
    
    .preview-acciones {
    display: column;
    gap: 20px;
    align-items: center;
    }   
}

/* Distintivo en la lista de productos */
.producto-personalizable-badge {
  display: inline-block;
  background-color: #e3f2fd; /* Un azul muy claro */
  color: #0d2b62; /* Azul principal */
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 5px;
}

.producto-personalizable-badge i {
  margin-right: 5px;
}

/* Mensaje destacado en el modal de vista previa */
.personalizable-info {
  display: none; /* Oculto por defecto */
  background-color: #fef9e7; /* Un amarillo muy claro */
  border-left: 4px solid #f1c40f; /* Borde amarillo */
  padding: 15px;
  margin: 15px 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.personalizable-info i {
  font-size: 1.8rem;
  color: #f1c40f;
}

.personalizable-info h4 {
  margin: 0 0 5px 0;
  color: #b7950b;
}

.personalizable-info p {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

/* =================================== Modal para envio del carrito ====================================================== */
/* =================================== Modal para envio del carrito ====================================================== */
/* =================================== Modal para envio del carrito ====================================================== */

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #1e3c72;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #1e3c72;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .presupuesto-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .presupuesto-columna {
        position: static;
        order: -1;
    }
    
    .mi-presupuesto {
        max-height: 60vh;
    }
    
    .presupuesto-items {
        max-height: 30vh;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .logo-section h1 {
        font-size: 2rem;
    }
    
    .presupuesto-intro h2 {
        font-size: 1.8rem;
    }
    
    .descuentos-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    
    .filtros-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .producto-item {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem 1rem;
    }
    
    .producto-imagen,
    .producto-imagen-placeholder {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .producto-precio-info {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .btn-agregar {
        margin-left: 0;
        width: 100%;
    }
    
    .presupuesto-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .presupuesto-item-controles {
        justify-content: center;
        width: 100%;
    }
    
    .acciones-presupuesto {
        flex-direction: column;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
    
    .producto-modal-info {
        flex-direction: column;
        text-align: center;
    }
    
    .producto-modal-imagen {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .modal-acciones {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .logo-section h1 {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .descuentos-grid {
        grid-template-columns: 1fr;
    }
    
    .presupuesto-intro {
        padding: 2rem 1rem;
    }
    
    .descuentos-card,
    .filtros-section,
    .presupuesto-contenido {
        padding: 1rem;
    }
    
    .cantidad-controls {
        gap: 0.5rem;
    }
    
    .cantidad-controls .btn-cantidad {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    #cantidadInput {
        width: 70px;
        font-size: 1.1rem;
    }
}

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

.producto-item,
.presupuesto-item {
    animation: fadeIn 0.3s ease;
}

/* Mejoras de accesibilidad */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #1e3c72;
    outline-offset: 2px;
}

.btn-cantidad:focus {
    outline: 2px solid white;
}

/* Scrollbar personalizado */
.productos-lista::-webkit-scrollbar,
.presupuesto-items::-webkit-scrollbar {
    width: 8px;
}

.productos-lista::-webkit-scrollbar-track,
.presupuesto-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.productos-lista::-webkit-scrollbar-thumb,
.presupuesto-items::-webkit-scrollbar-thumb {
    background: #1e3c72;
    border-radius: 4px;
}

.productos-lista::-webkit-scrollbar-thumb:hover,
.presupuesto-items::-webkit-scrollbar-thumb:hover {
    background: #2a5298;
}
    
/* Estilos para el modal de éxito */
.exito-mensaje {
  text-align: center;
  margin-bottom: 2rem;
}

.exito-mensaje i.fa-check-circle {
  font-size: 4rem;
  color: #27ae60;
}

.exito-mensaje p {
  font-size: 1.1rem;
  margin: 1rem 0;
  color: #333;
}

.exito-mensaje h4 {
  font-size: 1.2rem;
  color: #0d2b62;
  margin-top: 1.5rem;
}

/* ========================================================= */
/* --- MEJORAS RESPONSIVE Y DE ESTILO (OCTUBRE 2025) --- */
/* ========================================================= */

/* 1. Solución para que el modal no se corte en pantallas chicas */
.modal-content.preview-content {
    max-height: 90vh; /* Altura máxima del 90% de la pantalla */
    display: flex;
    flex-direction: column;
}

.preview-layout {
    overflow-y: auto; /* Permite scroll DENTRO del contenido si es necesario */
}

/* 2. Estilos para el selector de cantidad en el modal de preview */
.preview-acciones .cantidad-selector {
    margin-bottom: 0; /* Quitamos el margen inferior que tenía */
}

.preview-acciones .cantidad-controls {
    /* Reutilizamos el estilo de los botones pequeños de cantidad */
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.preview-acciones .btn-cantidad {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    border-radius: 0;
}

#previewCantidadInput {
    height: 40px;
    width: 60px;
    border: none;
    border-left: 2px solid #ddd;
    border-right: 2px solid #ddd;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 0;
}

#previewCantidadInput:focus {
    outline: none;
}

/* Estilos para el nuevo layout del item de producto en la lista */
.producto-item {
    cursor: pointer; /* Indica que todo el item es clickeable */
}

.producto-detalles {
    padding-right: 15px; /* Espacio para que no se pegue a las acciones */
}

.producto-acciones-lista {
    margin-left: auto; /* Empuja esta columna a la derecha */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.btn-agregar-lista {
    background: #0d2b62;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
    white-space: nowrap; /* Evita que el texto se parta */
}

.btn-agregar-lista:hover {
    background: var(--naranja-acento);
}

/* ========================================================= */
/* --- REFINAMIENTOS DE DISEÑO PROFESIONAL (OCTUBRE 2025) --- */
/* ========================================================= */

/* 1. Contención para la galería de imágenes en el modal */
.preview-galeria {
    padding: 20px; /* Añade un espacio interno alrededor de la galería */
    background-color: #f8f9fa; /* Un gris muy sutil para diferenciarlo */
    position: relative;
}
.slider-container {
    border-radius: 8px; /* Redondea las esquinas del contenedor de la imagen */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Añade una sombra sutil */
}

/* 2. Botón de Agregar Minimalista (Estilo "Outline") */
#previewAgregarBtn {
    background: transparent;
    border: 2px solid var(--azul-principal);
    color: var(--azul-principal);
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

#previewAgregarBtn:hover {
    background: var(--azul-principal);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(13, 43, 98, 0.2);
}

/* 3. Estilos para la Animación 'Fly-to-Cart' */
.fly-to-cart {
    position: fixed; /* Fijo en la pantalla para que pueda volar a cualquier parte */
    border-radius: 50%; /* Lo hacemos circular mientras vuela */
    object-fit: cover;
    z-index: 1002; /* Por encima de todo, excepto quizás alguna notificación */
    transition: all 0.6s ease-in-out; /* La magia de la animación */
}

/* ========================================================= */
/* --- AJUSTES DE DISEÑO RESPONSIVE Y COMPACTO (OCTUBRE 2025) --- */
/* ========================================================= */

/* ------------------------------------------------------------------ */
/* 1. MEJORAS AL MODAL DE VISTA PREVIA EN MÓVILES */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
    /* Hacemos que las acciones (cantidad y botón) se pongan en columna */
    .preview-acciones {
        flex-direction: column;
        align-items: stretch; /* Estira los elementos al 100% del ancho */
        gap: 15px; /* Aumenta el espacio entre el selector y el botón */
    }

    /* Nos aseguramos que el selector de cantidad se vea bien */
    .preview-acciones .cantidad-selector {
        width: 100%;
        display: flex;
        justify-content: center; /* Centra el selector de cantidad */
    }
}


/* ------------------------------------------------------------------ */
/* 2. OPTIMIZACIÓN DE LA VISTA DEL PRESUPUESTO (CARRITO) */
/* ------------------------------------------------------------------ */

/* Hacemos los items del presupuesto más compactos */
.presupuesto-item {
    padding: 1rem; /* Reducimos el padding general */
}

.presupuesto-item-header {
    margin-bottom: 0.8rem; /* Menos espacio abajo del título */
}

.presupuesto-item-nombre {
    font-size: 1rem; /* Título un poco más pequeño */
}

.presupuesto-item-detalles {
    grid-template-columns: 1fr auto; /* Cambiamos a 2 columnas */
    gap: 0.5rem 1rem; /* Menos espacio entre elementos */
    grid-template-areas: 
        "precio cantidad"
        "total total";
}

/* Reubicamos los elementos en la nueva grilla */
.presupuesto-item-precio { grid-area: precio; }
.cantidad-control { grid-area: cantidad; }
.presupuesto-item-total { 
    grid-area: total;
    text-align: right; /* Alineamos el subtotal a la derecha */
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}

.total-label {
    display: none; /* Ocultamos la etiqueta "Subtotal" que es redundante */
}

.total-valor {
    font-size: 1.1rem; /* Tamaño del subtotal */
}

/* Achicamos la sección de totales para dar más espacio a la lista */
.presupuesto-resumen {
    padding: 1rem; /* Menos padding */
}

.totales-presupuesto {
    padding: 0.8rem; /* Menos padding */
    margin-bottom: 1rem; /* Menos margen */
}

.total-row {
    font-size: 0.9rem; /* Texto de totales más pequeño */
    padding: 0.3rem 0;
}

.total-final {
    font-size: 1.1rem; /* Total final un poco más pequeño */
}

/* ========================================================= */
/* --- ESTILO MINIMALISTA PARA BOTÓN ACTUALIZAR (OCT 2025) --- */
/* ========================================================= */

.desktop-nav button.nav-link {
    /* Reseteamos y definimos la forma */
    background-color: var(--azul-principal);
    border: 1px solid rgba(255, 255, 255, 0.4); /* Borde sutil */
    border-radius: 20px; /* Forma de píldora horizontal */
    
    /* Lo hacemos más pequeño ("chiquito") */
    padding: 6px 15px; /* Menos padding vertical, más horizontal */
    font-size: 0.9rem; /* Texto ligeramente más pequeño */
    
    /* Alineación y espaciado */
    margin-left: 15px; /* Separa el botón de los otros links */
    vertical-align: middle; /* Asegura la alineación vertical con los otros links */
    
    /* Mantenemos la consistencia */
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.desktop-nav button.nav-link:hover {
    /* Efecto hover claro y elegante */
    background-color: var(--naranja-acento);
    border-color: var(--naranja-acento);
    color: white;
    transform: scale(1.05); /* Un pequeño "pop" al pasar el mouse */
}

.desktop-nav button.nav-link i {
    margin-right: 6px; /* Espacio justo para el ícono */
}