/**
 * Epil Pro Offer Display - Stylesheet
 * Version: 1.0.0
 */

/* ============================================
   Container & Layout
   ============================================ */

.epil-pro-offer-container {
    width: 100%;
    max-width: 800px;
    margin: 30px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-sizing: border-box;
}

.epil-pro-offer-container * {
    box-sizing: border-box;
}

/* ============================================
   Offer Options
   ============================================ */

.epil-offer-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    margin-bottom: 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.epil-offer-option:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.epil-offer-option.epil-offer-featured {
    position: relative;
}

/* ============================================
   Badge (MOST POPULAR)
   ============================================ */

.epil-offer-badge {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #6b46a8;
    color: white;
    padding: 8px 40px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    transform: rotate(-45deg) translate(-30%, -50%);
    transform-origin: top left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

/* ============================================
   Radio Buttons
   ============================================ */

.epil-offer-radio {
    flex-shrink: 0;
    margin-right: 20px;
}

.epil-offer-radio input[type="radio"] {
    display: none;
}

.epil-offer-radio input[type="radio"] + label {
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid #c8b8e0;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    background-color: white;
}

.epil-offer-radio input[type="radio"]:checked + label {
    border-color: #6b46a8;
    border-width: 8px;
    background-color: #6b46a8;
}

.epil-offer-radio input[type="radio"] + label:hover {
    border-color: #8b66c8;
}

/* ============================================
   Product Image
   ============================================ */

.epil-offer-image {
    flex-shrink: 0;
    margin-right: 25px;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

.epil-offer-image img {
    display: block;
    width: 80px;
    height: auto;
    max-height: 100px;
    object-fit: contain;
}

/* ============================================
   Offer Details
   ============================================ */

.epil-offer-details {
    flex: 1;
    min-width: 0;
}

.epil-offer-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    line-height: 1.3;
}

.epil-offer-subtitle {
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 8px;
    opacity: 0.85;
}

.epil-offer-pack-name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

/* ============================================
   Pricing Section
   ============================================ */

.epil-offer-pricing {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.epil-save-badge {
    display: inline-block;
    background-color: #4caf50;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
}

.epil-original-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 5px;
    font-weight: 400;
}

.epil-sale-price {
    font-size: 32px;
    font-weight: 700;
    color: #000;
    line-height: 1;
}

.epil-price-note {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #666;
    margin-top: 3px;
    font-style: italic;
}

/* ============================================
   Add to Cart Button
   ============================================ */

.epil-offer-button-wrapper {
    text-align: center;
    margin-top: 20px;
}

.epil-add-to-cart-btn {
    display: inline-block;
    background-color: #6b46a8;
    color: white;
    border: none;
    padding: 16px 50px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(107, 70, 168, 0.3);
}

.epil-add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 70, 168, 0.4);
}

.epil-add-to-cart-btn:active {
    transform: translateY(0);
}

.epil-add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading state */
.epil-add-to-cart-btn.loading {
    position: relative;
    color: transparent;
}

.epil-add-to-cart-btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Messages
   ============================================ */

.epil-offer-message {
    margin-top: 15px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.epil-offer-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.epil-offer-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* ============================================
   Responsive Design - Tablet
   ============================================ */

@media screen and (max-width: 768px) {
    .epil-offer-option {
        padding: 20px;
    }
    
    .epil-offer-image img {
        width: 60px;
        max-height: 80px;
    }
    
    .epil-offer-title {
        font-size: 14px;
    }
    
    .epil-offer-subtitle {
        font-size: 12px;
    }
    
    .epil-sale-price {
        font-size: 26px;
    }
    
    .epil-add-to-cart-btn {
        padding: 14px 40px;
        font-size: 15px;
    }
}

/* ============================================
   Responsive Design - Mobile
   ============================================ */

@media screen and (max-width: 600px) {
    .epil-pro-offer-container {
        margin: 20px auto;
    }
    
    .epil-offer-option {
        flex-wrap: wrap;
        padding: 20px 15px;
        margin-bottom: 12px;
    }
    
    /* Stack radio and image on same line */
    .epil-offer-radio {
        margin-right: 15px;
    }
    
    .epil-offer-image {
        margin-right: 15px;
        flex-grow: 0;
    }
    
    .epil-offer-image img {
        width: 50px;
        max-height: 60px;
    }
    
    /* Details take remaining space on same line */
    .epil-offer-details {
        flex: 1;
        min-width: 120px;
    }
    
    .epil-offer-title {
        font-size: 13px;
        margin-bottom: 3px;
    }
    
    .epil-offer-subtitle {
        font-size: 11px;
        margin-bottom: 5px;
    }
    
    .epil-offer-pack-name {
        font-size: 10px;
    }
    
    /* Pricing on new line */
    .epil-offer-pricing {
        width: 100%;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    .epil-save-badge {
        margin-bottom: 0;
        order: 2;
    }
    
    .epil-original-price {
        order: 1;
        margin-bottom: 5px;
        font-size: 13px;
    }
    
    .epil-sale-price {
        order: 3;
        width: 100%;
        margin-top: 8px;
        font-size: 28px;
        text-align: left;
    }
    
    .epil-offer-badge {
        padding: 6px 30px;
        font-size: 9px;
    }
    
    .epil-add-to-cart-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* ============================================
   Extra Small Mobile
   ============================================ */

@media screen and (max-width: 400px) {
    .epil-offer-option {
        padding: 15px 12px;
    }
    
    .epil-offer-title {
        font-size: 12px;
    }
    
    .epil-sale-price {
        font-size: 24px;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .epil-offer-option {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .epil-add-to-cart-btn {
        display: none;
    }
}

/* ============================================
   Accessibility
   ============================================ */

.epil-offer-radio input[type="radio"]:focus + label {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

.epil-add-to-cart-btn:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Divi Theme Compatibility
   ============================================ */

.et_pb_section .epil-pro-offer-container,
.et_pb_row .epil-pro-offer-container {
    width: 100%;
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .epil-offer-option {
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
    }
    
    .epil-offer-option:hover {
        box-shadow: 0 4px 16px rgba(255, 255, 255, 0.08);
    }
}
