/* ================================================
   MOZZENO FRONT-OFFICE CSS
   ================================================ */

/* CSS Variables - Updated to Mozzeno branding colors */
:root {
    --mozzeno-primary: #5b2a86;
    --mozzeno-primary-dark: #4a2270;
    --mozzeno-secondary: #222b54;
    --mozzeno-success: #78c8a2;
    --mozzeno-warning: #ffc107;
    --mozzeno-light: #f8f9fa;
    --mozzeno-border: #dee2e6;
    --mozzeno-shadow: rgba(0, 0, 0, 0.1);
}

/* PrestaShop reset styles */
.mozzeno-payment-container .box,
.mozzeno-payment-container .cheque-box {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Main container */
.mozzeno-payment-container {
    background: #ffffff;
    border: 1px solid var(--mozzeno-border);
    border-radius: 8px;
    padding: 0;
    margin: 20px 0;
    box-shadow: 0 2px 8px var(--mozzeno-shadow);
    overflow: hidden;
}

/* Header with logo */
.mozzeno-header {
    background: linear-gradient(135deg, var(--mozzeno-primary) 0%, var(--mozzeno-primary-dark) 100%);
    color: white;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.mozzeno-logo {
    background: white;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 4px var(--mozzeno-shadow);
}

.mozzeno-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: white;
}

/* ================================================
   CHECKOUT TUNNEL - PAYMENT OPTIONS
   ================================================ */

/* ======================================
   HIDE EMPTY FORM CONTAINER GENERATED BY PRESTASHOP
   ====================================== */

/* Hide the form container (automatically generated by setAction) */
#pay-with-payment-option-1-form,
#pay-with-payment-option-2-form,
#pay-with-payment-option-3-form,
#pay-with-payment-option-4-form,
#pay-with-payment-option-5-form,
.js-payment-option-form,
.payment-option-form,
form[action*="mozzeno"],
div[id*="pay-with-payment-option"][id*="-form"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

/* Specific targeting for Mozzeno forms */
#payment-payment-option-2-form,
#pay-with-payment-option-2,
button[id*="pay-with-payment-option"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Additional hiding for any remaining empty forms */
.payment-option form:empty,
.payment-option .form:empty,
.payment-option [class*="form"]:empty {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}


label[for*="payment-option"] {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

label[for*="payment-option"] img[src*="mozzeno"],
label[for*="payment-option"] img[src*="logo_blue.svg"] {
    width: 70px !important;
    height: auto !important;
    max-width: 70px !important;
    order: -1 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

label[for*="payment-option"] span {
    order: 1 !important;
    flex: 1 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

/* ======================================
   MOZZENO PAYMENT INFO VISIBILITY
   Respects PrestaShop's native show/hide behavior
   ====================================== */

/* Don't force display - let PrestaShop handle visibility based on radio selection */
/* Only style the content when it becomes visible */

/* Style the payment info content (without forcing visibility) */
.mozzeno-payment-info {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 15px;
    margin-top: 10px;
}

/* Ensure all child elements use border-box */
.mozzeno-payment-info,
.mozzeno-payment-info * {
    box-sizing: border-box;
}

/* ================================================
   MOZZENO PAYMENT INFO - DESIGN & STYLING
   ================================================ */

/* Fix the oversized icon issue - make it normal size */
.mozzeno-payment-info svg {
    width: 16px !important;
    height: 16px !important;
    fill: #5b2a86;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Ensure proper spacing and layout */
/* .mozzeno-payment-info > div:first-child {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid #5b2a86;
}   */
.mozzeno-payment-info img {
    height: 24px;
    width: auto;
    margin-right: 12px;
    display: block;
}

.mozzeno-payment-info strong {
    color: #5b2a86;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

/* Amount section styling */
.mozzeno-payment-info > div:nth-child(2) {
    background: white;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 4px solid #78c8a2;
}

.mozzeno-payment-info > div:nth-child(2) > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mozzeno-payment-info > div:nth-child(2) span:first-child {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.mozzeno-payment-info > div:nth-child(2) span:last-child {
    color: #78c8a2;
    font-weight: bold;
    font-size: 18px;
}

/* Info message section with properly sized icon */
.mozzeno-payment-info > div:last-child {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    background: rgb(35 45 80);
    border-radius: 6px;
}

.mozzeno-payment-info p {
    margin: 0;
    font-size: 13px;
    color: #495057;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* Responsive design */
@media (max-width: 768px) {
    .mozzeno-payment-info {
        padding: 12px;
        margin: 10px 0;
    }
    
    .mozzeno-payment-info img {
        height: 20px;
        margin-right: 8px;
    }
    
    .mozzeno-payment-info strong {
        font-size: 14px;
    }
    
    .mozzeno-payment-info > div:nth-child(2) span:first-child {
        font-size: 12px;
    }
    
    .mozzeno-payment-info > div:nth-child(2) span:last-child {
        font-size: 16px;
    }
    
    .mozzeno-payment-info p {
        font-size: 11px;
    }
}

/* Animation for selected payment option */
.payment-option input[type="radio"]:checked + label + .mozzeno-payment-info {
    animation: slideDown 0.3s ease-out;
}

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

/* Additional responsive styles for other components */
@media (max-width: 768px) {
    .mozzeno-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 20px;
    }
    
    .mozzeno-content {
        padding: 20px 15px;
    }
    
    #mozzeno-pay-button {
        width: 100%;
        padding: 20px;
    }
}

/* Styles from getMozzenoCSS */
.mozzeno-redirect-widget {
    margin: 10px 0;
}

/* Mozzeno Product Widget - Fix theme conflicts */
.mozzeno-product-widget {
    margin: 15px 0 !important;
    clear: both !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
    padding: 10px;
    background: rgb(35 45 80);
    border-radius: 6px;
}

/* ================================================
   BASKET WIDGET POSITIONING IN CHECKOUT SUMMARY
   Ensure widget appears BELOW Total TTC
   ================================================ */

/* For PrestaShop 1.7+ checkout summary */
.mozzeno-pay-widget {
    margin: 15px 0 !important;
    clear: both !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
  /*  z-index: 10 !important;  */
    order: 999 !important; /* Force to bottom in flexbox layouts */
}

/* Ensure widget appears after cart summary total */
#cart-summary-product-list + .mozzeno-pay-widget,
.cart-summary-totals + .mozzeno-pay-widget,
.cart-detailed-totals + .mozzeno-pay-widget {
    margin-top: 20px !important;
}

/* For PrestaShop 8/9 - ensure proper positioning */
.cart-summary {
    display: flex;
    flex-direction: column;
}
.checkout-summary .mozzeno-pay-widget,
.cart-summary .mozzeno-pay-widget {
    margin-top: 20px !important;
    order: 999 !important;
}

/* Specific targeting for displayShoppingCartFooter hook */
#cart .mozzeno-pay-widget {
    margin-top: 20px !important;
    margin-bottom: 20px !important;
}

/* Modal visibility is controlled by Mozzeno script - don't hide it with CSS */
/* The modal starts empty and Mozzeno script handles its visibility */

.mozzeno-product-widget .lw-wrapper {
    width: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 60px !important;
    position: relative !important;
    z-index: 10 !important;
}

.mozzeno-product-widget .lw-wrapper iframe {
    width: 100% !important;
    border: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Ensure modal is visible and above everything when it has content (injected by Mozzeno script) */
.mozzeno-product-widget .lw-modal:not(:empty),
.mozzeno-pay-widget .lw-modal:not(:empty) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed !important;
    z-index: 99999 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.mozzeno-payment-btn {
    background-color: #5b2a86 !important;
    color: white !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-weight: bold !important;
    display: none !important;
    align-items: center !important;
    text-decoration: none !important;
}

.mozzeno-payment-btn:hover {
    background-color: #4a2270 !important;
    color: white !important;
    text-decoration: none !important;
    display: none !important;
}

/* Eligibility widget styles */
.mozzeno-eligibility-message {
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin: 10px 0;
}

.mozzeno-eligibility-message > p:first-child {
    margin: 0;
    font-weight: bold;
}

.mozzeno-eligibility-message > p {
    margin: 5px 0;
}

.mozzeno-eligibility-message > p:last-child {
    margin: 5px 0 0 0;
}

/* Widget logo in buttons */
.mozzeno-widget-logo {
    margin-right: 8px;
}

/* Redirect page styles - Enhanced modern design */
.mozzeno-redirect-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.mozzeno-redirect-page body {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mozzeno-redirect-page .redirect-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mozzeno-redirect-page h2 {
    color: #2d3748;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

.mozzeno-redirect-page .spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #5b2a86;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mozzeno-redirect-page .redirect-description {
    font-size: 16px;
    color: #4a5568;
    line-height: 1.6;
    margin: 20px 0;
}

/* Order details section */
.mozzeno-redirect-page .order-details {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-left: 4px solid #5b2a86;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    text-align: left;
}

.mozzeno-redirect-page .order-detail-item {
    font-size: 15px;
    color: #2d3748;
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mozzeno-redirect-page .detail-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.mozzeno-widget-container {
    margin: 25px 0;
}

.mozzeno-help-text {
    margin: 25px 0;
    font-size: 14px;
    color: #718096;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #f7fafc;
    border-radius: 8px;
}

.mozzeno-help-text .help-icon {
    font-size: 18px;
}

/* Enhanced button styles */
.mozzeno-buttons {
    margin-top: 25px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.mozzeno-redirect-page .btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mozzeno-redirect-page .btn-primary,
.mozzeno-redirect-page .mozzeno-manual-trigger {
    background: linear-gradient(135deg, #5b2a86 0%, #4a2270 100%);
    color: white;
}

.mozzeno-redirect-page .btn-primary:hover,
.mozzeno-redirect-page .mozzeno-manual-trigger:hover {
    background: linear-gradient(135deg, #4a2270 0%, #3a1a5a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 42, 134, 0.3);
}

.mozzeno-redirect-page .btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
}

.mozzeno-redirect-page .btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive design for redirect page */
@media (max-width: 768px) {
    .mozzeno-redirect-page body {
        padding: 20px 15px;
    }
    
    .mozzeno-redirect-page .redirect-container {
        padding: 30px 20px;
        border-radius: 12px;
    }
    
    .mozzeno-redirect-page h2 {
        font-size: 24px;
    }
    
    .mozzeno-redirect-page .redirect-description {
        font-size: 15px;
    }
    
    .mozzeno-redirect-page .order-details {
        padding: 15px;
    }
    
    .mozzeno-redirect-page .order-detail-item {
        font-size: 14px;
    }
    
    .mozzeno-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .mozzeno-redirect-page .btn {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
    }
}
