/* =========================================================================
   Fudee — Styles complémentaires
   Tout ce que theme.json ne peut pas exprimer (animations, état hover, woo)
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Reset / réglages globaux
   ------------------------------------------------------------------------- */

html { scroll-behavior: smooth; }

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sélection texte aux couleurs Fudee */
::selection {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
}

/* -------------------------------------------------------------------------
   2. Liens et boutons : focus visible (a11y)
   ------------------------------------------------------------------------- */

:focus-visible {
    outline: 3px solid rgba(125, 198, 66, 0.5);
    outline-offset: 2px;
    border-radius: 4px;
}

.wp-block-button__link:hover {
    box-shadow: 0px 4px 12px rgba(125, 198, 66, 0.3);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.wp-block-button__link:active {
    transform: scale(0.98);
}

/* Bouton secondaire (style.is-style-outline) */
.wp-block-button.is-style-outline .wp-block-button__link {
    background: var(--wp--preset--color--light-green-bg);
    color: var(--wp--preset--color--primary);
    border: 2px solid var(--wp--preset--color--primary);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
}

/* -------------------------------------------------------------------------
   3. Header / Navigation
   ------------------------------------------------------------------------- */

.wp-block-template-part.site-header,
header.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--wp--preset--color--white);
    border-bottom: 1px solid var(--wp--preset--color--light-green-bg);
    box-shadow: var(--wp--preset--shadow--subtle);
}

.wp-block-navigation .wp-block-navigation-item__content {
    padding: 0 20px;
    height: 89px;
    display: flex;
    align-items: center;
    position: relative;
    transition: color 0.2s ease;
}

.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation .current-menu-item .wp-block-navigation-item__content {
    color: var(--wp--preset--color--primary);
}

.wp-block-navigation .current-menu-item .wp-block-navigation-item__content::after {
    content: '';
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 28px;
    height: 3px;
    background: var(--wp--preset--color--primary);
    border-radius: 2px;
}

/* -------------------------------------------------------------------------
   4. Cartes (produits, catégories, contenus génériques)
   ------------------------------------------------------------------------- */

.fudee-card {
    background: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--light-green-bg);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--wp--preset--shadow--subtle);
    transition: all 0.3s ease;
}

.fudee-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--wp--preset--shadow--elevated);
    border-color: var(--wp--preset--color--primary);
}

.fudee-card--highlighted {
    background: var(--wp--preset--color--pale-green);
    border-left: 4px solid var(--wp--preset--color--primary);
    border-radius: 8px;
    padding: 36px;
}

/* -------------------------------------------------------------------------
   5. Badges
   ------------------------------------------------------------------------- */

.fudee-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 16px;
    line-height: 1.4;
}

.fudee-badge--success {
    background: var(--wp--preset--color--light-green-bg);
    color: var(--wp--preset--color--success);
    border: 1px solid var(--wp--preset--color--success);
}

.fudee-badge--warning {
    background: #FFF8DC;
    color: var(--wp--preset--color--warning);
}

.fudee-badge--error {
    background: #FFE5E5;
    color: var(--wp--preset--color--error);
}

/* -------------------------------------------------------------------------
   6. Formulaires (commentaires, recherche, contact, WC)
   ------------------------------------------------------------------------- */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
    background: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--mint);
    border-radius: 4px;
    padding: 12px 16px;
    font-family: var(--wp--preset--font-family--open-sans);
    font-size: 16px;
    color: var(--wp--preset--color--heading);
    transition: all 0.2s ease;
    min-height: 48px;
    width: 100%;
}

input::placeholder,
textarea::placeholder {
    color: var(--wp--preset--color--secondary-muted);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--wp--preset--color--primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(125, 198, 66, 0.1);
}

label {
    display: block;
    font-weight: 600;
    color: var(--wp--preset--color--heading);
    margin-bottom: 8px;
    font-size: 14px;
}

/* -------------------------------------------------------------------------
   7. WooCommerce — ajustements visuels Fudee
   ------------------------------------------------------------------------- */

.fudee-wc .woocommerce-breadcrumb {
    font-size: 14px;
    color: var(--wp--preset--color--muted);
    margin-bottom: 32px;
}

.fudee-wc .woocommerce-breadcrumb a {
    color: var(--wp--preset--color--primary);
}

/* Boucle produits : carte produit */
.fudee-wc ul.products li.product {
    background: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--light-green-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--wp--preset--shadow--subtle);
    transition: all 0.3s ease;
    padding: 0;
}

.fudee-wc ul.products li.product:hover {
    transform: translateY(-4px);
    box-shadow: var(--wp--preset--shadow--elevated);
}

