/**
 * Cassandre Verdier - Design produit & Widget Elementor
 * Design pre-configure type Shopify, overridable via Elementor.
 */

/* ===================================================================
   OPTIONS PRODUIT (table .variations sur produits simples)
   =================================================================== */

table.variations.eds-product-options {
    margin-bottom: 1em;
    width: 100%;
}

table.variations.eds-product-options td.value select {
    width: 100%;
}

table.variations.eds-product-options tr,
table.variations.eds-product-options td {
    background: transparent !important;
}

/* Reset fond/hover sur TOUTES les tables variations dans le widget */
.eds-widget-options .variations tr,
.eds-widget-options .variations td,
.eds-widget-options .variations tr:nth-child(even),
.eds-widget-options .variations tr:nth-child(odd),
.eds-widget-options .variations tr:hover,
.eds-widget-options .variations tr:hover td,
.eds-widget-variable-product .variations tr,
.eds-widget-variable-product .variations td,
.eds-widget-variable-product .variations tr:nth-child(even),
.eds-widget-variable-product .variations tr:nth-child(odd),
.eds-widget-variable-product .variations tr:hover,
.eds-widget-variable-product .variations tr:hover td {
    background: transparent !important;
    background-color: transparent !important;
}

/* Force transparent sur td.label et td.value */
.eds-widget-options .variations .label,
.eds-widget-options .variations td.label,
.eds-widget-options .variations td.value,
.eds-widget-variable-product .variations .label,
.eds-widget-variable-product .variations td.label,
.eds-widget-variable-product .variations td.value,
.eds-fiche-produit .variations .label,
.eds-fiche-produit .variations td.label,
.eds-fiche-produit .variations td.value,
.eds-fiche-produit .variations td,
.eds-fiche-produit .variations th {
    background: transparent !important;
    background-color: transparent !important;
}

/* ===================================================================
   LAYOUT 2 COLONNES
   =================================================================== */

