/* ========================================
   TRACKING PÚBLICO - ESTILOS ORGANIZADOS
   ======================================== */

/* Variables */
:root {
    --sonepar-blue: #004a99;
    --sonepar-orange: #ff6600;
    --sonepar-red: #e30613;
    --primary-color: #253785;
    --light-gray: #f5f5f5;
    --border-gray: #e1e7ec;
    --text-gray: #606975;
}

/* ========================================
   1. SECCIÓN DE BÚSQUEDA
   ======================================== */

.order-tracking-section {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
}

.z-index-content {
    position: relative;
    z-index: 10;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 1;
    z-index: 0;
}

.tracking-tittle {
    font-size: 3.8rem;
}

.tracking-subtitle {
    margin-top: -10px;
    font-size: 3.5rem;
    font-weight: 900;
}

/* Contenedor del buscador */
.search-container {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto 2rem auto;
    margin-top: 4.2rem;
}

.search-container .input-group input {
    border-radius: 50px !important;
    font-size: 1.2rem;
}

.input-group-append button {
    border-left: none !important;
    border: none;
}

.btn-search,
.search-button {
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--dark-blue);
    color: white !important;
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 9px 34px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 20px;
}

.search-button:hover {
    background-color: #1e3a6f;
}

.search-button:active {
    transform: translateY(-50%) scale(0.98);
}

/* ========================================
   2. PASOS DE TRACKING (STEPS)
   ======================================== */

.card-body {
    display: block;
}

.steps {
    display: flex;
}

.steps .step {
    display: block;
    width: 100%;
    margin-bottom: 35px;
    text-align: center;
}

.steps .step .step-icon-wrap {
    display: flex;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 50px;
    text-align: center;
}

.steps .step .step-icon-wrap::before,
.steps .step .step-icon-wrap::after {
    display: block;
    position: absolute;
    top: 50%;
    width: 50%;
    height: 3px;
    margin-top: -1px;
    background-color: var(--border-gray);
    content: '';
    z-index: 1;
}

.steps .step .step-icon-wrap::before {
    left: 0;
}

.steps .step .step-icon-wrap::after {
    right: 0;
}

.steps .step:first-child .step-icon-wrap::before {
    display: none;
}

.steps .step:last-child .step-icon-wrap::after {
    display: none;
}

.step-preparing-custom::before {
    display: none !important;
}

.div-step-preparing-total-custom {
    width: 3px;
    height: 32px;
    background: var(--primary-color);
    position: relative;
    top: -28px;
    right: -22%;
}

/* Iconos de los pasos */
.steps .step .step-icon {
    display: flex;
    position: relative;
    width: 50px;
    height: 50px;
    border: 1px solid var(--border-gray);
    border-radius: 50%;
    background-color: var(--light-gray);
    color: #374250;
    font-size: 38px;
    line-height: 81px;
    z-index: 5;
}

.steps .step .step-icon .icon {
    margin: auto;
    width: 50px;
    height: 50px;
}

/* Títulos de los pasos */
.steps .step .step-title {
    margin-top: 16px;
    margin-bottom: 0;
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 500;
}

/* Estados completados */
.steps .step.completed .step-icon-wrap::before,
.steps .step.completed .step-icon-wrap::after {
    background-color: var(--primary-color);
}

.steps .step.completed .step-icon {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: #000;
}

/* Estilos para SVG */
.steps .step.completed .step-icon img {
    color: white;
    filter: brightness(0) invert(1);
}

.steps .step:not(.completed) .step-icon img {
    color: #999;
    filter: invert(0.3);
}

/* Estados cancelados */
.step-custom-canceled {
    color: white;
    background-color: red;
    padding: .2rem .4rem;
    border-radius: 15px;
}

/* ========================================
   3. TABLA DE RESUMEN
   ======================================== */

