@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
}

.estimacion-panel {
    background-color: #F7F7F7;
    padding: 30px 15px;
    min-height: calc(100vh - 140px); /* Ocupa la mayor parte de la pantalla */
}

/* 1. LAYOUT PRINCIPAL (FORMULARIO Y CONTENIDO DERECHO) */
.content-panel {
    display: flex;
    gap: 16px;
    align-items: stretch;
    margin: 0 auto;
    max-width: 1200px;
}

/* 2. CONTENEDOR DE LA DERECHA (RESUMEN Y TARJETA APILADOS) */
.right-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0; /* Para que el contenido pueda contraerse y no crear overflow */
    min-height: 520px; /* Garantiza altura mínima para usar espacio en blanco */
}

#resultados-envio {
    flex: 1 1 auto;
    min-height: 240px; /* evita hueco visible en panel izquierdo-derecho */
    max-height: none;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#contenido-factura {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 520px;
}

.resultados-empty {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* ---------------------------------------------------- */
/* 3. LEFT PANEL (Formulario) STYLES */
/* ---------------------------------------------------- */

.left-panel {
    flex: 0 0 360px;
    max-width: 360px;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.left-panel h2 {
    font-size: 20px;
    font-weight: 500;
    color: #333333;
    margin-bottom: 14px;
}

.form-group-duo {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.form-field {
    flex: 1;
}

label {
    display: block;
    font-size: 14px;
    color: #666666;
    margin-bottom: 8px;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cccccc;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    color: #333333;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.cotizacion-button {
    background-color: #333333 !important;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.cotizacion-button:hover {
    background-color: #f6891f;
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}


/* ---------------------------------------------------- */
/* 4. RIGHT PANEL (RESUMEN DE ESTIMACIÓN) STYLES */
/* ---------------------------------------------------- */

.right-panel {
    flex-grow: 1;
    padding: 22px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    min-height: 560px;
    max-height: none;
    height: auto;
}

.right-panel h2 {
    font-size: 22px;
    font-weight: 500;
    color: #333333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 16px;
    margin-bottom: 14px;
}

.summary-table {
    width: 100%;
    align-items: center;
    text-align: center;
    margin: 10px;
}

.summary-header,
.summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 5px 0;
    font-size: 0.9em;
}

.summary-header span {
    color: #A7ACB1;
    font-weight: 500;
}

.total-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-top: 1px solid #ddd;
    padding-top: 16px;
    width: 100%;
    margin-top: 8px;
}

.total-section>span:first-child {
    font-size: 16px;
    font-weight: 500;
    color: #333333;
    margin-bottom: 6px;
}

.total-amount {
    font-size: 30px;
    font-weight: 700;
    color: #333333;
}


/* ---------------------------------------------------- */
/* 5. TARJETA DE ENVÍO (COLAPSABLE) STYLES CORREGIDOS */
/* ---------------------------------------------------- */

.shipping-card-container {
    width: 100%;
    margin: 0 auto;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: white;
    overflow: hidden;
    cursor: pointer;
    opacity: 1;
    transform: translateY(0);
    transition: box-shadow 0.3s ease, transform 0.35s ease, opacity 0.35s ease;
}

.shipping-card-container.new-item {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
}

.shipping-card-container.new-item.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.resultados-empty {
    text-align: center;
    border: 1px dashed #ccc;
    background-color: #fcfcfc;
    padding: 18px;
    border-radius: 12px;
    margin: 0 auto;
    width: min(100%, 100%);
    color: #555;
}

.resultados-empty h3 {
    margin-bottom: 8px;
    font-size: 1rem;
}

.resultados-empty p {
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #666;
}

/* VISTA COLAPSADA (DEFAULT) - ¡CORRECCIÓN DE ESTILO APLICADA! */
.shipping-card-container.collapsed .view-collapsed {
    display: flex; 
    align-items: center;
    padding: 10px; /* <--- Esto asegura que la tarjeta se vea bien cerrada */
}

/* OCULTAR vista expandida cuando está colapsado */
.shipping-card-container.collapsed .view-expanded {
    display: none;
}

/* VISTA EXPANDIDA (Cuando NO tiene la clase .collapsed) */
.shipping-card-container:not(.collapsed) .view-expanded {
    display: block; 
}

/* OCULTAR vista colapsada cuando está expandido */
.shipping-card-container:not(.collapsed) .view-collapsed {
    display: none;
}


/* ESTILOS DE LA VISTA COLAPSADA */
.view-collapsed .icon-container {
    background-color: #FEE7C8;
    border-radius: 12px;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
}

.view-collapsed .airplane-icon {
    color: #E68A00;
    font-size: 30px;
    transform: rotate(320deg);
}

.view-collapsed .details {
    flex-grow: 1;
}

.view-collapsed .name {
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.view-collapsed .weight {
    font-size: 0.9em;
    color: #888;
}

.view-collapsed .price-action {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.view-collapsed .price {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-right: 15px;
}

.view-collapsed .close-btn {
    background-color: #E0E0E0;
    color: #777;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    padding-bottom: 2px;
}

/* ESTILOS DE LA VISTA DESPLEGADA */

.card-header-expanded {
    background-color: #FF8C00;
    display: flex;
    align-items: center;
    padding: 10px;
}

.card-header-expanded .icon-container-header {
    background-color: #FEE7C8;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
}

.card-header-expanded .airplane-icon-header {
    color: #E68A00;
    font-size: 24px;
    transform: rotate(320deg);
}

.card-header-expanded .name-header {
    font-size: 1.1em;
    font-weight: bold;
    color: white;
    flex-grow: 1;
}

.card-header-expanded .toggle-btn {
    background-color: rgba(255, 255, 255, 0.5);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 5px;
    border: none;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-details-expanded {
    padding: 15px 20px;
}

.card-details-expanded .detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95em;
    color: #555;
}

.card-details-expanded .label {
    font-weight: 500;
}

.card-details-expanded .detail-total-row {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid #eee;
    color: black;
}

.card-details-expanded .value-total {
    font-size: 1.6em;
    font-weight: bold;
}

/* ---------------------------------------------------- */
/* 6. MEDIA QUERIES (RESPONSIVE) */
/* ---------------------------------------------------- */

@media (max-width: 992px) {
    .content-panel {
        flex-direction: column;
        padding: 0 20px;
    }

    .left-panel {
        position: static;
        flex: 1;
        width: 100%;
    }

    .right-content-wrapper {
        width: 100%;
    }

    .right-panel {
        padding: 30px 20px;
    }

    .summary-table,
    .total-section {
        max-width: 100%;
    }

    .shipping-card-container {
        max-width: 100%;
        margin: 0 auto;
    }
}

@media (max-width: 576px) {

    .left-panel,
    .right-panel {
        padding: 20px;
    }

    .form-group-duo {
        flex-direction: column;
        gap: 0;
    }
}

/* Extras estilos pequeños del segundo bloque */
.link-terminos {
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease-in-out;
}

.link-terminos:hover {
    color: #0056b3;
    text-decoration: underline;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    height: auto;
    margin: 20px auto;
}

.carousel-item {
    width: 100%;
    flex-shrink: 0;
    display: none;
    text-align: center;
}

.carousel-item.active {
    display: block;
}

.carousel-item img {
    animation: float 3s ease-in-out infinite;
    max-width: 70%;
    height: auto;
    object-fit: cover;
    margin: 0 auto 15px auto;
}

.carousel-text {
    margin-top: 10px;
    font-size: 1rem;
    color: #333;
}

.swal2-confirm.swal2-styled {
    background-color: #000000ff !important;
    border: 0 !important;
    box-shadow: none !important;
}

.swal2-title {
    color: #000000ff !important;
}
