/* ===================================================
   CIEI Admin — Estilos frontend (Mi Cuenta WooCommerce)
   Alta especificidad para compatibilidad con Divi.
   Color CTA: #bd9000 (dorado)
   =================================================== */

/* -------------------------------------------------------
 * WooCommerce Mi Cuenta — Layout general
 * ----------------------------------------------------- */
body.woocommerce-account .woocommerce-MyAccount-navigation,
body.woocommerce-account .woocommerce-MyAccount-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* Ocultar el contenido por defecto del dashboard de WC */
body.woocommerce-account .woocommerce-MyAccount-content > p,
body.woocommerce-account .woocommerce-MyAccount-content > .woocommerce-message,
body.woocommerce-account .woocommerce-MyAccount-content > p:first-of-type,
body.woocommerce-account .woocommerce-MyAccount-content > p:nth-of-type(2) {
    display: none !important;
}

body.woocommerce-account .woocommerce-MyAccount-content .ciei-dash,
body.woocommerce-account .woocommerce-MyAccount-content .ciei-public-membership,
body.woocommerce-account .woocommerce-MyAccount-content .ciei-public-investments,
body.woocommerce-account .woocommerce-MyAccount-content .ciei-public-opportunities,
body.woocommerce-account .woocommerce-MyAccount-content .woocommerce-EditAccountForm {
    display: block !important;
}

/* -------------------------------------------------------
 * WooCommerce Mi Cuenta — Navegación lateral
 * ----------------------------------------------------- */
body.woocommerce-account .woocommerce-MyAccount-navigation {
    background: #f9f9f7 !important;
    border-radius: 12px !important;
    padding: 8px !important;
    border: 1px solid #e6e4df !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul li::before {
    display: none !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 12px 16px !important;
    color: #4a4a4a !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    border-left: 3px solid transparent !important;
    border-bottom: none !important;
    background: transparent !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
    background: #f0efe8 !important;
    color: #2d2d2d !important;
    border-left-color: #d4c5a0 !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
    background: #ffffff !important;
    color: #bd9000 !important;
    font-weight: 600 !important;
    border-left-color: #bd9000 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

/* Iconos del menú via pseudo-elementos */
body.woocommerce-account .woocommerce-MyAccount-navigation ul li a::before {
    content: '' !important;
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
    background-size: 20px 20px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    opacity: 0.5;
    margin: 0 !important;
    padding: 0 !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a::before {
    opacity: 0.9;
}

/* Icono: Escritorio */
body.woocommerce-account .woocommerce-MyAccount-navigation-link--dashboard a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a4a4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='14' y='14' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3C/svg%3E") !important;
}

/* Icono: Mi Membresía */
body.woocommerce-account .woocommerce-MyAccount-navigation-link--mi-membresia a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a4a4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cline x1='2' y1='10' x2='22' y2='10'/%3E%3C/svg%3E") !important;
}

/* Icono: Mis Inversiones */
body.woocommerce-account .woocommerce-MyAccount-navigation-link--mis-inversiones a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a4a4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 18 12 15 21 9 3 6 12 2 12'/%3E%3C/svg%3E") !important;
}

/* Icono: Detalles de la cuenta */
body.woocommerce-account .woocommerce-MyAccount-navigation-link--edit-account a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a4a4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E") !important;
}

/* Icono: Cerrar sesión */
body.woocommerce-account .woocommerce-MyAccount-navigation-link--customer-logout a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b2c2c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E") !important;
}

/* Icono: Oportunidades */
body.woocommerce-account .woocommerce-MyAccount-navigation-link--oportunidades a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a4a4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5z'/%3E%3Cpath d='M2 17l10 5 10-5'/%3E%3Cpath d='M2 12l10 5 10-5'/%3E%3C/svg%3E") !important;
}

/* Icono: Mis Cursos */
body.woocommerce-account .woocommerce-MyAccount-navigation-link--mis-cursos a::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a4a4a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E") !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation-link--customer-logout a {
    color: #9b2c2c !important;
}

body.woocommerce-account .woocommerce-MyAccount-navigation-link--customer-logout a:hover {
    background: #fff5f5 !important;
    color: #c53030 !important;
    border-left-color: #fc8181 !important;
}

/* -------------------------------------------------------
 * Dashboard / Escritorio
 * ----------------------------------------------------- */
