/* =================================================================
   Horecash card style - used by Product Deals V1 (style_one) widget
   Selectors are scoped under .horecash-card so they
   only apply where this markup is rendered.
   ================================================================= */

/* Default vertical gap between rows of cards.
   Overridable via the Elementor "Row Gap" control. */
.horecash-grid > [class*="col-"] { margin-bottom: 24px; }

/* Mobile: always 1 horecash card per row (overrides col-sm-6 from Elementor) */
@media (max-width: 575px) {
    .horecash-grid > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    /* And the same for the shop / category archive list */
    ul.products.columns-5 li.product {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Shop / category archive: WC's <ul class="products"> already lays out items
   in a grid via the theme. Just add row-gap so the cards breathe. */
ul.products .horecash-shop-item { margin-bottom: 24px; }
ul.products .horecash-shop-item .horecash-card { height: 100%; }

/* =========================================================================
   SHOP / CATEGORY ARCHIVE TOOLBAR
   Layout target:  [Title]  [Affichage …]                  [Tri par défaut ▾]
   All inside one full-width row.
   ========================================================================= */

/* Make the toolbar container span the full width */
.woocommerce-products-header,
.woocommerce-products-header > .position-relative,
.woocommerce-products-header .in_right {
    width: 100%;
}

/* Turn the inner row into a flex bar so title + count sit left, sort sits right */
.woocommerce-products-header .in_right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    padding: 12px 0;
}

/* === Category / shop title === */
.horecash-archive-title {
    font-size: 25px;              /* ← change title font size */
    font-weight: 700;             /* ← change title weight */
    color: #253D4E;               /* ← change title color */
    margin: 0;
    line-height: 1.2;
    padding-right: 8px;
}

/* === "Affichage de 1-6 sur X résultats" (result count) === */
.woocommerce-result-count {
    margin: 0;
    font-size: 13px;              /* ← change result-count font size */
    color: #6c757d;               /* ← change result-count color */
}

/* === "Tri par défaut" sort dropdown — pushed all the way right === */
.woocommerce-ordering {
    margin: 0 0 0 auto;
}
.woocommerce-ordering select {
    font-size: 13px;              /* ← change sort dropdown font size */
    color: #253D4E;               /* ← change sort dropdown color */
    padding: 6px 26px 6px 12px;
    border-radius: 6px;
    border: 1px solid #e3e3e3;
    background: #fff;
}

/* =========================================================================
   SHOP / CATEGORY ARCHIVE GRID — 5 cards per row by default
   ========================================================================= */
ul.products.columns-5 li.product {
    width: calc(20% - 16px);
    margin: 0 8px 24px;
    float: left;
    clear: none;
}
ul.products.columns-5 {
    margin-left: -8px;
    margin-right: -8px;
}
ul.products.columns-5::after {
    content: "";
    display: table;
    clear: both;
}
@media (max-width: 991px) {
    ul.products.columns-5 li.product { width: calc(33.333% - 16px); }
}
/* (Mobile shop archive width is overridden to 100% in the global mobile rule above.) */

.horecash-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.horecash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* --- Image area --- */
.horecash-image {
    background: #F4F4F4;
    position: relative;
    height: 260px;
    overflow: hidden;
}
.horecash-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Discount badge --- */
.horecash-discount {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #F26430;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 16px;
    letter-spacing: 0.2px;
    z-index: 2;
}

/* --- Wishlist heart ---
   We render our own visible heart icon and overlay the [woosw] shortcode
   on top (made invisible). This way the user sees a clean heart but the
   click goes to the WPC Smart Wishlist plugin's own handler. */
.horecash-wishlist {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: #fff;
    border-radius: 50%;
    color: #b4b4b4;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: color .2s ease;
    z-index: 2;
    overflow: hidden;
}
.horecash-wishlist:hover { color: #F26430; }

/* Visible heart icon (always shown) */
.horecash-wishlist .horecash-heart-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    pointer-events: none;
    line-height: 1;
    z-index: 1;
}

/* Wraps the [woosw] shortcode — invisible but covers the whole circle to capture clicks */
.horecash-wishlist .horecash-woosw-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    font-size: 0;
    color: transparent;
    line-height: 0;
}
.horecash-wishlist .horecash-woosw-overlay * {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-decoration: none !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}
.horecash-wishlist .horecash-woosw-overlay a,
.horecash-wishlist .horecash-woosw-overlay .woosw,
.horecash-wishlist .horecash-woosw-overlay .woosw-btn {
    cursor: pointer;
}

/* --- Content area --- */
.horecash-body { padding: 16px 18px 18px; }

.horecash-cat {
    display: inline-block;
    background: #e7580812;
    color: #e75808;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 4px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.horecash-brand {
    color: #C92B2B;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 10px 0 4px;
    letter-spacing: 0.3px;
}

