/**
 * Comparativa / paquetes en landings (paginas-web, tienda-online).
 * Ancho = .sw-section (shell del sitio).
 */

.cw-pkg-compare-hint {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0 0 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.52);
}

.cw-pkg-compare-hint i {
    color: var(--neon-blue, #00f3ff);
    font-size: 0.85rem;
}

.cw-pkg-compare-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 0 1.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    border-radius: 16px;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15));
    background: var(--glass-bg, rgba(255, 255, 255, 0.05));
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 243, 255, 0.45) rgba(255, 255, 255, 0.06);
}

.cw-pkg-compare-wrap::-webkit-scrollbar {
    height: 6px;
}

.cw-pkg-compare-wrap::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

.cw-pkg-compare-wrap::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.42);
    border-radius: 999px;
}

.cw-pkg-table {
    width: 100%;
    min-width: 48rem;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
    --cw-pkg-header-bg: #111b24;
    --cw-pkg-sticky-header-bg: #0e1820;
    --cw-pkg-sticky-row-bg: #0a0a0f;
}

.cw-pkg-table th,
.cw-pkg-table td {
    padding: 0.85rem 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
}

.cw-pkg-table thead th {
    background: rgba(0, 243, 255, 0.07);
    color: rgba(255, 255, 255, 0.96);
    font-weight: 700;
}

.cw-pkg-table tbody th {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
    width: 32%;
}

.cw-pkg-table tbody tr:last-child th,
.cw-pkg-table tbody tr:last-child td {
    border-bottom: none;
    color: var(--matrix-green, #00ff9d);
    font-weight: 700;
}

.cw-pkg-table .fa-check {
    color: var(--matrix-green, #00ff9d);
}

.cw-pkg-note {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin: 1.15rem 0 1.85rem;
    padding: 1rem 1.15rem;
    border-radius: 14px;
    border: 1px solid rgba(0, 243, 255, 0.16);
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.07) 0%, rgba(255, 255, 255, 0.025) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cw-pkg-note__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 10px;
    background: rgba(0, 243, 255, 0.12);
    border: 1px solid rgba(0, 243, 255, 0.22);
    color: var(--neon-blue, #00f3ff);
    font-size: 0.95rem;
}

.cw-pkg-note__text {
    margin: 0;
    padding-top: 0.15rem;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.74);
}

.cw-pkg-note__text strong {
    color: rgba(255, 255, 255, 0.94);
    font-weight: 600;
}

@media (max-width: 768px) {
    .cw-pkg-note {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.7rem;
        margin: 0.85rem 0 1.25rem;
        padding: 1rem 1rem 1.05rem;
    }

    .cw-pkg-note__icon {
        flex-shrink: 0;
    }

    .cw-pkg-note__text {
        width: 100%;
        padding-top: 0;
        font-size: 0.84rem;
        line-height: 1.55;
        min-width: 0;
        overflow-wrap: break-word;
        word-break: normal;
        hyphens: auto;
    }
}

.cw-pkg-cards {
    margin-top: 1.35rem;
    gap: 1.35rem;
}

.cw-pkg-cards .sw-use-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 1.6rem 1.45rem 1.5rem;
}

/* Icono al lado del título cuando el primer hijo es <i> */
.cw-pkg-cards .sw-use-card:has(> i:first-child) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 0.7rem;
    row-gap: 0.4rem;
    align-items: start;
}

.cw-pkg-cards .sw-use-card:has(> i:first-child) > i:first-child {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    margin: 0;
}

.cw-pkg-cards .sw-use-card:has(> i:first-child) > h3 {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin: 0;
}

.cw-pkg-cards .sw-use-card:has(> i:first-child) > :is(p, a, .cw-pkg-btn, .cw-pkg-price, .cw-pkg-from, .web-card-btn) {
    grid-column: 1 / -1;
}

#paquete-landing,
#paquete-corporativo,
#paquete-premium,
#paquete-medida,
#paquete-starter,
#paquete-profesional,
#paquete-avanzado,
#paquete-ecom-medida {
    scroll-margin-top: calc(var(--cw-nav-h, 6rem) + 1.25rem);
}

.cw-pkg-from {
    display: inline-block;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 0 0.4rem;
    padding: 0.18rem 0.55rem;
    font-size: 0.7rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.cw-pkg-from strong {
    color: rgba(0, 243, 255, 0.95);
    font-weight: 650;
}

.cw-pkg-cards--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cw-pkg-cards--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cw-pkg-cards--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cw-pkg-card--medida {
    border-color: rgba(185, 103, 255, 0.35);
}

.cw-pkg-price {
    margin: 0.35rem 0 0.65rem;
    font-size: 1.15rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--neon-blue, #00f3ff);
}

.cw-pkg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    align-self: stretch;
    width: 100%;
    min-height: 48px;
    margin-top: 1.35rem;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    border: 1px solid rgba(37, 211, 102, 0.42);
    background: rgba(37, 211, 102, 0.1);
    color: rgba(255, 255, 255, 0.92) !important;
    font-size: 0.8125rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
    text-decoration: none !important;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.cw-pkg-btn i {
    font-size: 0.95rem !important;
    margin: 0 !important;
    color: #25d366 !important;
}

.cw-pkg-btn:hover,
.cw-pkg-btn:focus-visible {
    color: #fff !important;
    border-color: rgba(37, 211, 102, 0.58);
    background: rgba(37, 211, 102, 0.18);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.14);
    transform: translateY(-2px);
}

