/* ================================================
   MOZZENO FRONT-OFFICE CSS - INTERFACE AMÉLIORÉE
   ================================================ */

/* Variables CSS pour cohérence */
:root {
    --mozzeno-primary: #007cba;
    --mozzeno-primary-dark: #005a87;
    --mozzeno-success: #28a745;
    --mozzeno-warning: #ffc107;
    --mozzeno-light: #f8f9fa;
    --mozzeno-border: #dee2e6;
    --mozzeno-shadow: rgba(0, 0, 0, 0.1);
}

/* Reset styles PrestaShop */
.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;
}

/* Container principal */
.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 avec 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;
}

/* ======================================
   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: #007cba;
    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 #007cba;
}

.mozzeno-payment-info img {
    height: 24px;
    width: auto;
    margin-right: 12px;
    display: block;
}

.mozzeno-payment-info strong {
    color: #007cba;
    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 #28a745;
}

.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: #28a745;
    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: rgba(0, 124, 186, 0.05);
    border-radius: 6px;
}

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

/* 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-payment-btn {
    background-color: #007cba !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: #005a87 !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 */
.mozzeno-redirect-page {
    font-family: Arial, sans-serif;
}

.mozzeno-redirect-page body {
    text-align: center;
    padding: 50px;
    background: #f8f9fa;
}

.mozzeno-redirect-page .redirect-container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

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

.mozzeno-redirect-page .btn {
    background: #007cba;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px;
    text-decoration: none;
    display: inline-block;
}

.mozzeno-redirect-page .btn:hover {
    background: #005a8a;
}

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

.mozzeno-help-text {
    margin-top: 30px;
    font-size: 12px;
    color: #666;
}

.mozzeno-buttons {
    margin-top: 20px;
}

.mozzeno-redirect-page .btn-secondary {
    background: #6c757d !important;
}

.mozzeno-redirect-page .btn-secondary:hover {
    background: #5a6268 !important;
}
