/* ============================================================
   AdForest Seller Widget v2 — afsw-style.css
   Architecture :
     - .afsw-seller-slide  : un slide = un vendeur complet
     - Slides masqués par défaut, seul .afsw-active est visible
     - .afsw-seller-nav    : flèches ← → pour changer de vendeur
     - .afsw-dots          : pagination des ANNONCES (dots)
   Mobile-first, 100 % responsive
   ============================================================ */

/* ── Reset ────────────────────────────────────────────────── */
.afsw-wrapper *,
.afsw-wrapper *::before,
.afsw-wrapper *::after {
    box-sizing: border-box;
}

/* ── Wrapper global ───────────────────────────────────────── */
.afsw-wrapper {
    font-family: inherit;
    color: #222;
    width: 100%;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #ebebeb;
    overflow: hidden;
    position: relative;
}

/* ══════════════════════════════════════════════════════════
   SELLER SLIDES
   ══════════════════════════════════════════════════════════ */
.afsw-seller-slide {
    display: none;          /* hidden by default */
    width: 100%;
    padding: 20px 18px;
}

.afsw-seller-slide.afsw-active {
    display: block;
}

/* Slide fade animation */
.afsw-seller-slide.afsw-fade-in {
    animation: afswFadeIn .25s ease both;
}

@keyframes afswFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* ══════════════════════════════════════════════════════════
   INNER LAYOUT (sidebar + carousel)
   Mobile : stacked
   Desktop: side by side
   ══════════════════════════════════════════════════════════ */
.afsw-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .afsw-inner {
        flex-direction: row;
        align-items: flex-start;
        gap: 24px;
    }
}

/* ══════════════════════════════════════════════════════════
   SELLER SIDEBAR
   ══════════════════════════════════════════════════════════ */
.afsw-seller-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

@media (min-width: 768px) {
    .afsw-seller-sidebar {
        width: 220px;
        min-width: 200px;
        flex-shrink: 0;
    }
}

/* Avatar + name + rating */
.afsw-seller-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.afsw-avatar-wrap { flex-shrink: 0; }

.afsw-avatar {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
    display: block;
}

@media (max-width: 767px) {
    .afsw-avatar { width: 52px; height: 52px; }
}

.afsw-seller-info { flex: 1; min-width: 0; }

.afsw-seller-name {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 5px;
    line-height: 1.3;
    color: #1a1a1a;
    word-break: break-word;
}

/* Stars + rating */
.afsw-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    font-size: 12px;
}

.afsw-rating-val {
    font-weight: 700;
    color: #e63946;
    font-size: 12px;
}

.afsw-stars { display: inline-flex; gap: 2px; }

