/* =============================================
   CSSF - Subscribe & Save Frontend Styles
   ============================================= */

/* --- Cards Wrapper --- */
.cssf-cards-wrapper {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* --- Card Base --- */
.cssf-card {
    flex: 1;
    min-width: 200px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px 20px;
    cursor: pointer;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
}

/* --- Card Hover --- */
.cssf-card:hover {
    border-color: #aaa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* --- Card Active (Seleccionada) --- */
.cssf-card.active {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f0fff0 0%, #e8f5e9 100%);
    border-width: 2px;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2);
}

.cssf-card.active:hover {
    border-color: #43a047;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

/* --- Check Mark Indicator --- */
.cssf-card-one-time::after,
.cssf-card-subscribe::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: #fff;
    transition: all 0.25s ease;
}

.cssf-card.active::after {
    background: #4CAF50;
    border-color: #4CAF50;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

/* --- Card Header Row (Desktop horizontal) --- */
.cssf-card-header-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    flex-wrap: wrap;
}

/* --- Price Group (price + original price stacked) --- */
.cssf-card-price-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Card Title --- */
.cssf-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
    line-height: 1.3;
    white-space: nowrap;
}

/* --- Card Price --- */
.cssf-card-price {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    margin-bottom: 0;
    line-height: 1.2;
    white-space: nowrap;
}

.cssf-card-one-time .cssf-card-price {
    color: #333;
}

.cssf-card-subscribe .cssf-card-price {
    color: #2e7d32;
}

/* --- Discount Badge --- */
.cssf-card-discount-badge {
    display: inline-block;
    background: linear-gradient(135deg, #4CAF50 0%, #43a047 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 0;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* --- Original Price (Strikethrough) --- */
.cssf-card-original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
    margin-bottom: 0;
    white-space: nowrap;
}

/* --- Frequency Display --- */
.cssf-card-frequency {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    padding: 4px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-weight: 500;
}

.cssf-card-subscribe.active .cssf-card-frequency {
    background: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
}

/* --- Radio Button --- */
.cssf-card-radio {
    margin-top: 8px;
}

.cssf-card-radio input[type="radio"] {
    display: none;
}

/* --- Frequency Select --- */
.cssf-frequency-wrapper {
    margin-top: 12px;
    width: 100%;
    max-width: 260px;
}

.cssf-frequency-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    text-align: left;
    width: 100%;
    display: block;
}

.cssf-frequency-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: auto;
    -webkit-appearance: auto;
}

.cssf-frequency-select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

.cssf-card-subscribe.active .cssf-frequency-select {
    border-color: #4CAF50;
    background: #fff;
}

/* --- Hidden Inputs --- */
.cssf-hidden-inputs {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* =============================================
   RESPONSIVE - TABLET
   ============================================= */
@media (max-width: 768px) {
    .cssf-cards-wrapper {
        gap: 12px;
    }

    .cssf-card {
        min-width: calc(50% - 8px);
        padding: 20px 16px;
    }

    .cssf-card-price {
        font-size: 24px;
    }

    .cssf-card-title {
        font-size: 15px;
    }

    .cssf-card::after {
        top: 10px;
        right: 10px;
        width: 20px;
        height: 20px;
    }
}

/* =============================================
   RESPONSIVE - MÓVIL
   ============================================= */
@media (max-width: 580px) {
    .cssf-cards-wrapper {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
        max-width: 100%;
        overflow: visible;
    }

    .cssf-card {
        min-width: 0;
        width: 100%;
        padding: 10px 12px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        text-align: left;
        border-radius: 10px;
        box-sizing: border-box;
        position: static;
        gap: 4px 8px;
    }

    .cssf-card-header-row {
        flex-wrap: nowrap;
        gap: 6px;
        justify-content: flex-start;
        align-items: center;
    }

    .cssf-card-title {
        font-size: 13px;
        margin-bottom: 0;
        flex: 0 1 auto;
        font-weight: 600;
        white-space: nowrap;
    }

    .cssf-card-price {
        font-size: 16px;
        margin-bottom: 0;
        margin-right: 0;
        white-space: nowrap;
    }

    .cssf-card-discount-badge {
        display: inline-block;
        font-size: 10px;
        padding: 2px 6px;
        margin-bottom: 0;
    }

    .cssf-card-original-price {
        display: none;
    }

    .cssf-card-price-group {
        flex-direction: row;
        gap: 4px;
        align-items: baseline;
    }

    .cssf-card-frequency {
        display: none;
    }

    .cssf-card-radio {
        margin: 0;
        flex-shrink: 0;
        margin-left: auto;
    }

    .cssf-card::after {
        display: none;
    }

    .cssf-frequency-wrapper {
        width: 100%;
        margin-top: 4px;
        padding-top: 8px;
        border-top: 1px solid #eee;
        max-width: 100%;
    }

    .cssf-card:not(.active) .cssf-frequency-wrapper {
        display: none;
    }

    .cssf-frequency-label {
        font-size: 11px;
        margin-bottom: 3px;
    }

    .cssf-frequency-select {
        font-size: 13px;
        padding: 6px 10px;
    }
}

/* =============================================
   RESPONSIVE - MUY PEQUEÑO
   ============================================= */
@media (max-width: 380px) {
    .cssf-card {
        padding: 8px 10px;
    }

    .cssf-card-title {
        font-size: 12px;
    }

    .cssf-card-price {
        font-size: 14px;
    }
}

/* =============================================
   SHORTCODE - Cuando se usa en páginas no-producto
   ============================================= */
.cssf-shortcode-wrapper {
    max-width: 600px;
    margin: 20px auto;
}

/* =============================================
   STRIPE INFO - Badge e información de cobro recurrente
   ============================================= */
.cssf-stripe-info {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    text-align: center;
}

.cssf-stripe-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #635bff;
    margin-bottom: 4px;
}

.cssf-stripe-badge svg {
    color: #635bff;
}

.cssf-stripe-note {
    margin: 0;
    font-size: 11px;
    color: #6c757d;
    line-height: 1.4;
}

/* =============================================
   GATEWAY INFO - Multi-gateway support
   ============================================= */
.cssf-gateway-info {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    text-align: center;
}

.cssf-available-methods {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.cssf-gateway-icons {
    display: inline-flex;
    gap: 8px;
    margin-left: 8px;
    vertical-align: middle;
}

.cssf-gateway-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.cssf-gateway-badge-stripe {
    background: #635bff;
    color: #fff;
}

.cssf-gateway-badge-paypal {
    background: #003087;
    color: #fff;
}

.cssf-gateway-note {
    margin: 0;
    font-size: 11px;
    color: #6c757d;
    line-height: 1.4;
}

.cssf-mixed-cart-warning {
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    text-align: left;
}

.cssf-mixed-cart-warning .dashicons {
    color: #856404;
    margin-right: 4px;
}

.cssf-mixed-cart-warning p {
    margin: 4px 0;
    font-size: 12px;
    color: #856404;
}

.cssf-mixed-cart-warning ol {
    margin: 4px 0 0 20px;
    font-size: 12px;
    color: #856404;
}