body.woocommerce-account .ciei-dash {
    max-width: 800px;
}

body.woocommerce-account .ciei-dash-welcome {
    background: #1a1a2e !important;
    border-radius: 12px !important;
    padding: 28px 32px !important;
    margin-bottom: 24px !important;
    color: #fff !important;
}

body.woocommerce-account .ciei-dash-welcome-title {
    margin: 0 0 6px 0 !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #fff !important;
    line-height: 1.2 !important;
    padding: 0 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

body.woocommerce-account .ciei-dash-welcome-sub {
    margin: 0 !important;
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    line-height: 1.5 !important;
    padding: 0 !important;
}

body.woocommerce-account .ciei-dash-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

body.woocommerce-account .ciei-dash-card {
    background: #fff !important;
    border: 1px solid #e6e4df !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    transition: box-shadow 0.2s ease;
}

body.woocommerce-account .ciei-dash-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

body.woocommerce-account .ciei-dash-card-header {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 18px 22px !important;
    border-bottom: 1px solid #f0efe8 !important;
    background: #fafaf7 !important;
}

body.woocommerce-account .ciei-dash-card-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    background: #f5f0e0 !important;
    border-radius: 8px !important;
    color: #bd9000 !important;
    flex-shrink: 0;
}

body.woocommerce-account .ciei-dash-card-icon svg {
    width: 22px !important;
    height: 22px !important;
}

body.woocommerce-account .ciei-dash-card-title {
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #2d2d2d !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    padding: 0 !important;
}

body.woocommerce-account .ciei-dash-card-body {
    padding: 22px !important;
}

/* Status badge */
body.woocommerce-account .ciei-dash-status-badge {
    display: inline-block !important;
    padding: 5px 14px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 18px !important;
}

body.woocommerce-account .ciei-dash-status--active {
    background: #edfaef !important;
    color: #1e7e34 !important;
    border: 1px solid #68c07b !important;
}

body.woocommerce-account .ciei-dash-status--warning {
    background: #fff8e5 !important;
    color: #94660c !important;
    border: 1px solid #dba617 !important;
}

body.woocommerce-account .ciei-dash-status--expired {
    background: #fce8e8 !important;
    color: #a00 !important;
    border: 1px solid #e2605a !important;
}

/* Info rows dentro de tarjetas */
body.woocommerce-account .ciei-dash-info-rows {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px;
    margin-bottom: 18px !important;
}

body.woocommerce-account .ciei-dash-info-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid #f5f5f2 !important;
}

body.woocommerce-account .ciei-dash-info-row:last-child {
    border-bottom: none !important;
}

body.woocommerce-account .ciei-dash-info-label {
    font-size: 13px !important;
    color: #777 !important;
}

body.woocommerce-account .ciei-dash-info-value {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #2d2d2d !important;
}

body.woocommerce-account .ciei-dash-info-highlight {
    color: #bd9000 !important;
    font-size: 15px !important;
}

/* Estadísticas de inversiones */
body.woocommerce-account .ciei-dash-stat {
    display: flex !important;
    align-items: baseline !important;
    gap: 8px;
    margin-bottom: 14px !important;
}

body.woocommerce-account .ciei-dash-stat:last-of-type {
    margin-bottom: 18px !important;
}

body.woocommerce-account .ciei-dash-stat-number {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #bd9000 !important;
    line-height: 1 !important;
}

body.woocommerce-account .ciei-dash-stat-money {
    color: #1e7e34 !important;
}

body.woocommerce-account .ciei-dash-stat-label {
    font-size: 13px !important;
    color: #777 !important;
}

/* Link en tarjetas */
body.woocommerce-account .ciei-dash-card-link {
    display: inline-block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #bd9000 !important;
    text-decoration: none !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    background: #faf6e8 !important;
    transition: all 0.2s ease;
}

body.woocommerce-account .ciei-dash-card-link:hover {
    background: #bd9000 !important;
    color: #fff !important;
}

/* Empty states en dashboard */
body.woocommerce-account .ciei-dash-empty {
    text-align: center !important;
    padding: 16px 0 !important;
}

body.woocommerce-account .ciei-dash-empty p {
    margin: 0 0 4px 0 !important;
    font-size: 14px !important;
    color: #777 !important;
}

body.woocommerce-account .ciei-dash-empty-sub {
    font-size: 13px !important;
    color: #aaa !important;
}