.eds-fiche-produit {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.eds-fiche-produit.eds-layout-inverse {
    flex-direction: row-reverse;
}

/* Ratios */
.eds-fiche-produit.eds-ratio-40-60 > .eds-gallery { flex: 0 0 40%; }
.eds-fiche-produit.eds-ratio-40-60 > .eds-product-info { flex: 1; }

.eds-fiche-produit.eds-ratio-45-55 > .eds-gallery { flex: 0 0 45%; }
.eds-fiche-produit.eds-ratio-45-55 > .eds-product-info { flex: 1; }

.eds-fiche-produit.eds-ratio-50-50 > .eds-gallery { flex: 0 0 calc(50% - 25px); }
.eds-fiche-produit.eds-ratio-50-50 > .eds-product-info { flex: 1; }

.eds-fiche-produit.eds-ratio-55-45 > .eds-gallery { flex: 0 0 55%; }
.eds-fiche-produit.eds-ratio-55-45 > .eds-product-info { flex: 1; }

.eds-fiche-produit.eds-ratio-60-40 > .eds-gallery { flex: 0 0 60%; }
.eds-fiche-produit.eds-ratio-60-40 > .eds-product-info { flex: 1; }

/* ===================================================================
   GALERIE - STICKY
   =================================================================== */

.eds-gallery {
    position: sticky;
    top: 30px;
    align-self: flex-start;
    min-width: 0;
}

.eds-gallery.eds-no-sticky {
    position: static;
}

/* ===================================================================
   GALERIE - IMAGE PRINCIPALE
   =================================================================== */

.eds-gallery-main {
    overflow: hidden;
    border-radius: 12px;
    background: #f8f8f8;
}

.eds-main-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ===================================================================
   GALERIE - CAROUSEL MINIATURES
   =================================================================== */

.eds-gallery-carousel {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.eds-carousel-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
}

.eds-carousel-track::-webkit-scrollbar {
    display: none;
}

.eds-thumb {
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    scroll-snap-align: start;
    transition: opacity 0.2s, border-color 0.2s;
}

.eds-thumb:hover {
    opacity: 0.8;
}

.eds-thumb-active {
    opacity: 1;
    border-color: #1a1a1a;
}

/* Fleches carousel */
.eds-carousel-prev,
.eds-carousel-next {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.2s, opacity 0.2s;
    padding: 0;
}

.eds-carousel-prev:hover,
.eds-carousel-next:hover {
    border-color: #1a1a1a;
}

/* ===================================================================
   INFOS PRODUIT - DESIGN SHOPIFY
   =================================================================== */

.eds-product-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Titre */
.eds-widget-title {
    margin: 0;
    padding: 0;
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Prix */
.eds-widget-price {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.eds-widget-price del {
    opacity: 0.5;
    font-weight: 400;
}

.eds-widget-price ins {
    text-decoration: none;
}

/* Description */
.eds-widget-description {
    font-size: 15px;
    line-height: 1.65;
    color: #555;
}

.eds-widget-description p:last-child {
    margin-bottom: 0;
}

/* Separateur avant options (produits simples uniquement) */
.eds-widget-options {
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Pas de separateur sur les produits variables (le form WC gere lui-meme) */
.eds-widget-options.eds-widget-variable-product {
    padding-top: 0 !important;
    border-top: none !important;
}

/* Labels options */
.eds-widget-options .variations td.label,
.eds-widget-options .variations td.label label,
.eds-widget-variable-product .variations td.label,
.eds-widget-variable-product .variations td.label label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 4px;
    white-space: nowrap;
    vertical-align: middle;
}

/* Selects options */
.eds-widget-options .variations select,
.eds-widget-options .variations td.value select,
.eds-widget-variable-product .variations select,
.eds-widget-variable-product .variations td.value select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    font-size: 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    transition: border-color 0.2s;
    cursor: pointer;
}

.eds-widget-options .variations select:focus,
.eds-widget-variable-product .variations select:focus {
    border-color: #1a1a1a;
    outline: none;
    box-shadow: 0 0 0 1px #1a1a1a;
}

/* Espacement lignes options */
.eds-widget-options .variations tr td,
.eds-widget-variable-product .variations tr td {
    padding-bottom: 12px;
}

.eds-widget-options .variations tr:last-child td,
.eds-widget-variable-product .variations tr:last-child td {
    padding-bottom: 0;
}

/* Alignement labels et champs a gauche */
.eds-widget-options .variations td.label,
.eds-widget-options .variations td.value,
.eds-widget-options .variations td,
.eds-widget-options .variations th,
.eds-widget-variable-product .variations td.label,
.eds-widget-variable-product .variations td.value,
.eds-widget-variable-product .variations td,
.eds-widget-variable-product .variations th,
.eds-fiche-produit .variations td.label,
.eds-fiche-produit .variations td.value,
.eds-fiche-produit .variations td,
.eds-fiche-produit .variations th {
    text-align: left !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Labels dans les produits variables - alignement gauche */
.eds-widget-variable-product .variations td.label label,
.eds-widget-variable-product .variations .label label,
.eds-fiche-produit .variations td.label label,
.eds-fiche-produit .variations .label label {
    text-align: left !important;
    display: block;
}

/* Selects variables - pleine largeur et alignes */
.eds-widget-variable-product .variations td.value,
.eds-widget-variable-product .variations td.value select {
    width: 100% !important;
}

/* Reset de la table variations variable pour garantir la largeur */
.eds-widget-variable-product .variations,
.eds-widget-variable-product .variations_form .variations {
    width: 100% !important;
    table-layout: auto !important;
}

/* Reset tout margin/padding parasite sur le form variable */
.eds-widget-variable-product .variations_form {
    padding: 0 !important;
}

/* Reset lien "Effacer" WC */
.eds-widget-variable-product .reset_variations {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: #888;
    text-decoration: none;
}

/* Formulaire */
.eds-widget-cart-form,
.eds-widget-variable-product .variations_form {
    margin: 0;
}

/* Reset TOTAL barres/bordures WooCommerce sur le form variable */
.eds-widget-variable-product,
.eds-widget-variable-product .variations_form,
.eds-widget-variable-product .variations_form .variations,
.eds-widget-variable-product .variations,
.eds-widget-variable-product table,
.eds-widget-variable-product .variations tr,
.eds-widget-variable-product .variations td,
.eds-widget-variable-product .variations th,
.eds-widget-variable-product .variations tbody,
.eds-widget-variable-product .single_variation_wrap,
.eds-widget-variable-product .woocommerce-variation,
.eds-widget-variable-product .woocommerce-variation-add-to-cart,
.eds-widget-variable-product .woocommerce-variation-description,
.eds-widget-variable-product .woocommerce-variation-price,
.eds-widget-variable-product .woocommerce-variation-availability {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
    outline: none !important;
    border-collapse: collapse;
}

/* Prix variable (quand on selectionne une variante) */
.eds-widget-variable-product .woocommerce-variation-price .price,
.eds-widget-variable-product .woocommerce-variation-price .amount {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

/* Separateur + bouton */
.eds-widget-add-to-cart-row,
.eds-widget-variable-product .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Quantite */
.eds-widget-quantity .quantity .qty,
.eds-widget-variable-product .quantity .qty {
    width: 70px;
    text-align: center;
    padding: 12px 8px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 15px;
    color: #333;
    -moz-appearance: textfield;
}

.eds-widget-quantity .quantity .qty::-webkit-inner-spin-button,
.eds-widget-quantity .quantity .qty::-webkit-outer-spin-button,
.eds-widget-variable-product .quantity .qty::-webkit-inner-spin-button,
.eds-widget-variable-product .quantity .qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Bouton Ajouter au panier */
.eds-widget-button {
    flex: 1;
}

.eds-widget-button .single_add_to_cart_button,
.eds-widget-variable-product .single_add_to_cart_button {
    display: block;
    width: 100%;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    color: #fff;
    background: #1a1a1a;
    border: 2px solid #1a1a1a;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.25s, color 0.25s;
    line-height: 1.4;
}

.eds-widget-button .single_add_to_cart_button:hover,
.eds-widget-variable-product .single_add_to_cart_button:hover {
    background-color: transparent;
    color: #1a1a1a;
}

/* ===================================================================
   CHAMP TEXTE LIBRE
   =================================================================== */

.eds-custom-field-wrap {
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.eds-custom-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.eds-custom-field-label .required {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 400;
}

.eds-custom-field-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.eds-custom-field-textarea:focus {
    border-color: #1a1a1a;
    outline: none;
    box-shadow: 0 0 0 1px #1a1a1a;
}

.eds-custom-field-textarea::placeholder {
    color: #aaa;
    font-style: italic;
}

/* Variable product - variation info */
.eds-widget-variable-product .woocommerce-variation-price,
.eds-widget-variable-product .woocommerce-variation-availability {
    margin-bottom: 10px;
}

.eds-widget-variable-product .woocommerce-variation-add-to-cart .button {
    flex: 1;
}

/* Wrapper des deux boutons */
.eds-widget-buttons-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* Bouton Acheter maintenant */
.eds-buy-now-button {
    display: block;
    width: 100%;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    color: #1a1a1a;
    background: transparent;
    border: 2px solid #1a1a1a;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.25s, color 0.25s;
    line-height: 1.4;
}

.eds-buy-now-button:hover {
    background-color: #1a1a1a;
    color: #fff;
}

/* ===================================================================
   UPLOAD PHOTO D'INSPIRATION
   =================================================================== */

.eds-upload-field-wrap {
    padding-top: 16px;
}

.eds-upload-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.eds-upload-field-label .required {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 400;
}

.eds-upload-dropzone {
    border: 2px dashed #d0d0d0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
}

.eds-upload-dropzone:hover {
    border-color: #999;
}

.eds-upload-dropzone input[type="file"] {
    width: 100%;
    cursor: pointer;
}

.eds-upload-hint {
    font-size: 12px;
    color: #999;
    margin: 8px 0 0;
}

.eds-upload-preview {
    margin-top: 10px;
    position: relative;
    display: inline-block;
}

.eds-upload-thumb {
    max-width: 120px;
    max-height: 120px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #e0e0e0;
}

.eds-upload-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1a1a1a;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    padding: 0;
    transition: background-color 0.2s;
}

.eds-upload-remove:hover {
    background: #e74c3c;
}

/* ===================================================================
   UTILITAIRES SHOW/HIDE
   =================================================================== */

.eds-hide-variations .variations {
    display: none !important;
}

.eds-hide-quantity .quantity {
    display: none !important;
}

.eds-hide-button .single_add_to_cart_button {
    display: none !important;
}

/* ===================================================================
   FORMULAIRE DEVIS (mode devis)
   =================================================================== */

.eds-quote-price {
    font-style: italic;
    color: #888 !important;
}

.eds-quote-form {
    margin-top: 20px;
}

.eds-quote-options {
    margin-bottom: 20px;
}

.eds-quote-options .eds-option-group {
    margin-bottom: 14px;
}

.eds-quote-options .eds-option-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.eds-quote-options .eds-option-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    appearance: auto;
}

.eds-quote-contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 20px 0;
}

.eds-quote-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.eds-quote-field label .required,
.eds-quote-field label abbr.required {
    color: #e74c3c;
    text-decoration: none;
}

.eds-quote-field input[type="text"],
.eds-quote-field input[type="email"],
.eds-quote-field input[type="tel"],
.eds-quote-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
}

.eds-quote-field input:focus,
.eds-quote-field textarea:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.08);
}