.horecash-title {
    margin: 0 0 8px;
}
.horecash-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #253D4E;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    min-height: 38px;
    text-decoration: none;
}
.horecash-title a:hover { color: #3BB77E; }

.horecash-divider {
    border-top: 1px solid #ececec;
    margin: 12px 0;
}

/* --- Stock badge --- */
.horecash-stock {
    background: #E7F6EE;
    color: #2EAD6B;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
}
.horecash-stock::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #2EAD6B;
    display: inline-block;
}
.horecash-stock.is-out {
    background: #FBEAEA;
    color: #B73B3B;
}
.horecash-stock.is-out::before { background: #B73B3B; }

/* --- Price row: [now | stock badge] --- */
.horecash-price-stock {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.horecash-price-now {
    color: #8A1E1E;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}
.horecash-price-now .amount, .horecash-price-now bdi{
    color: #e75808!important;
    font-weight: 600!important;
    font-size: 18px!important;
}

/* --- Old price + Économisez (right-aligned, single line) --- */
.horecash-price-side {
    text-align: right;
    line-height: 1.3;
    margin-bottom: 14px;
}
.horecash-price-old {
    display: inline-block;
    color: #b4b4b4;
    text-decoration: line-through;
    font-size: 13px;
    font-weight: 600;
    margin-right: 8px;
    vertical-align: middle;
}
.horecash-price-save {
    display: inline-block;
    color: #2EAD6B;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    vertical-align: middle;
}

/* --- Quantity + Add to cart row --- */
.horecash-actions {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.horecash-add-form {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin: 0;
    flex: 1;
}
.horecash-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.horecash-qty button {
    width: 26px;
    height: 40px;
    background: transparent;
    border: 0;
    color: #6c757d;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.horecash-qty button:hover { color: #3BB77E; }
.horecash-qty input {
    width: 28px;
    height: 28px;
    border: 0;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #253D4E;
    background: transparent;
    -moz-appearance: textfield;
    padding: 0;
}
.horecash-qty input::-webkit-outer-spin-button,
.horecash-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.horecash-cart-btn {
    flex: 1!important;
    background: #3BB77E!important;
    color: #fff!important;
    border: 0!important;
    border-radius: 8px!important;
    padding: 5px 10px!important;
    font-size: 11.5px!important;
    font-weight: 700!important;
    display: inline-flex!important;
    align-items: center!important;
    justify-content: center!important;
    gap: 6px!important;
    letter-spacing: 0.3px!important;
    cursor: pointer!important;
    transition: background .2s ease!important;
    text-transform: uppercase!important;
    text-decoration: none!important;
    line-height: 1.2!important;
}
.horecash-cart-btn:hover { background: #2EA068; color: #fff; }
.horecash-cart-btn i { font-size: 14px; }

/* Loading state: button is disabled with a spinner replacing the cart icon */
.horecash-cart-btn.is-loading {
    opacity: 0.75;
    cursor: progress;
    pointer-events: none;
}
.horecash-cart-btn.is-loading i {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: horecash-spin 0.7s linear infinite;
}
.horecash-cart-btn.is-loading i::before { content: ""; }

/* Success state: brief background flash + confirmation text after adding to cart */
.horecash-cart-btn.is-added {
    background: #1F8754;
    pointer-events: none;
}
.horecash-cart-btn.is-added i {
    /* The check icon — neutralize spinner rules in case .is-loading lingered */
    border: 0;
    width: auto;
    height: auto;
    animation: none;
    border-radius: 0;
    font-size: 14px;
}

@keyframes horecash-spin {
    to { transform: rotate(360deg); }
}

/* When WooCommerce wraps loop add-to-cart inside an <a> link with .added_to_cart */
.horecash-add-form .added_to_cart { display: none; }

/* =========================================================================
   ADD-TO-CART CONFIRMATION MODAL
   Shown after a successful AJAX add-to-cart.
   ========================================================================= */
.horecash-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}
.horecash-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}
.horecash-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.horecash-modal-box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px 24px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    transform: scale(0.95);
    transition: transform .25s ease;
    text-align: center;
}
.horecash-modal.is-open .horecash-modal-box {
    transform: scale(1);
}
.horecash-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: transparent;
    border: 0;
    font-size: 26px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
}
.horecash-modal-close:hover { color: #253D4E; }

.horecash-modal-check {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #E7F6EE;
    color: #2EAD6B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 14px;
}

.horecash-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #253D4E;
    margin: 0 0 18px;
    line-height: 1.3;
}

.horecash-modal-product {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px;
    background: #F7F8FA;
    border-radius: 10px;
    text-align: left;
    margin-bottom: 20px;
}
.horecash-modal-img-wrap {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.horecash-modal-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.horecash-modal-info {
    flex: 1;
    min-width: 0;
}
.horecash-modal-name {
    font-size: 14px;
    font-weight: 600;
    color: #253D4E;
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.horecash-modal-qty {
    font-size: 12px;
    color: #6c757d;
}
.horecash-modal-price {
    font-size: 16px;
    font-weight: 700;
    color: #8A1E1E;
    margin-top: 4px;
}
.horecash-modal-price bdi { color: inherit; font-weight: inherit; }

.horecash-modal-actions {
    display: flex;
    gap: 10px;
}
.horecash-modal-continue,
.horecash-modal-checkout {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
    cursor: pointer;
    border: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
    line-height: 1.2;
}
.horecash-modal-continue {
    background: #F1F2F4;
    color: #253D4E;
}
.horecash-modal-continue:hover { background: #E3E5E8; }
.horecash-modal-checkout {
    background: #3BB77E;
    color: #fff !important;
}
.horecash-modal-checkout:hover { background: #2EA068; color: #fff !important; }

body.horecash-modal-open {
    overflow: hidden;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .horecash-modal { padding: 10px; }
    .horecash-modal-box { padding: 22px 16px 18px; border-radius: 12px; }
    .horecash-modal-title { font-size: 16px; margin-bottom: 14px; }
    .horecash-modal-product { gap: 10px; padding: 10px; }
    .horecash-modal-img-wrap { width: 58px; height: 58px; }
    .horecash-modal-name { font-size: 13px; }
    .horecash-modal-price { font-size: 15px; }
    .horecash-modal-actions { flex-direction: column; gap: 8px; }
    .horecash-modal-continue,
    .horecash-modal-checkout { padding: 11px 12px; font-size: 12px; }
}

/* =========================================================================
   FAVORITES LIST-PICKER MODAL
   Opens when a logged-in user clicks the heart on a product card.
   ========================================================================= */
.horecash-fav-btn {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    z-index: 3;
}

/* Saved-state visual: outline heart swapped for a filled SVG heart in brand color */
.horecash-wishlist.is-saved { color: #F26430; }
.horecash-wishlist.is-saved .horecash-heart-icon {
    color: #F26430;
    width: 16px;
    height: 16px;
    font-size: 0; /* hide the font glyph; the SVG mask below replaces it */
}
.horecash-wishlist.is-saved .horecash-heart-icon::before {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 14.25l-1-.92C3.4 10.36 1 8.28 1 5.5 1 3.42 2.42 2 4.5 2c1.74 0 3 1.31 3.5 2.5C8.5 3.31 9.76 2 11.5 2 13.58 2 15 3.42 15 5.5c0 2.78-2.4 4.86-6 7.83z'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 14.25l-1-.92C3.4 10.36 1 8.28 1 5.5 1 3.42 2.42 2 4.5 2c1.74 0 3 1.31 3.5 2.5C8.5 3.31 9.76 2 11.5 2 13.58 2 15 3.42 15 5.5c0 2.78-2.4 4.86-6 7.83z'/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size: contain;
            mask-size: contain;
}

/* Liste Favoris menu item icon (outline heart) */
.woocommerce-account .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--liste-favoris a::before {
    content: "\f1a2";
}

/* Success state inside the favorites picker modal */
.horecash-fav-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    background: #E7F6EE;
    color: #1F8754;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
}
.horecash-fav-success i { font-size: 18px; }

.horecash-fav-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 20px;
    text-align: left;
}
.horecash-fav-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #253D4E;
    transition: border-color .2s ease, background .2s ease;
}
.horecash-fav-option:hover { border-color: #3BB77E; background: #f8fbf9; }
.horecash-fav-option input {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: #3BB77E;
    flex-shrink: 0;
}
.horecash-fav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #6c757d;
    flex-shrink: 0;
}
.horecash-fav-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}
.horecash-fav-option input:checked ~ .horecash-fav-icon { color: #3BB77E; }
.horecash-fav-option input:checked ~ .horecash-fav-label { font-weight: 700; color: #1F8754; }

/* =========================================================================
   LISTE FAVORIS — My Account page
   ========================================================================= */
.nest-favoris-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid #ececec;
    margin-bottom: 24px;
}
.nest-favoris-tab {
    appearance: none;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: -1px;
}
.nest-favoris-tab:hover { color: #253D4E; }
.nest-favoris-tab.is-active {
    color: #3BB77E;
    border-bottom-color: #3BB77E;
}
.nest-favoris-tab-count {
    background: #F1F2F4;
    color: #6c757d;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 20px;
    line-height: 1.6;
}
.nest-favoris-tab.is-active .nest-favoris-tab-count {
    background: #E7F6EE;
    color: #3BB77E;
}

.nest-favoris-pane { display: none; }
.nest-favoris-pane.is-active { display: block; }

.nest-favoris-empty {
    text-align: center;
    color: #888;
    padding: 40px 16px;
    background: #fafafa;
    border-radius: 10px;
    margin: 0;
}

.nest-favoris-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}
.nest-favoris-grid .horecash-card {
    transition: opacity .2s ease, transform .2s ease;
}

/* Remove (×) button overlaid on the horecash image */
.nest-favoris-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: #fff;
    color: #999;
    border: 0;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 3;
    padding: 0;
}
.nest-favoris-remove:hover { color: #B73B3B; }

/* Liste Favoris cards: show full image, no cropping, slight padding */
.nest-favoris .horecash-image {
    height: 220px;
    background: #fff;
    padding: 12px;
}
.nest-favoris .horecash-image img {
    object-fit: contain;
    width: 100%;
    height: 100%;
}

@media (max-width: 480px) {
    .nest-favoris-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .nest-favoris .horecash-image { height: 160px; padding: 8px; }
}