/* -------------------------------------------------------
 * Mi Membresía
 * ----------------------------------------------------- */
body.woocommerce-account .ciei-public-membership {
    max-width: 600px;
}

body.woocommerce-account .ciei-public-status-banner {
    display: flex !important;
    align-items: center !important;
    gap: 12px;
    padding: 14px 20px !important;
    border-radius: 6px !important;
    margin-bottom: 24px !important;
}

body.woocommerce-account .ciei-public-status--active {
    background: #edfaef !important;
    border: 1px solid #68c07b !important;
}

body.woocommerce-account .ciei-public-status--warning {
    background: #fff8e5 !important;
    border: 1px solid #dba617 !important;
}

body.woocommerce-account .ciei-public-status--expired {
    background: #fce8e8 !important;
    border: 1px solid #e2605a !important;
}

body.woocommerce-account .ciei-public-status-label {
    font-weight: 700 !important;
    font-size: 15px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

body.woocommerce-account .ciei-public-status--active .ciei-public-status-label {
    color: #1e7e34 !important;
}

body.woocommerce-account .ciei-public-status--warning .ciei-public-status-label {
    color: #94660c !important;
}

body.woocommerce-account .ciei-public-status--expired .ciei-public-status-label {
    color: #a00 !important;
}

body.woocommerce-account .ciei-public-status-days {
    font-size: 13px !important;
    color: #666 !important;
}

body.woocommerce-account .ciei-public-table {
    width: 100% !important;
    border-collapse: collapse !important;
}

body.woocommerce-account .ciei-public-table th,
body.woocommerce-account .ciei-public-table td {
    padding: 12px 16px !important;
    border-bottom: 1px solid #eee !important;
    text-align: left !important;
    font-size: 14px !important;
}

body.woocommerce-account .ciei-public-table th {
    color: #666 !important;
    font-weight: normal !important;
    width: 200px;
    background: transparent !important;
}

body.woocommerce-account .ciei-public-table td {
    color: #333 !important;
    font-weight: 600 !important;
}

/* -------------------------------------------------------
 * Mis Inversiones — Grid de tarjetas
 * ----------------------------------------------------- */
body.woocommerce-account .ciei-public-investments-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

body.woocommerce-account .ciei-public-investment-card {
    border: 1px solid #e6e4df !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #fff !important;
    transition: box-shadow 0.2s;
}

body.woocommerce-account .ciei-public-investment-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06) !important;
}

body.woocommerce-account .ciei-public-investment-thumb {
    width: 100% !important;
    height: 160px !important;
    overflow: hidden !important;
}

body.woocommerce-account .ciei-public-investment-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

body.woocommerce-account .ciei-public-investment-body {
    padding: 16px !important;
}

body.woocommerce-account .ciei-public-investment-title {
    margin: 0 0 12px 0 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #2d2d2d !important;
    line-height: 1.3 !important;
    padding: 0 !important;
}

body.woocommerce-account .ciei-public-investment-meta {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-top: 12px !important;
    border-top: 1px solid #f0efe8 !important;
}

body.woocommerce-account .ciei-public-investment-value {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #1e7e34 !important;
}

body.woocommerce-account .ciei-public-investment-date {
    font-size: 12px !important;
    color: #999 !important;
}

/* -------------------------------------------------------
 * Botón Renovar membresía
 * ----------------------------------------------------- */
body.woocommerce-account .ciei-public-renew-btn {
    display: inline-block !important;
    padding: 10px 24px !important;
    background: #bd9000 !important;
    color: #fff !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    margin-bottom: 20px !important;
    transition: background 0.2s ease;
}

body.woocommerce-account .ciei-public-renew-btn:hover {
    background: #a67d00 !important;
    color: #fff !important;
}

/* -------------------------------------------------------
 * Oportunidades — Cards apiladas
 * ----------------------------------------------------- */
body.woocommerce-account .ciei-public-opportunities {
    max-width: 800px;
}

body.woocommerce-account .ciei-public-opp-stack {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px;
}

body.woocommerce-account .ciei-public-opp-card {
    display: flex !important;
    border: 1px solid #e6e4df !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #fff !important;
    transition: box-shadow 0.2s;
}

body.woocommerce-account .ciei-public-opp-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