.cw-pkg-btn:focus-visible {
    outline: 2px solid var(--neon-blue, #00f3ff);
    outline-offset: 3px;
}

.cw-pkg-btn--medida {
    border-color: rgba(0, 243, 255, 0.48);
    background: rgba(0, 243, 255, 0.14);
}

.cw-pkg-btn--medida i {
    color: var(--neon-blue, #00f3ff) !important;
    font-size: 0.72rem !important;
}

.cw-pkg-btn--medida:hover,
.cw-pkg-btn--medida:focus-visible {
    border-color: rgba(0, 255, 157, 0.48);
    background: rgba(0, 243, 255, 0.16);
    box-shadow: 0 6px 18px rgba(0, 243, 255, 0.14);
}

@media (max-width: 1100px) {
    .cw-pkg-cards--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .cw-pkg-cards--2,
    .cw-pkg-cards--3,
    .cw-pkg-cards--4 {
        grid-template-columns: 1fr;
    }

    .cw-pkg-note {
        margin: 1rem 0 1.5rem;
        padding: 0.9rem 1rem;
    }

    .cw-pkg-note__text {
        font-size: 0.82rem;
        line-height: 1.55;
    }
}

@media (max-width: 768px) {
    .cw-pkg-compare-hint {
        display: flex;
    }

    .sw-section:has(.cw-pkg-compare-wrap) {
        min-width: 0;
        overflow-x: visible;
    }

    /*
     * Matrices de paquetes: tabla con scroll horizontal.
     * Columna “Incluye” fija + un paquete completo visible por deslizamiento (scroll-snap).
     * Hosting sigue en cards (.cw-host-compare-wrap).
     */
    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) {
        margin-bottom: 1.35rem;
        border-radius: 12px;
        isolation: isolate;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 0;
        overscroll-behavior-x: contain;
    }

    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table {
        width: max-content;
        min-width: 0 !important;
        max-width: none;
        border-collapse: separate;
        border-spacing: 0;
        font-size: 0.82rem;
        table-layout: fixed;
    }

    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table thead {
        display: table-header-group;
    }

    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table tbody {
        display: table-row-group;
    }

    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table tbody tr {
        display: table-row;
        padding: 0;
        border: none;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        gap: 0;
    }

    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table th,
    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table td {
        display: table-cell;
        vertical-align: top;
        padding: 0.75rem 0.85rem !important;
        white-space: normal !important;
        word-break: break-word;
        line-height: 1.4;
        color: inherit !important;
        font-weight: inherit !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        background-clip: padding-box;
    }

    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table tbody td::before {
        content: none !important;
        display: none !important;
    }

    /* Columna fija de filas (Incluye) */
    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table thead th:first-child,
    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table tbody th {
        position: sticky;
        left: 0;
        z-index: 3;
        width: 7.25rem;
        min-width: 7.25rem;
        max-width: 7.25rem;
        box-shadow: 6px 0 14px rgba(0, 0, 0, 0.42);
        isolation: isolate;
    }

    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table thead th:first-child {
        z-index: 4;
        background-color: var(--cw-pkg-sticky-header-bg, #0e1820) !important;
        color: rgba(255, 255, 255, 0.96) !important;
        font-weight: 700 !important;
    }

    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table tbody th {
        background-color: var(--cw-pkg-sticky-row-bg, #0a0a0f) !important;
        color: rgba(255, 255, 255, 0.92) !important;
        font-weight: 600 !important;
        font-size: 0.78rem;
    }

    /* Un módulo/paquete completo visible junto a “Incluye” */
    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table thead th:not(:first-child),
    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table tbody td {
        width: calc(100vw - 11.5rem);
        min-width: calc(100vw - 11.5rem);
        max-width: calc(100vw - 11.5rem);
        scroll-snap-align: start;
        background-color: rgba(10, 12, 18, 0.98);
    }

    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table thead th:not(:first-child) {
        background-color: var(--cw-pkg-header-bg, #111b24) !important;
        color: rgba(255, 255, 255, 0.96) !important;
        font-weight: 700 !important;
        position: relative;
        z-index: 1;
    }

    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table tbody tr:last-child th {
        background-color: var(--cw-pkg-sticky-row-bg, #0a0a0f) !important;
    }

    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table tbody tr:last-child td {
        color: var(--neon-blue, #00f3ff) !important;
        font-weight: 750 !important;
    }

    .cw-pkg-compare-wrap:not(.cw-host-compare-wrap) .cw-pkg-table .fa-check {
        margin-right: 0.25rem;
    }
}
