/**
 * Custom Gift Card Styles - Etoilium
 * Styles personnalisés pour le formulaire de carte cadeau
 * Version: 1.0
 */

/* ========================================
   VARIABLES CSS
   ======================================== */
:root {
    --pwgc-primary-color: #7371B4;
    --pwgc-secondary-color: #7371B4;
    --pwgc-accent-color: #F39200;
    --pwgc-text-color: #7371B4;
    --pwgc-light-bg: #F5F5FA;
    --pwgc-border-color: #D0D0E0;
    --pwgc-card-shadow: 0 4px 12px rgba(123, 104, 184, 0.15);
    --pwgc-hover-shadow: 0 6px 20px rgba(123, 104, 184, 0.25);
}

/* ========================================
   CONTENEUR PRINCIPAL
   ======================================== */
.pwgc-etoilium-container {
    font-family: "Nunito", Sans-serif;
}

/* ========================================
   TEXTE D'AIDE (HINT)
   ======================================== */
.pwgc-field-hint {
    font-size: 13px;
    color: #999;
    margin-top: 6px;
    font-style: italic;
}

/* ========================================
   CHAMP DE DATE - STYLE SIMPLE
   ======================================== */

/* Forcer le masquage du calendrier Pikaday */
.pika-single {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Icône calendrier pour le champ de date */
#pwgc-delivery-date {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237371B4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 15px center !important;
    background-size: 18px 18px !important;
    padding-right: 45px !important;
}

#pwgc-delivery-date:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23F39200' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") !important;
}

/* Message d'erreur pour format invalide */
.pwgc-date-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.pwgc-date-input.error {
    border-color: #e74c3c !important;
}

.pwgc-date-input.error + .pwgc-field-hint + .pwgc-date-error {
    display: block;
}

/* ========================================
   TITRES DE SECTION
   ======================================== */
.pwgc-section-title h2 {
    color: var(--pwgc-primary-color);
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    font-family: "jaf-domus-titling-web", Sans-serif;
}

/* ========================================
   GRILLE DE SÉLECTION DES MONTANTS
   ======================================== */
.pwgc-amount-cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    margin-top: 40px;
}

/* ========================================
   CARTES DE MONTANT
   ======================================== */
.pwgc-amount-card {
    background: white;
    border: 2px solid var(--pwgc-border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: var(--pwgc-card-shadow);
    max-width: 233px;
}

.pwgc-amount-card[data-price="30"] .pwgc-amount-price {
    background-color: #ECF6F0;
}

.pwgc-amount-card[data-price="65"] .pwgc-amount-price {
    background-color: #F9F8DF;
}

.pwgc-amount-card[data-price="100"] .pwgc-amount-price {
    background-color: #EBFCFF;
}

.pwgc-amount-card[data-amount="custom"] .pwgc-amount-label {
    background-color: #FFEBEB;
}

.pwgc-amount-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--pwgc-hover-shadow);
    border-color: var(--pwgc-primary-color);
}

.pwgc-amount-card.selected {
    border-color: var(--pwgc-primary-color);
    box-shadow: 0 0 0 3px rgba(123, 104, 184, 0.2);
}

.pwgc-amount-card.selected[data-price="30"] {
    background-color: #ECF6F0;
}

.pwgc-amount-card.selected[data-price="65"] {
    background-color: #F9F8DF;
}

.pwgc-amount-card.selected[data-price="100"] {
    background-color: #EBFCFF;
}

.pwgc-amount-card.selected[data-amount="custom"] {
    background-color: #FFEBEB;
}

.pwgc-amount-card.selected::before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: var(--pwgc-primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

/* Prix du montant */
.pwgc-amount-price, .pwgc-amount-label {
    font-size: 35px;
    font-weight: 700;
    color: var(--pwgc-primary-color);
    margin: auto;
    margin-bottom: 0;
    margin-top: -40px;
    font-family: "jaf-domus-titling-web", Sans-serif;
    width: fit-content;
    border-radius: 10px;
    padding: 5px 10px;
    line-height: 1;
}

/* Label pour montant libre */
.pwgc-amount-label {
    font-size: 20px;
    margin-top: -35px;
}

/* Image de la carte */
.pwgc-amount-image {
    margin: 15px 0;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwgc-amount-image img {
    max-width: 100%;
    height: auto;
    max-height: 120px;
    object-fit: contain;
}

/* Description du montant */
.pwgc-amount-description {
    font-size: 16px;
    color: var(--pwgc-text-color);
    line-height: 1.3;
    margin-top: 10px;
}

/* ========================================
   MONTANT PERSONNALISÉ
   ======================================== */
.pwgc-custom-input-wrapper {
    margin-top: 15px;
    position: relative;
}

.pwgc-custom-amount-field {
    width: 100%;
    padding: 10px 30px 10px 10px;
    border: 1px solid #7371B4 !important;
    border-radius: 8px !important;
    font-size: 16px;
    color: #7371B4;
    text-align: center;
    transition: border-color 0.3s ease;
    background-color: #F9F8FE;
    width: 100px !important;
}

.pwgc-custom-amount-field::placeholder {
    color: #7371B4;
    font-size: 13px;
}

.pwgc-custom-amount-field:focus {
    outline: none;
    border-color: var(--pwgc-primary-color);
}

.pwgc-currency-symbol {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: var(--pwgc-text-color);
}

/* ========================================
   WRAPPER FORMULAIRE + APERÇU
   ======================================== */
.pwgc-form-preview-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 40px;
}

@media (min-width: 992px) {
    .pwgc-form-preview-wrapper {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========================================
   COLONNE FORMULAIRE
   ======================================== */
/*.pwgc-form-column {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--pwgc-card-shadow);
}*/

.pwgc-form-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--pwgc-card-shadow);
}

/* Ligne de champs (côte à côte sur desktop) */
.pwgc-field-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .pwgc-field-row {
        flex-direction: row;
        gap: 15px;
    }
    
    .pwgc-field-row .pwgc-field-group {
        flex: 1;
    }
}