body.woocommerce-account .ciei-public-opp-card--inactive {
    opacity: 0.55 !important;
    filter: grayscale(30%);
}

body.woocommerce-account .ciei-public-opp-image {
    width: 220px !important;
    min-height: 180px !important;
    flex-shrink: 0;
    overflow: hidden !important;
}

body.woocommerce-account .ciei-public-opp-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

body.woocommerce-account .ciei-public-opp-body {
    padding: 20px 24px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1;
}

body.woocommerce-account .ciei-public-opp-header {
    margin-bottom: 8px !important;
}

body.woocommerce-account .ciei-public-opp-chip {
    display: inline-block !important;
    padding: 3px 10px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

body.woocommerce-account .ciei-public-opp-chip--active {
    background: #edfaef !important;
    color: #1e7e34 !important;
    border: 1px solid #68c07b !important;
}

body.woocommerce-account .ciei-public-opp-chip--inactive {
    background: #f0f0f1 !important;
    color: #888 !important;
    border: 1px solid #d0d0d0 !important;
}

body.woocommerce-account .ciei-public-opp-title {
    margin: 0 0 10px 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #2d2d2d !important;
    line-height: 1.3 !important;
    padding: 0 !important;
}

body.woocommerce-account .ciei-public-opp-desc {
    font-size: 14px !important;
    color: #555 !important;
    line-height: 1.6 !important;
    margin-bottom: 16px !important;
    flex: 1;
}

body.woocommerce-account .ciei-public-opp-desc p {
    margin: 0 0 8px 0 !important;
}

body.woocommerce-account .ciei-public-opp-cta {
    display: inline-block !important;
    padding: 10px 22px !important;
    background: #1a1a2e !important;
    color: #fff !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-decoration: none !important;
    text-align: center !important;
    transition: background 0.2s ease;
    align-self: flex-start;
}

body.woocommerce-account .ciei-public-opp-cta:hover {
    background: #bd9000 !important;
    color: #fff !important;
}

/* -------------------------------------------------------
 * Estado vacío
 * ----------------------------------------------------- */
body.woocommerce-account .ciei-public-empty {
    text-align: center !important;
    padding: 40px 20px !important;
    color: #999 !important;
}

body.woocommerce-account .ciei-public-empty p {
    font-size: 15px !important;
    margin: 0 !important;
}

/* -------------------------------------------------------
 * Responsive
 * ----------------------------------------------------- */
@media (max-width: 768px) {
    body.woocommerce-account .ciei-dash-grid {
        grid-template-columns: 1fr !important;
    }

    body.woocommerce-account .ciei-dash-welcome {
        padding: 22px 20px !important;
    }

    body.woocommerce-account .ciei-dash-welcome-title {
        font-size: 20px !important;
    }

    body.woocommerce-account .woocommerce-MyAccount-navigation {
        border-radius: 10px !important;
        padding: 6px !important;
        margin-bottom: 20px !important;
    }

    body.woocommerce-account .woocommerce-MyAccount-navigation ul {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px;
    }

    body.woocommerce-account .woocommerce-MyAccount-navigation ul li a {
        padding: 10px 12px !important;
        font-size: 13px !important;
        border-left: none !important;
        border-bottom: 2px solid transparent !important;
    }

    body.woocommerce-account .woocommerce-MyAccount-navigation ul li a:hover {
        border-left: none !important;
        border-bottom-color: #d4c5a0 !important;
    }

    body.woocommerce-account .woocommerce-MyAccount-navigation ul li.is-active a {
        border-left: none !important;
        border-bottom-color: #bd9000 !important;
    }

    body.woocommerce-account .woocommerce-MyAccount-navigation ul li a::before {
        display: none !important;
    }
}

@media (max-width: 680px) {
    body.woocommerce-account .ciei-public-opp-card {
        flex-direction: column !important;
    }

    body.woocommerce-account .ciei-public-opp-image {
        width: 100% !important;
        min-height: 160px !important;
        max-height: 200px !important;
    }
}

@media (max-width: 600px) {
    body.woocommerce-account .ciei-public-investments-grid {
        grid-template-columns: 1fr !important;
    }

    body.woocommerce-account .ciei-public-table th {
        width: 130px;
    }

    body.woocommerce-account .ciei-public-investment-meta {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px;
    }

    body.woocommerce-account .ciei-dash-stat-number {
        font-size: 24px !important;
    }
}
