/**
 * Norma Hana - Centro de Preferencias de Comunicación y Privacidad
 * Editorial Luxury UI & UX Stylesheet (WooCommerce Native Match)
 *
 * @package NH_Core
 */

/* =========================================================================
 * 01. NAVEGACIÓN MI CUENTA (Icono Phosphor de seguridad)
 * ========================================================================= */

.woocommerce-account .woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--preferencias a:before {
    font-family: 'Phosphor' !important;
    content: "\E434" !important;
    margin-right: 20px;
    font-size: 1.2em;
}

/* =========================================================================
 * 02. CONTENEDOR UNIFICADO EDITORIAL (Estilo Tarjeta WooCommerce)
 * ========================================================================= */

.nh-preferences-wrapper {
    background: #ffffff;
    border: 1px solid #edebe7;
    border-radius: 8px;
    padding: 36px 40px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #1a1918;
    box-sizing: border-box;
    width: 100%;
}

.nh-preferences-wrapper *,
.nh-preferences-wrapper *::before,
.nh-preferences-wrapper *::after {
    box-sizing: border-box;
}

/* =========================================================================
 * 03. CABECERA EDITORIAL Y JERARQUÍA TIPOGRÁFICA
 * ========================================================================= */

.nh-preferences-header {
    margin-bottom: 24px;
}

.nh-preferences-tag {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8c7335;
    font-weight: 600;
    margin-bottom: 6px;
}

.nh-preferences-title {
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: 26px;
    font-weight: 500;
    margin: 0 0 8px 0;
    color: #1a1918;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.nh-preferences-subtitle {
    font-size: 14px;
    line-height: 1.6;
    color: #55514e;
    margin: 0 0 18px 0;
}

.nh-preferences-email-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #faf7f2;
    border: 1px solid #edebe7;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12.5px;
    color: #736e68;
    margin-top: 2px;
}

.nh-preferences-email-meta .nh-pref-meta-icon {
    color: #8c7335;
    flex-shrink: 0;
}

.nh-preferences-email-meta .nh-pref-meta-label {
    color: #736e68;
}

.nh-preferences-email-meta .nh-pref-meta-value {
    color: #1a1918;
    font-weight: 600;
}

/* =========================================================================
 * 04. FILAS EDITORIALES CON DIVISORES SUTILES
 * ========================================================================= */

.nh-pref-row {
    padding: 20px 0;
    border-bottom: 1px solid #f2efe9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    transition: opacity 0.25s ease;
}

.nh-pref-row:first-of-type {
    border-top: 1px solid #f2efe9;
    margin-top: 24px;
}

.nh-pref-row--vertical {
    flex-direction: column;
    align-items: flex-start;
}

.nh-pref-row-info {
    flex: 1;
}

.nh-pref-row-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1918;
    margin: 0 0 4px 0;
    line-height: 1.35;
}

.nh-pref-row-desc {
    font-size: 13px;
    line-height: 1.55;
    color: #55514e;
    margin: 0;
}

.nh-pref-row--dimmed,
.nh-pref-card--dimmed {
    opacity: 0.45;
    pointer-events: none;
}

/* =========================================================================
 * 05. SWITCHES DE LUJO (42PX X 22PX)
 * ========================================================================= */

.nh-pref-row-control {
    flex-shrink: 0;
}

.nh-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.nh-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.nh-slider {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    background-color: #ded9d2;
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 22px;
}

.nh-slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    top: 3px;
    background-color: #ffffff;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(26, 25, 24, 0.18);
}

.nh-switch input:checked + .nh-slider {
    background-color: #1a1918;
}

.nh-switch input:checked + .nh-slider::before {
    transform: translateX(20px);
}

.nh-switch input:focus-visible + .nh-slider {
    outline: 2px solid #8c7335;
    outline-offset: 3px;
}

/* =========================================================================
 * 06. SELECTOR DE CANAL PREFERIDO (PILLS SEGMENTADAS)
 * ========================================================================= */

