/**
 * Stylesheet for WooCommerce Redsys Subscriptions
 * Brand colors: Elegant Dark Red (Emilio Moro Brand)
 */

:root {
    --em-brand-red: #7a1c2e;
    --em-brand-red-hover: #5a111f;
    --em-light-pink: #fbf6f6;
    --em-border-color: #d1b5ba;
    --em-text-color: #333333;
    --em-muted-text: #707070;
    --em-success-green: #2e7d32;
    --em-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subscription options container */
.em-subscription-purchase-options {
    margin: 20px 0;
    font-family: 'Outfit', 'Inter', sans-serif;
    color: var(--em-text-color);
    position: relative;
    z-index: 1;
    clear: both;
    width: 100%;
    box-sizing: border-box;
}

/* Base style for option items */
.em-purchase-option {
    position: relative;
    border: 1px solid var(--em-border-color);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 12px;
    cursor: pointer;
    background-color: #ffffff;
    transition: var(--em-transition);
    user-select: none;
}

.em-purchase-option:hover {
    border-color: var(--em-brand-red);
    box-shadow: 0 4px 12px rgba(122, 28, 46, 0.08);
}

.em-purchase-option.selected {
    border-color: var(--em-brand-red);
    background-color: var(--em-light-pink);
    box-shadow: 0 4px 16px rgba(122, 28, 46, 0.12);
}

/* Header line within option card */
.em-purchase-option-header {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 16px;
}

/* Price rendering */
.em-purchase-option-price {
    margin-left: auto;
    font-weight: 700;
    font-size: 18px;
    color: var(--em-brand-red);
}

.em-purchase-option.selected .em-purchase-option-price {
    transform: scale(1.05);
    transition: var(--em-transition);
}

/* Custom radio styling */
.em-custom-radio {
    display: inline-block;
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid var(--em-border-color);
    border-radius: 50%;
    margin-right: 12px;
    background-color: #ffffff;
    transition: var(--em-transition);
    flex-shrink: 0;
}

.em-purchase-option:hover .em-custom-radio {
    border-color: var(--em-brand-red);
}

.em-purchase-option.selected .em-custom-radio {
    border-color: var(--em-brand-red);
}

.em-purchase-option.selected .em-custom-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--em-brand-red);
    animation: em-pop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes em-pop {
    0% { transform: translate(-50%, -50%) scale(0); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Subscription badge */
.em-subscription-badge {
    position: absolute;
    top: -10px;
    right: 15px;
    background-color: var(--em-brand-red);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* Details list inside the subscription card */
.em-subscription-details {
    margin-top: 12px;
    padding-left: 32px;
    font-size: 14px;
    color: var(--em-muted-text);
    border-top: 1px dashed rgba(122, 28, 46, 0.15);
    padding-top: 12px;
}

.em-subscription-details ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.em-subscription-details li {
    position: relative;
    margin-bottom: 6px;
    padding-left: 18px;
    line-height: 1.4;
}

.em-subscription-details li::before {
    content: "•";
    color: var(--em-brand-red);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 16px;
    top: -2px;
}

/* How it works link */
.em-how-it-works-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--em-brand-red);
    text-decoration: underline;
    font-weight: 500;
    font-size: 13px;
    transition: var(--em-transition);
}

.em-how-it-works-link:hover {
    color: var(--em-brand-red-hover);
    text-shadow: 0 0 1px rgba(122, 28, 46, 0.2);
}

/* Frequencies selector section */
.em-frequency-selector-container {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid rgba(122, 28, 46, 0.1);
    display: none; /* Controlled by JS / selection class */
    animation: em-fade-slide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.em-purchase-option.selected .em-frequency-selector-container {
    display: block;
}

@keyframes em-fade-slide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.em-frequency-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--em-brand-red);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Frequency radio grid */
.em-frequency-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.em-frequency-btn {
    border: 1px solid var(--em-border-color);
    border-radius: 6px;
    padding: 10px 6px;
    text-align: center;
    background-color: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--em-transition);
    position: relative;
}

.em-frequency-btn:hover {
    border-color: var(--em-brand-red);
}

.em-frequency-btn.active {
    border-color: var(--em-brand-red);
    background-color: var(--em-brand-red);
    color: #ffffff;
}

/* "Más habitual" ribbon or label */
.em-frequency-btn .em-popular-tag {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333333;
    color: #ffffff;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    text-transform: uppercase;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.em-frequency-btn.active .em-popular-tag {
    background-color: var(--em-light-pink);
    color: var(--em-brand-red);
    border: 1px solid var(--em-brand-red);
}

/* Loyalty card/badge indicating the 6th gift progress */
.em-loyalty-gift-notice {
    margin-top: 12px;
    background: linear-gradient(135deg, var(--em-brand-red) 0%, #4a0d18 100%);
    color: #ffffff;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 6px rgba(122, 28, 46, 0.2);
}

.em-loyalty-gift-notice::before {
    content: "🎁";
    font-size: 18px;
    margin-right: 10px;
}

/* Cart & Checkout Specific Styling */
.em-subscription-cart-meta {
    font-size: 12px;
    color: var(--em-brand-red);
    font-weight: 600;
    margin-top: 4px;
    display: flex;
    align-items: center;
}

.em-subscription-cart-meta::before {
    content: "🔄";
    margin-right: 4px;
    font-size: 12px;
}

/* Premium micro-animations for interactivity */
/* Aplicamos transiciones solo a elementos específicos, no con wildcard * para evitar flashazos */
.em-purchase-option .em-custom-radio,
.em-purchase-option .em-purchase-option-price,
.em-purchase-option .em-option-label,
.em-purchase-option .em-how-it-works-link,
.em-purchase-option .em-frequency-btn {
    transition: var(--em-transition);
}

/* Asegurar que el bloque de variación de WooCommerce no solape nuestra caja */
.single_variation_wrap {
    position: relative;
    z-index: 2;
}

#em-subscription-box,
[id^="em-subscription-box-"] {
    position: relative;
    z-index: 1;
}
