/* ==========================================================================
   WC Product Add-Ons — Frontend Styles
   Estilo limpio y moderno matching con el diseño de la Medusa
   ========================================================================== */

.wcpa-addons-wrapper {
    margin: 24px 0;
    padding: 0;
    font-family: inherit;
}

/* --- Toggle Compra / Suscripcion --- */
.wcpa-purchase-mode {
    margin-bottom: 24px;
}

.wcpa-mode-toggle {
    display: inline-flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.wcpa-mode-btn {
    padding: 10px 24px;
    border: none;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.wcpa-mode-btn:first-child {
    border-right: 1px solid #ddd;
}

.wcpa-mode-btn.wcpa-mode-active {
    background: #111;
    color: #fff;
}

.wcpa-mode-btn:hover:not(.wcpa-mode-active) {
    background: #e8e8e8;
}

/* --- Grupos de add-ons --- */
.wcpa-addon-group {
    margin-bottom: 24px;
}

.wcpa-group-header {
    margin-bottom: 8px;
}

.wcpa-group-title {
    font-weight: 600;
    font-size: 15px;
    color: #222;
}

.wcpa-required {
    color: #e2401c;
    margin-left: 2px;
}

/* --- Select (Desplegable) --- */
.wcpa-select-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 4px;
}

.wcpa-select-wrap select {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.wcpa-select-price {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    padding-right: 12px;
    min-width: 80px;
    text-align: right;
}

/* --- Color Swatches --- */
.wcpa-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.wcpa-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    outline: none;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.wcpa-color-swatch:hover {
    transform: scale(1.15);
}

.wcpa-color-swatch.wcpa-swatch-active {
    border-color: #333;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
}

/* --- Plan (Suscripcion) --- */
.wcpa-plan-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wcpa-plan-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f7f7f7;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wcpa-plan-option:hover {
    border-color: #bbb;
}

.wcpa-plan-option:has(input:checked) {
    border-color: #111;
    background: #fff;
}

.wcpa-plan-option input[type="radio"] {
    margin: 0;
    accent-color: #111;
}

.wcpa-plan-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wcpa-plan-name {
    font-weight: 600;
    font-size: 15px;
    color: #222;
}

.wcpa-plan-desc {
    font-size: 12px;
    color: #777;
    margin-top: 2px;
}

.wcpa-plan-price {
    font-weight: 700;
    font-size: 15px;
    color: #111;
    white-space: nowrap;
}

/* --- Number (Numerico) --- */
.wcpa-number-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wcpa-number-input-group {
    display: inline-flex;
    align-items: center;
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.wcpa-number-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    font-size: 18px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
    outline: none;
}

.wcpa-number-btn:hover {
    background: #e8e8e8;
}

.wcpa-number-input-group input[type="number"] {
    width: 60px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    padding: 8px 0;
    outline: none;
    -moz-appearance: textfield;
}

.wcpa-number-input-group input[type="number"]::-webkit-inner-spin-button,
.wcpa-number-input-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wcpa-number-price-info {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

/* --- Desglose de precio --- */
.wcpa-price-breakdown {
    margin-top: 20px;
    padding: 16px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
}

.wcpa-breakdown-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    font-size: 13px;
    color: #555;
}

.wcpa-breakdown-line .wcpa-breakdown-amount {
    color: #333;
    white-space: nowrap;
}

.wcpa-breakdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 0;
    margin-top: 8px;
    border-top: 1px solid #ddd;
    font-size: 15px;
    color: #111;
}

/* --- Suscripcion info --- */
.wcpa-subscription-info {
    padding: 20px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 16px;
}

.wcpa-subscription-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.wcpa-subscription-row + .wcpa-subscription-row {
    border-top: 1px solid #e8e8e8;
}

.wcpa-subscription-label {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    min-width: 120px;
}

.wcpa-subscription-amount {
    font-weight: 700;
    font-size: 16px;
    color: #111;
}

.wcpa-sub-addon-line {
    font-size: 13px;
}

.wcpa-sub-addon-line .wcpa-subscription-label {
    font-weight: 400;
    font-size: 13px;
    color: #555;
}

.wcpa-sub-addon-line .wcpa-subscription-amount {
    font-weight: 500;
    font-size: 13px;
    color: #333;
}

.wcpa-sub-total-row {
    margin-top: 4px;
    padding-top: 10px !important;
    border-top: 1px solid #ddd;
}

.wcpa-subscription-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    background: #e6f4ea;
    color: #1e7e34;
    white-space: nowrap;
}

.wcpa-subscription-badge.wcpa-badge-external {
    background: #fff3cd;
    color: #856404;
}

/* --- Toggle Frecuencia Mensual/Anual --- */
.wcpa-frequency-row {
    flex-wrap: wrap;
}

.wcpa-frequency-toggle {
    display: inline-flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.wcpa-freq-btn {
    padding: 7px 18px;
    border: none;
    background: #f5f5f5;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.wcpa-freq-btn:first-child {
    border-right: 1px solid #ddd;
}

.wcpa-freq-btn.wcpa-freq-active {
    background: #111;
    color: #fff;
}

.wcpa-freq-btn:hover:not(.wcpa-freq-active) {
    background: #e8e8e8;
}

.wcpa-discount-badge {
    display: inline-block;
    background: #e6f4ea;
    color: #1e7e34;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .wcpa-select-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .wcpa-select-price {
        text-align: left;
        padding: 0 12px 8px;
    }

    .wcpa-number-wrap {
        flex-direction: column;
        align-items: flex-start;
    }

    .wcpa-mode-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}
