/* =============================================
   RAYON — Global styles (loaded on all pages)
   hello-elementor-child/assets/css/global.css
   ============================================= */

@font-face {
    font-family: 'Khuja Uppercase';
    src: url('../fonts/Khuja-Uppercase.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* ═══════════════════════════════════════
   FEATURED VENDORS SECTION (homepage)
   ═══════════════════════════════════════ */


/* Outer 2×2 grid — gap reveals the section background (set section bg to gray in Elementor) */

.rayon-featured-vendors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 40px;
    row-gap: 20px;
    width: 100%;
}


/* Each vendor card — horizontal split, no border (gap creates separation) */

.rayon-fv-card {
    display: flex;
    flex-direction: row;
    background: #fff;
    box-sizing: border-box;
}


/* Left: logo + name + count */

.rayon-fv-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    width: 42%;
    flex-shrink: 0;
    border-right: 1px solid #000000;
    text-align: center;
    gap: 14px;
    box-sizing: border-box;
}

.rayon-fv-logo-wrap {
    display: block;
}

.rayon-fv-logo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.rayon-fv-name {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #111;
    margin: 0;
    line-height: 1.2;
}

.rayon-fv-count {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 15px;
    color: rgba(0, 0, 0, 0.45);
    margin: 0;
}


/* Right: 2×2 product grid */

.rayon-fv-right {
    flex: 1;
    padding: 20px;
    min-width: 0;
}

.rayon-fv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    row-gap: 10px;
    column-gap: 10px;
    height: 100%;
}

.rayon-fv-product {
    display: block;
    overflow: hidden;
    aspect-ratio: 1;
    border: 0.5px solid #e8e8e8;
}

.rayon-fv-product img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.rayon-fv-product:hover img {
    opacity: 0.85;
}

.rayon-fv-product--empty {
    background: #e4e4e4;
}

@media (max-width: 768px) {
    .rayon-featured-vendors {
        grid-template-columns: 1fr;
        gap: 3px;
    }
    .rayon-fv-card {
        flex-direction: column;
    }
    .rayon-fv-left {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    .rayon-fv-logo {
        width: 110px;
        height: 110px;
    }
}


/* ═══════════════════════════════════════
   WISHLIST BUTTON
   ═══════════════════════════════════════ */

/* Product card wrappers need position:relative — NO overflow:hidden here
   (overflow:hidden would clip the absolutely-positioned wishlist button) */
.rayon-fv-product,
.rayon-vp-item {
    position: relative;
}

/* Vendor product grid item base styles */
.rayon-vp-item {
    display: block;
    overflow: hidden;
    aspect-ratio: 1;
}

.rayon-vp-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.rayon-vp-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Elementor Loop Item — position:relative so wishlist button anchors to the card.
   .e-loop-item = Elementor 3.x+    .elementor-loop-item = older Elementor */
.e-loop-item,
.elementor-loop-item {
    position: relative !important;
}

/* Hide the Shortcode widget container inside loop items.
   The JS injects the wishlist button directly — the Elementor widget is redundant
   and causes nested-anchor artifacts (grey lines). */
.e-loop-item .elementor-widget-shortcode,
.elementor-loop-item .elementor-widget-shortcode {
    display: none !important;
}

/* Featured vendors product grid — no wishlist button (too small) */
.rayon-fv-product .rayon-wl-wrap {
    display: none !important;
}

/* Wishlist wrap — positioned top-right of the image */
.rayon-wl-wrap {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    line-height: 0;
    pointer-events: auto;
}

/* Reset YITH container margins */
.rayon-wl-wrap .yith-wcwl-add-to-wishlist {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
}

/* All state containers */
.rayon-wl-wrap .yith-wcwl-add-button,
.rayon-wl-wrap .yith-wcwl-wishlistaddedbrowse,
.rayon-wl-wrap .yith-wcwl-wishlistexistsbrowse {
    line-height: 0 !important;
}

/* Every link → black 50×50 circle */
.rayon-wl-wrap .add_to_wishlist,
.rayon-wl-wrap .yith-wcwl-wishlistaddedbrowse a,
.rayon-wl-wrap .yith-wcwl-wishlistexistsbrowse a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 50px !important;
    height: 50px !important;
    background: #000 !important;
    border-radius: 50% !important;
    text-decoration: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    transition: background 0.15s !important;
}

@media (max-width: 768px) {
    .rayon-wl-wrap .add_to_wishlist,
    .rayon-wl-wrap .yith-wcwl-wishlistaddedbrowse a,
    .rayon-wl-wrap .yith-wcwl-wishlistexistsbrowse a {
        width: 30px !important;
        height: 30px !important;
    }
    
}

/* Hide all YITH text, labels, icons */
.rayon-wl-wrap span,
.rayon-wl-wrap .feedback,
.rayon-wl-wrap .yith-wcwl-icon,
.rayon-wl-wrap i {
    display: none !important;
}