.nh-channel-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    margin-top: 14px;
}

.nh-channel-option {
    display: block;
    margin: 0;
    cursor: pointer;
}

.nh-channel-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.nh-channel-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #edebe7;
    border-radius: 6px;
    text-align: center;
    background-color: #faf7f2;
    color: #4a4744;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.nh-channel-box .nh-channel-svg {
    color: #736e68;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.nh-channel-box .nh-channel-label {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
}

.nh-channel-option:hover .nh-channel-box {
    border-color: #c8c3b9;
    background-color: #f4efe7;
}

.nh-channel-option input:checked + .nh-channel-box {
    border-color: #1a1918;
    background-color: #1a1918;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(26, 25, 24, 0.12);
}

.nh-channel-option input:checked + .nh-channel-box .nh-channel-svg {
    color: #ffffff;
}

.nh-channel-option input:checked + .nh-channel-box .nh-channel-label {
    color: #ffffff;
    font-weight: 600;
}

.nh-channel-option input:focus-visible + .nh-channel-box {
    outline: 2px solid #8c7335;
    outline-offset: 2px;
}

/* =========================================================================
 * 07. TARJETA LEGAL & HABEAS DATA (LEY 1581 DE 2012)
 * ========================================================================= */

.nh-habeas-card {
    background: #faf7f2;
    border-left: 3px solid #8c7335;
    padding: 18px 20px;
    border-radius: 6px;
    margin-top: 24px;
}

.nh-habeas-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1918;
    margin: 0 0 6px 0;
    line-height: 1.35;
}

.nh-habeas-desc {
    font-size: 12.5px;
    line-height: 1.55;
    color: #736e68;
    margin: 0 0 14px 0;
}

.nh-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 24px;
    cursor: pointer;
    font-size: 13px;
    color: #1a1918;
    font-weight: 500;
    margin: 0;
    user-select: none;
}

.nh-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1a1918;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.nh-checkbox-label input[type="checkbox"]:focus-visible {
    outline: 2px solid #8c7335;
    outline-offset: 2px;
}

.nh-checkbox-text {
    line-height: 1.4;
}

/* =========================================================================
 * 08. ACCIONES Y BOTÓN PRIMARIO DE WOOCOMMERCE
 * ========================================================================= */

.nh-preferences-actions {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.nh-btn-save-prefs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1918;
    color: #ffffff;
    border: none;
    min-height: 46px;
    padding: 14px 32px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.25s ease, opacity 0.25s ease, transform 0.15s ease;
}

.nh-btn-save-prefs:hover {
    background-color: #33312e;
    color: #ffffff;
}

.nh-btn-save-prefs:active {
    transform: scale(0.99);
}

.nh-btn-save-prefs:focus-visible {
    outline: 2px solid #8c7335;
    outline-offset: 3px;
}

.nh-btn-save-prefs:disabled {
    background-color: #736e68;
    cursor: not-allowed;
    opacity: 0.75;
}

.nh-prefs-feedback {
    font-size: 13.5px;
    line-height: 1.4;
    min-height: 20px;
    transition: opacity 0.3s ease;
}

.nh-prefs-feedback--success {
    color: #2d6a4f;
    font-weight: 500;
}

.nh-prefs-feedback--error {
    color: #c9184a;
    font-weight: 500;
}

/* =========================================================================
 * 09. ADAPTACIÓN RESPONSIVA (MÓVIL Y TABLET)
 * ========================================================================= */

@media (max-width: 640px) {
    .nh-preferences-wrapper {
        padding: 24px 20px;
    }

    .nh-preferences-title {
        font-size: 23px;
    }

    .nh-pref-row {
        padding: 16px 0;
    }

    .nh-channel-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .nh-channel-box {
        justify-content: flex-start;
        padding: 12px 16px;
    }

    .nh-btn-save-prefs {
        width: 100%;
    }

    .nh-preferences-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
