/* ===== Comunitad Access Codes — Frontend Styles ===== */
/* Tipografia: Raleway 400 16px · Color corporativo: #3C4BFF */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;600&display=swap');

/* -------------------------------------------------------- */
/* Bloque contenedor                                        */
/* -------------------------------------------------------- */

.cac-access-box {
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
    font-weight: 400;
    border-top: 2px solid #3C4BFF;
    border-bottom: 2px solid #3C4BFF;
    padding: 20px 0;
    margin-bottom: 28px;
    background: transparent;
}

/* -------------------------------------------------------- */
/* Estado bloqueado — campo de codigo                       */
/* -------------------------------------------------------- */

.cac-label {
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #222;
    margin: 0 0 14px;
    line-height: 1.5;
}

.cac-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

#cac-input {
    flex: 1;
    padding: 11px 16px;
    border: 1.5px solid #ccc;
    border-radius: 0;
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: #fff;
    color: #222;
    outline: none;
    transition: border-color .2s;
}

#cac-input:focus {
    border-color: #3C4BFF;
    box-shadow: 0 0 0 3px rgba(60,75,255,.1);
}

#cac-input::placeholder {
    color: #aaa;
    letter-spacing: 0.04em;
}

.cac-btn-submit {
    padding: 11px 24px;
    background: #3C4BFF !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0 !important;
    font-family: 'Raleway', sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    white-space: nowrap;
    transition: background .2s;
    letter-spacing: 0.02em;
}

.cac-btn-submit:hover    { background: #2a38e0 !important; }
.cac-btn-submit:active   { background: #1e2ab0 !important; }
.cac-btn-submit:disabled { background: #9aa0d4 !important; cursor: not-allowed; }

/* Mensaje de validacion */
.cac-msg {
    margin-top: 10px;
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 400;
    min-height: 18px;
    line-height: 1.5;
}

.cac-msg.is-error   { color: #c0392b; }
.cac-msg.is-success { color: #1a6b4a; }
.cac-msg.is-loading { color: #888; }

/* -------------------------------------------------------- */
/* Estado desbloqueado                                      */
/* -------------------------------------------------------- */

.cac-unlocked {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cac-unlock-info {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex: 1;
    flex-wrap: wrap;
}

.cac-unlock-info strong {
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #3C4BFF;
    letter-spacing: 0.01em;
}

.cac-unlock-empresa {
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #444;
}

.cac-unlock-icon {
    font-size: 18px;
    margin-right: 4px;
}

.cac-btn-clear {
    padding: 8px 16px;
    background: transparent !important;
    border: 1.5px solid #3C4BFF !important;
    border-radius: 0 !important;
    font-family: 'Raleway', sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #3C4BFF !important;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, color .2s;
    flex-shrink: 0;
}

.cac-btn-clear:hover {
    background: #3C4BFF !important;
    color: #fff !important;
}

/* -------------------------------------------------------- */
/* Disponibles del codigo                                   */
/* -------------------------------------------------------- */

.cac-disponibles {
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #444;
    margin: 0 0 6px;
    display: block;
}

.cac-disponibles.is-low {
    color: #c0392b;
}

/* -------------------------------------------------------- */
/* Ocultar elementos nativos de WooCommerce que sustituimos */
/* -------------------------------------------------------- */

.cac-variation-hidden { display: none !important; }

/* -------------------------------------------------------- */
/* Tarjetas de variaciones                                  */
/* -------------------------------------------------------- */

#cac-cards-wrapper {
    font-family: 'Raleway', sans-serif;
    margin-top: 24px;
}

#cac-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.cac-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    transition: border-color .2s;
}

.cac-card:hover {
    border-color: #3C4BFF;
}

.cac-card-info {
    flex: 1;
}

.cac-card-title {
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin: 0 0 4px;
}

.cac-card-price {
    margin: 0;
}

.cac-price {
    font-family: 'Raleway', sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: #222;
}

.cac-price-free {
    font-family: 'Raleway', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #3C4BFF;
    letter-spacing: 0.04em;
}

/* Contador +/- */
.cac-card-qty {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.cac-qty-btn {
    width: 40px;
    height: 40px;
    border: 1.5px solid #3C4BFF !important;
    background: transparent !important;
    color: #3C4BFF !important;
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
    line-height: 1;
    padding: 0;
}

.cac-qty-btn:hover {
    background: #3C4BFF !important;
    color: #fff !important;
}

.cac-qty-val {
    width: 48px;
    text-align: center;
    font-family: 'Raleway', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #222;
    border-top: 1.5px solid #3C4BFF;
    border-bottom: 1.5px solid #3C4BFF;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animacion shake cuando se alcanza el limite */
@keyframes cac-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-4px); }
    60%       { transform: translateX(4px); }
}
.cac-shake { animation: cac-shake .35s ease; }

/* -------------------------------------------------------- */
/* Barra de checkout                                        */
/* -------------------------------------------------------- */

#cac-checkout-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-top: 1.5px solid #e0e0e0;
    margin-top: 8px;
}

#cac-total-label {
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #222;
}

.cac-btn-checkout {
    padding: 13px 28px;
    background: #3C4BFF !important;
    color: #fff !important;
    border: none !important;
    font-family: 'Raleway', sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: background .2s;
    white-space: nowrap;
}

.cac-btn-checkout:hover    { background: #2a38e0 !important; }
.cac-btn-checkout:disabled { background: #9aa0d4 !important; cursor: not-allowed; }

#cac-adding-msg {
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    color: #888;
    padding: 8px 0;
}

/* Badge free en banner desbloqueado */
.cac-badge-free {
    color: #3C4BFF;
    font-weight: 600;
}