/* Groupe de champs */
.pwgc-field-group {
    display: flex;
    flex-direction: column;
}

.pwgc-field-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--pwgc-text-color);
    margin-bottom: 8px;
}

/* Champs de saisie */
.pwgc-input-field,
.pwgc-textarea-field {
    width: 100%;
    border: 1px solid var(--pwgc-primary-color) !important;
    border-radius: 8px !important;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    color: #7371B4 !important;
}

.pwgc-input-field::placeholder,
.pwgc-textarea-field::placeholder {
    color: #7371B4 !important;
}

.pwgc-input-field:focus,
.pwgc-textarea-field:focus {
    outline: none;
    border-color: var(--pwgc-primary-color);
    box-shadow: 0 0 0 3px rgba(123, 104, 184, 0.1);
}

.pwgc-textarea-field {
    min-height: 100px;
    resize: vertical;
}

/* Compteur de caractères */
.pwgc-char-counter {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

/* ========================================
   BOUTON AJOUTER AU PANIER
   ======================================== */

.pwgc-add-to-cart-button {
    width: fit-content;
    padding: 10px 30px;
    background: var(--pwgc-accent-color);
    color: white;
    border: none !important;
    font-size: 20px !important;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "jaf-domus-titling-web", Sans-serif !important;
}

.pwgc-add-to-cart-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
}

.pwgc-add-to-cart-button:active {
    transform: translateY(0);
}

.pwgc-add-to-cart-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   COLONNE APERÇU
   ======================================== */
/*.pwgc-preview-column {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--pwgc-card-shadow);
}*/

.pwgc-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--pwgc-card-shadow);
}

/* Bouton d'aperçu */
.pwgc-preview-button {
    width: fit-content;
    padding: 10px 25px;
    background-color: var(--pwgc-primary-color) !important;
    color: white;
    border: none !important;
    font-size: 16px !important;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "jaf-domus-titling-web", Sans-serif !important;
}

.pwgc-preview-button:hover {
    background: var(--pwgc-secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 104, 184, 0.3);
}

/* Placeholder de l'aperçu */
.pwgc-preview-placeholder {
    text-align: center;
    padding: 0 30px;
}

.pwgc-preview-card-mockup {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    max-width: 550px;
}

.pwgc-preview-text {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Iframe de l'aperçu */
.pwgc-preview-iframe {
    width: 100%;
    min-height: 500px;
    border: 2px solid var(--pwgc-border-color);
    border-radius: 8px;
    background: white;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 991px) {
    .pwgc-form-preview-wrapper {
        display: block;
    }
    
    .pwgc-preview-column {
        order: 2;
    }
}

@media (max-width: 767px) {

    .pwgc-form-fields, .pwgc-preview-container {
        background-color: transparent;
        padding: 0;
        box-shadow: none;
    }

    .pwgc-preview-placeholder {
        padding: 0;
    }

    .pwgc-amount-card {
        max-width: 47%;
        padding: 10px;
    }

    .pwgc-amount-cards-grid {
        gap: 30px 15px;
    }
    
    .pwgc-amount-price {
        font-size: 24px;
        margin-top: -28px;
    }

    .pwgc-amount-label {
        font-size: 14px;
        margin-top: -23px;
    }

    .pwgc-amount-image {
        margin: 5px 0;
    }
    
    .pwgc-amount-description {
        font-size: 12px;
        min-height: auto;
    }
    
    .pwgc-add-to-cart-button {
        font-size: 17px !important;
        padding: 8px 22px !important;
    }

    .pwgc-preview-button {
        font-size: 12px !important;
        padding: 7px 15px !important;
    }

    .pwgc-section-title h2 {
        font-size: 20px;
    }
    
    .pwgc-form-column,
    .pwgc-preview-column {
        padding: 0;
    }

    .pwgc-preview-column {
        margin-top: 40px;
    }

    .pwgc-currency-symbol {
        right: 5px;
    }
}

/* ========================================
   MASQUER LES ÉLÉMENTS PAR DÉFAUT DU PLUGIN
   ======================================== */
.product-type-pw-gift-card .variations {
    display: none !important;
}

.woocommerce-variation-price {
    display: none !important;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pwgc-amount-card,
.pwgc-field-group {
    animation: fadeIn 0.3s ease;
}

/* ========================================
   ÉTATS ET MESSAGES
   ======================================== */
.pwgc-error-message {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
}

.pwgc-success-message {
    color: #28a745;
    font-size: 13px;
    margin-top: 5px;
}

/* ========================================
   ACCESSIBILITÉ
   ======================================== */
.pwgc-amount-card:focus,
.pwgc-input-field:focus,
.pwgc-textarea-field:focus,
.pwgc-add-to-cart-button:focus,
.pwgc-preview-button:focus {
    outline: 2px solid var(--pwgc-primary-color);
    outline-offset: 2px;
}

/* ========================================
   COMPATIBILITÉ ELEMENTOR
   ======================================== */
.elementor-widget-container .pwgc-etoilium-container {
    padding: 0;
}

.elementor-section .pwgc-etoilium-container {
    max-width: 100%;
}