.table-custom {
    background-color: white;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-custom thead {
    background-color: var(--primary-color);
    color: white;
}

.table-custom thead th {
    background-color: var(--primary-color);
    color: #fff;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    border: none;
    padding: 12px 14px;
}

.table-custom thead th:first-child {
    border-radius: 10px 0 0 0;
}

.table-custom thead th:last-child {
    border-radius: 0 10px 0 0;
}

.table-custom tbody td {
    font-size: 0.86rem;
    padding: 10px 14px;
    vertical-align: middle;
    border-color: #f2f3f8;
    color: #444;
}

.summary-row {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* ========================================
   4. DETALLES ADICIONALES
   ======================================== */

.details-inbox-custom {
    display: none;
    gap: 1rem;
}

.details-custom {
    height: fit-content;
}

.bg-faded,
.bg-secondary {
    background-color: var(--light-gray) !important;
}

/* ========================================
   5. RESPONSIVE - MÓVIL (max-width: 768px)
   ======================================== */

@media (max-width: 768px) {
    /* Títulos */
    .tracking-tittle {
        font-size: 2.8rem;
    }

    .tracking-subtitle {
        font-size: 2.5rem;
    }

    /* Buscador */
    .search-container {
        max-width: 330px;
    }

    /* Contenedor de pasos */
    .card-body {
        display: flex;
        flex-direction: row-reverse;
        align-items: center;
        margin: auto;
        gap: 36px;
    }

    /* Pasos en móvil */
    .steps {
        display: block;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
        gap: 20px;
    }

    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
        flex: 1;
        max-width: 140px;
        padding: 0;
    }

    .steps .step .step-icon-wrap::before {
        left: 0;
        display: none;
    }

    .steps .step .step-icon-wrap::after {
        right: auto;
    }

    .steps .step .step-icon-wrap::before,
    .steps .step .step-icon-wrap::after {
        top: 22%;
        width: 3px;
        height: 238%;
    }

    .steps .step .step-title {
        position: relative;
        z-index: 1;
        background: #fff;
        margin-top: 1px !important;
    }

    /* Iconos en móvil */
    .step-icon {
        scale: 1 !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .step-icon .icon {
        display: none;
    }

    /* Checkmarks en móvil */
    .steps .step.completed .step-icon::after {
        content: '✓';
        font-size: 32px;
        color: white;
        font-weight: bold;
    }

    .steps .step:not(.completed) .step-icon::after {
        content: '✓';
        font-size: 28px;
        color: #a0a0a0;
        font-weight: bold;
    }

    .steps .step .step-icon {
        border: 2px solid #999;
        background-color: #ffffff;
        color: #999;
    }

    .steps .step.completed .step-icon {
        border-color: var(--primary-color);
        background-color: var(--primary-color);
        color: white;
    }

    /* Línea de separación */
    .div-step-preparing-total-custom {
        width: 112px;
        height: 3px;
        background: var(--primary-color);
        position: absolute;
        top: 16px;
        right: -69%;
        z-index: 0;
    }

    /* Logo footer */
    .logo-footer {
        left: 50%;
        transform: translateX(-50%);
        width: 140px;
    }

    /* Background */
    .background-image {
        background-size: cover;
    }
}

/* ========================================
   6. RESPONSIVE - TABLET (max-width: 991px)
   ======================================== */

@media (max-width: 991px) {
    .flex-lg-nowrap .step .step-icon-wrap::before,
    .flex-lg-nowrap .step .step-icon-wrap::after {
        display: none;
    }
}

/* ========================================
   7. RESPONSIVE - DESKTOP SMALL (max-width: 1200px)
   ======================================== */

@media (max-width: 1200px) {
    .flex-xl-nowrap .step .step-icon-wrap::before,
    .flex-xl-nowrap .step .step-icon-wrap::after {
        display: none;
    }

    .steps .step .step-icon-wrap {
        height: 40px;
    }

    .steps .step .step-icon {
        width: 40px;
        height: 40px;
    }

    .steps .step .step-icon .icon {
        width: 26px;
        height: 26px;
    }

    .steps .step .step-title {
        font-size: 12px;
    }

    .details-custom {
        display: none;
    }

    .details-inbox-custom {
        display: flex;
    }
}