.eds-quote-field-full {
    grid-column: 1 / -1;
}

.eds-quote-submit {
    width: 100%;
    padding: 14px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    margin-top: 4px;
}

.eds-quote-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.eds-quote-feedback {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.eds-quote-success {
    background: #e8f8ef;
    color: #27ae60;
    border: 1px solid #c3e6cb;
}

.eds-quote-error {
    background: #fdf0f0;
    color: #e74c3c;
    border: 1px solid #f5c6cb;
}

@media screen and (max-width: 480px) {
    .eds-quote-contact {
        grid-template-columns: 1fr;
    }
}

/* ===================================================================
   PLACEHOLDER EDITEUR ELEMENTOR
   =================================================================== */

.eds-widget-placeholder {
    padding: 60px 20px;
    background: #fafafa;
    text-align: center;
    border: 2px dashed #ddd;
    border-radius: 12px;
    color: #999;
    font-size: 14px;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */

@media (max-width: 767px) {
    .eds-fiche-produit,
    .eds-fiche-produit.eds-layout-inverse {
        flex-direction: column;
    }

    .eds-fiche-produit > .eds-gallery,
    .eds-fiche-produit > .eds-product-info {
        flex: none !important;
        width: 100%;
    }

    .eds-gallery {
        position: static;
    }

    .eds-widget-title {
        font-size: 22px;
    }

    .eds-widget-price {
        font-size: 18px;
    }

    /* Bouton sticky en bas sur mobile */
    .eds-btn-sticky-mobile-yes .eds-widget-button {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        background: #fff;
        padding: 12px 16px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        margin: 0;
    }

    .eds-btn-sticky-mobile-yes .eds-widget-button .single_add_to_cart_button {
        border-radius: 6px;
    }

    /* Espace en bas pour ne pas cacher le contenu derriere le bouton sticky */
    .eds-btn-sticky-mobile-yes .eds-fiche-produit {
        padding-bottom: 80px;
    }
}