/* Outlined heart — not in wishlist */
.rayon-wl-wrap .add_to_wishlist::before {
    content: '';
    display: block;
    width: 25.42px;
    height: 25.13px;;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

@media (max-width: 768px) {
    .rayon-wl-wrap .add_to_wishlist::before {
        width: 16.42px;
        height: 14.13px
    }

}

/* Filled heart — in wishlist (YITH updates these containers via its own AJAX) */
.rayon-wl-wrap .yith-wcwl-wishlistexistsbrowse a::before,
.rayon-wl-wrap .yith-wcwl-wishlistaddedbrowse a::before {
    content: '';
    display: block;
    width: 16.42px;
    height: 14.13px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}


/* ═══════════════════════════════════════
   WISHLIST TOAST NOTIFICATION
   ═══════════════════════════════════════ */

#rayon-wl-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    align-items: center;
    gap: 16px;
    background: #111;
    color: #fff;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 14px;
    padding: 14px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

#rayon-wl-toast.rayon-wl-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.rayon-wl-toast__msg {
    color: #fff;
}

.rayon-wl-toast__btn {
    color: #fff !important;
    text-decoration: underline !important;
    font-weight: 600;
    white-space: nowrap;
}

.rayon-wl-toast__btn:hover {
    color: #c1c1c1 !important;
    text-decoration: underline !important;
}

.rayon-wl-toast__close {
    background: none !important;
    border: none !important;
    color: #fff !important;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px !important;
    margin-left: 4px;
    opacity: 0.7;
    outline: none !important;
    box-shadow: none !important;
}

.rayon-wl-toast__close:hover,
.rayon-wl-toast__close:focus,
.rayon-wl-toast__close:active {
    background: none !important;
    background-color: transparent !important;
    color: #fff !important;
    opacity: 1;
    box-shadow: none !important;
    outline: none !important;
}

@media (max-width: 480px) {
    #rayon-wl-toast {
        bottom: 16px;
        left: 16px;
        right: 16px;
        transform: translateY(20px);
        white-space: normal;
        flex-wrap: wrap;
    }
    #rayon-wl-toast.rayon-wl-toast--visible {
        transform: translateY(0);
    }
}


/* ── RAYON header logo — force Khuja font on all pages ── */

header[data-elementor-type="header"] .elementor-heading-title,
header[data-elementor-type="header"] .elementor-widget-heading .elementor-heading-title {
    font-family: 'Khuja Uppercase', 'Josefin Sans', sans-serif !important;
    font-weight: 700 !important;
}


/* ═══════════════════════════════════════════
   ALL VENDORS GRID  [rayon_all_vendors]
   Used on the Créateur page
   ═══════════════════════════════════════════ */

.rayon-all-vendors {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.rayon-av-card {
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: inherit;
    border: 1px solid #656565;
}

.rayon-av-card:hover .rayon-av-img img {
    opacity: 0.85;
}

/* Square image area with padding so logo appears smaller */
.rayon-av-img {
    aspect-ratio: 1 / 1;
    background: #fff;
    padding: 24px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rayon-av-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s;
}

.rayon-av-info {
    padding: 12px 10px 16px;
}

.rayon-av-name {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin: 0 0 4px;
    line-height: 1.2;
}

.rayon-av-meta {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.45);
    margin: 0;
    line-height: 1.6;
}

.rayon-av-empty {
    font-family: 'Josefin Sans', sans-serif;
    color: rgba(0, 0, 0, 0.4);
    text-align: center;
    padding: 40px 0;
}

@media (max-width: 1024px) {
    .rayon-all-vendors { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .rayon-all-vendors { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (max-width: 480px) {
    .rayon-all-vendors { gap: 12px; }
}


/* ═══════════════════════════════════════════════════════════════
   LOOP GRID — Product card equal-height + vendor alignment fix
   Strategy:
     1. Build a height chain from grid cell → card → inner column
     2. Vendor widget (.e-con-inner's only direct text-editor child)
        gets margin-top:auto → pinned to card bottom
     3. Clamp title to 2 lines
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

    /* 1. Loop item is a CSS Grid cell — make it a flex column
          so its direct child (.e-con) can flex-grow to fill the row height */
    .e-loop-item,
    .elementor-loop-item {
        display: flex !important;
        flex-direction: column !important;
    }

    /* 2. Card container (.e-con) → height:100% fills the grid cell.
          Also keep it a flex column so .e-con-inner can flex-grow. */
    .e-loop-item > .e-con,
    .elementor-loop-item > .e-con {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
    }

    /* 3. Inner flex column (.e-con-inner) → flex:1 fills the card height.
          min-height:0 prevents overflow shrink-wrapping content. */
    .e-loop-item > .e-con > .e-con-inner,
    .elementor-loop-item > .e-con > .e-con-inner {
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }

    /* 4. Vendor widget is the ONLY direct .elementor-widget-text-editor
          child of .e-con-inner (the containers holding title/desc are
          .e-con children, not text-editor widgets).
          margin-top:auto pushes vendor + price to card bottom. */
    .e-loop-item .e-con-inner > .elementor-widget-text-editor,
    .elementor-loop-item .e-con-inner > .elementor-widget-text-editor {
        margin-top: auto !important;
    }

    /* 5. Product title — clamp to 2 lines */
    .e-loop-item .woocommerce-loop-product__title,
    .elementor-loop-item .woocommerce-loop-product__title,
    .e-loop-item .elementor-widget-woocommerce-product-title .elementor-heading-title,
    .elementor-loop-item .elementor-widget-woocommerce-product-title .elementor-heading-title {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 6. Category / short description — clamp to 2 lines */
    .e-loop-item .elementor-widget-woocommerce-product-short-description p,
    .elementor-loop-item .elementor-widget-woocommerce-product-short-description p {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}