.fudee-wc ul.products li.product img {
    margin: 0;
    aspect-ratio: 1;
    object-fit: cover;
}

.fudee-wc ul.products li.product .woocommerce-loop-product__title {
    font-family: var(--wp--preset--font-family--signika);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.3;
    color: var(--wp--preset--color--heading);
    padding: 16px 20px 8px;
}

.fudee-wc ul.products li.product .price {
    font-family: var(--wp--preset--font-family--signika);
    font-weight: 700;
    font-size: 22px;
    color: var(--wp--preset--color--primary);
    padding: 0 20px 20px;
    display: block;
}

.fudee-wc ul.products li.product .price del {
    color: var(--wp--preset--color--muted);
    font-weight: 400;
    font-size: 16px;
}

/* Badge "Promo" sur la vignette */
.fudee-wc span.onsale {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    font-family: var(--wp--preset--font-family--open-sans);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 12px;
    border: none;
    min-height: auto;
    min-width: auto;
    line-height: 1.4;
    position: absolute;
    top: 12px;
    left: 12px;
    right: auto;
    margin: 0;
}

/* Bouton ajouter au panier sur la boucle */
.fudee-wc ul.products li.product .button {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    border-radius: 4px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 14px;
    margin: 0 20px 20px;
    display: inline-block;
}

.fudee-wc ul.products li.product .button:hover {
    background: var(--wp--preset--color--primary-hover);
}

/* Page produit unique */
.fudee-wc div.product .product_title {
    font-family: var(--wp--preset--font-family--signika);
    font-weight: 700;
    color: var(--wp--preset--color--heading);
    margin-bottom: 16px;
}

.fudee-wc div.product p.price,
.fudee-wc div.product span.price {
    font-family: var(--wp--preset--font-family--signika);
    font-weight: 700;
    font-size: 32px;
    color: var(--wp--preset--color--primary);
}

.fudee-wc div.product form.cart .quantity input {
    height: 48px;
    text-align: center;
}

.fudee-wc div.product form.cart .single_add_to_cart_button {
    height: 48px;
    padding: 0 32px;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    border-radius: 4px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.fudee-wc div.product form.cart .single_add_to_cart_button:hover {
    background: var(--wp--preset--color--primary-hover);
}

/* Onglets fiche produit */
.fudee-wc div.product .woocommerce-tabs ul.tabs {
    background: var(--wp--preset--color--pale-green);
    padding: 0;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.fudee-wc div.product .woocommerce-tabs ul.tabs li {
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
}

.fudee-wc div.product .woocommerce-tabs ul.tabs li a {
    color: var(--wp--preset--color--muted);
    font-weight: 600;
    padding: 16px 24px;
    transition: all 0.2s ease;
}

.fudee-wc div.product .woocommerce-tabs ul.tabs li.active {
    background: var(--wp--preset--color--white);
    border-bottom: 3px solid var(--wp--preset--color--primary);
}

.fudee-wc div.product .woocommerce-tabs ul.tabs li.active a {
    color: var(--wp--preset--color--primary);
}

/* Messages d'état */
.fudee-wc .woocommerce-message,
.fudee-wc .woocommerce-info,
.fudee-wc .woocommerce-error {
    border-radius: 8px;
    padding: 16px 20px;
    border-top: none;
    border-left: 4px solid var(--wp--preset--color--primary);
    background: var(--wp--preset--color--pale-green);
    color: var(--wp--preset--color--heading);
}

.fudee-wc .woocommerce-error {
    border-left-color: var(--wp--preset--color--error);
    background: #FFE5E5;
}

/* Mini-panier dans le header */
.wp-block-woocommerce-mini-cart {
    color: var(--wp--preset--color--heading);
}

/* -------------------------------------------------------------------------
   8. Utilitaires
   ------------------------------------------------------------------------- */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    padding: 12px 24px;
    border-radius: 0 0 8px 0;
    position: absolute;
    top: -100px;
    left: 0;
    z-index: 9999;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* -------------------------------------------------------------------------
   9. Responsive — overrides ciblés
   ------------------------------------------------------------------------- */

@media (max-width: 991px) {
    .wp-block-navigation__responsive-container {
        background: var(--wp--preset--color--dark-navy);
    }
    .wp-block-navigation__responsive-container .wp-block-navigation-item__content {
        color: var(--wp--preset--color--white);
        height: auto;
        padding: 16px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
}

@media (max-width: 575px) {
    .fudee-wc ul.products li.product .woocommerce-loop-product__title {
        font-size: 18px;
    }
    .fudee-wc div.product p.price,
    .fudee-wc div.product span.price {
        font-size: 26px;
    }
}