.afsw-stars i      { font-size: 11px; color: #e63946; }
.afsw-stars i.far  { color: #ccc; }

.afsw-rating-count { color: #888; font-size: 11px; }

/* Address */
.afsw-seller-address {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

.afsw-seller-address i {
    color: #999;
    margin-top: 2px;
    flex-shrink: 0;
    font-size: 12px;
}

/* Ads count link */
.afsw-ads-count-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
    line-height: 1.4;
}

.afsw-ads-count-link:hover      { color: #e63946; text-decoration: none; }
.afsw-ads-count-link i          { font-size: 12px; flex-shrink: 0; }
.afsw-ads-count-link .fa-external-link-alt { font-size: 10px; color: #bbb; }

/* Contact button */
.afsw-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background-color: #e63946 !important;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 600;
    transition: background-color .2s, transform .1s;
    width: 100%;
    cursor: pointer;
    border: none;
    text-align: center;
}

.afsw-contact-btn:hover  { background-color: #c1121f !important; transform: translateY(-1px); }
.afsw-contact-btn:active { transform: translateY(0); }
.afsw-contact-btn i      { font-size: 14px; }

/* Seller counter badge (1/3) */
.afsw-seller-counter {
    text-align: center;
    font-size: 11px;
    color: #bbb;
    font-weight: 600;
    letter-spacing: .5px;
}

/* ══════════════════════════════════════════════════════════
   CAROUSEL SECTION
   ══════════════════════════════════════════════════════════ */
.afsw-carousel-section {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Header: title + seller nav arrows */
.afsw-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.afsw-carousel-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #1a1a1a;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

@media (max-width: 480px) {
    .afsw-carousel-title { font-size: 14px; }
}

/* Seller nav arrows (← →) — navigate between sellers */
.afsw-seller-nav {
    display: flex;
    gap: 7px;
    flex-shrink: 0;
}

.afsw-seller-prev,
.afsw-seller-next {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background .2s, border-color .2s, color .2s, opacity .2s;
    padding: 0;
    flex-shrink: 0;
}

.afsw-seller-prev:hover,
.afsw-seller-next:hover {
    background: #e63946;
    border-color: #e63946;
    color: #fff;
}

.afsw-seller-prev:disabled,
.afsw-seller-next:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.afsw-seller-prev:disabled:hover,
.afsw-seller-next:disabled:hover {
    background: #fff;
    border-color: #ddd;
    color: #333;
}

/* ══════════════════════════════════════════════════════════
   AD TRACK (horizontal scroll of ad cards)
   ══════════════════════════════════════════════════════════ */
.afsw-track-wrapper {
    overflow: hidden;
    border-radius: 4px;
    cursor: grab;
}

.afsw-track-wrapper:active { cursor: grabbing; }

.afsw-track {
    display: flex;
    gap: 12px;
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}

/* ══════════════════════════════════════════════════════════
   AD CARD
   ══════════════════════════════════════════════════════════ */
.afsw-card {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
    /* Width set by JS */
}

.afsw-card:hover {
    box-shadow: 0 6px 22px rgba(0,0,0,.09);
    transform: translateY(-2px);
}

/* Card image */
.afsw-card-img-wrap {
    position: relative;
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f4f4f4;
    flex-shrink: 0;
}

.afsw-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.afsw-card:hover .afsw-card-img { transform: scale(1.04); }

/* Photo count badge */
.afsw-img-count {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,.52);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    line-height: 1.6;
    pointer-events: none;
}

/* Card body */
.afsw-card-body {
    padding: 10px 12px 13px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

/* Price */
.afsw-price {
    font-size: 14px;
    font-weight: 700;
    color: #e63946;
    line-height: 1.2;
}

.afsw-price * { color: inherit; font-size: inherit; font-weight: inherit; }

/* Title */
.afsw-card-title {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.afsw-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color .15s;
}

.afsw-card-title a:hover { color: #e63946; }

/* Location */
.afsw-location {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    font-size: 11px;
    color: #777;
    line-height: 1.35;
}

.afsw-location i {
    font-size: 10px;
    color: #aaa;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ══════════════════════════════════════════════════════════
   DOTS  (ad pagination — scrolling through ad cards)
   ══════════════════════════════════════════════════════════ */
.afsw-dots {
    display: flex;
    gap: 7px;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 14px; /* reserve space even when hidden */
}

.afsw-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: background .2s, transform .2s;
    border: none;
    padding: 0;
    flex-shrink: 0;
}

.afsw-dot.active {
    background: #e63946;
    transform: scale(1.35);
}

/* No ads message */
.afsw-no-ads {
    color: #aaa;
    font-size: 13px;
    margin: 0;
    padding: 16px 0;
}

/* ══════════════════════════════════════════════════════════
   MOBILE overrides  (< 768px)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .afsw-seller-slide { padding: 16px 14px; }

    .afsw-seller-sidebar {
        /* On mobile the sidebar is above the carousel,
           we show the seller nav INSIDE the carousel header
           so no duplication — sidebar just stacks naturally */
        gap: 12px;
    }

    /* Stack seller-header vertically on very small screens */
    @media (max-width: 380px) {
        .afsw-seller-header { flex-direction: column; align-items: center; text-align: center; }
        .afsw-ads-count-link { justify-content: center; }
        .afsw-seller-counter { text-align: center; }
    }

    .afsw-carousel-title { font-size: 14px; }

    .afsw-seller-prev,
    .afsw-seller-next { width: 30px; height: 30px; font-size: 11px; }

    .afsw-card-body { padding: 9px 10px 11px; }
    .afsw-price     { font-size: 13px; }
}

/* ══════════════════════════════════════════════════════════
   Elementor editor preview placeholder
   ══════════════════════════════════════════════════════════ */
.afsw-wrapper.afsw-preview-placeholder {
    border: 2px dashed #ddd;
    background: #fafafa;
    border-radius: 12px;
}
