

.product-carousel-section {
    padding-block: 0 !important;
    margin-block: 0 !important;
}

.product-carousel-section .section-header {
    margin-top: 0 !important;
}

/* ── Carousel container & scroll track ──────────────────────────── */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: var(--main-width);
    margin: 0 auto;
}

.carousel-grid {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: var(--main-width);
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    cursor: default;
}

.carousel-grid::-webkit-scrollbar {
    display: none !important;
}

.carousel-grid .product-features-slider {
    display: none !important;
}

.carousel-grid .trending-card {
    flex: 0 0 250px;
    scroll-snap-align: start;
}
/* Optional: grab cursor on desktop */
@media (hover: hover) and (pointer: fine) {
    .carousel-grid { cursor: grab; }
    .carousel-grid.dragging { cursor: grabbing; }
}

/* If your prev/next nav arrows don't already flip in RTL */
[dir="rtl"] .carousel-nav-btn svg { transform: scaleX(-1); }
/* ----- Feature slider ----- */
.product-features-slider {
  position: relative;
  height: 18px;
  overflow: hidden;
}

.feature-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(7px);
  pointer-events: none;
}

.feature-item.is-visible {
  animation: feat-in 0.35s ease forwards;
  pointer-events: auto;
}

.feature-item.is-leaving {
  animation: feat-out 0.35s ease forwards;
  pointer-events: none;
}

.feature-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary-color);
  flex-shrink: 0;
}

.feature-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Navigation arrows ──────────────────────────────────────────── */
.section-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.carousel-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    background-color: transparent;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 99;
    transition: background-color 0.3s ease, border-color 0.3s ease,
                color 0.3s ease, transform 0.3s ease;
}

.carousel-nav-btn svg {
    width: 27px;
}

.carousel-nav-btn:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-more-light);
    color: var(--primary-color);
}

.carousel-nav-btn:active {
    transform: scale(1.06);
}

.carousel-nav-btn.disabled,
.carousel-nav-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.carousel-nav-btn.disabled:hover {
    border-color: var(--border-light);
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* ── Card shell ─────────────────────────────────────────────────── */
.trending-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* ── Image zone ─────────────────────────────────────────────────── */
.image-trending {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 10px;
}

/* State badge (logical, flips in RTL) */
.product-state {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    z-index: 20;
    padding: 5px 12px;
    border-radius: 50px;
    background: var(--primary-color, #3a2a1a);
    color: var(--text-white);
    font-size: 12px;
    font-weight: 600;
}

/* ── Always-visible actions (wishlist) ──────────────────────────── */
.image-actions {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--bg-primary);
    color: var(--text-primary, #222);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.action-icon-btn:hover {
    transform: scale(1.08);
}

.action-icon-btn.wishlist-btn.added {
    background-color: #ef4444;
    color: #fff;
}

.action-icon-btn.wishlist-btn.added .icon-heart {
    fill: currentColor;
}

/* Bigger tap targets on touch screens */
@media (pointer: coarse) {
    .action-icon-btn {
        width: 40px;
        height: 40px;
    }
}

/* ── Image slider: native swipe with scroll-snap ────────────────── */
.image-trending-wrap {
    position: absolute;
    inset: 0;
}

.slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    touch-action: pan-x pan-y pinch-zoom;   /* was: pan-x pan-y */
}

.slider-track::-webkit-scrollbar {
    display: none;
}

.slide-img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Arrows: desktop mouse only, shown on hover or keyboard focus */
.slider-arrow {
    position: absolute;
    top: 50%;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: color-mix(in srgb, var(--bg-card) 90%, transparent);
    color: var(--text-primary, #222);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.slider-arrow--prev { inset-inline-start: 10px; }
.slider-arrow--next { inset-inline-end: 10px; }

[dir="rtl"] .slider-arrow svg {
    transform: scaleX(-1);
}

@media (hover: hover) and (pointer: fine) {
    .slider-arrow {
        display: flex;
    }

    .image-trending:hover .slider-arrow,
    .image-trending:focus-within .slider-arrow {
        opacity: 1;
    }
}

/* Dots: always visible on every device */
.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    z-index: 20;
    display: flex;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.28);
    transform: translateX(-50%);
    pointer-events: none;           /* dots indicate; swiping is the control */
}

.slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.slider-dot.active {
    background: #fff;
    transform: scale(1.25);
}

/* ── Quick View: icon button, bottom corner ─────────────────────── */
.btn-quick-view {
    position: absolute;
    bottom: 10px;
    inset-inline-end: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-primary, #222);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: background-color 0.2s ease, color 0.2s ease, scale 0.2s ease;
    animation:
        qv-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both,
        qv-pulse 1.6s ease-out 1.2s 2;
}

.btn-quick-view svg {
    transition: transform 0.25s ease;
}

@media (pointer: coarse) {
    .btn-quick-view {
        width: 40px;
        height: 40px;
    }
}

@keyframes qv-pop {
    from { opacity: 0; transform: translateY(10px) scale(0.4); }
    to   { opacity: 1; transform: none; }
}

@keyframes qv-pulse {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary-color) 45%, transparent),
                    0 2px 6px rgba(0, 0, 0, 0.12);
    }
    100% {
        box-shadow: 0 0 0 14px transparent,
                    0 2px 6px rgba(0, 0, 0, 0.12);
    }
}

/* ── Narrow cards (class added by JS when width < 200px) ────────── */
.trending-card.is-narrow .btn-quick-view {
    width: 30px;
    height: 30px;
    bottom: 8px;
    inset-inline-end: 8px;
}

.trending-card.is-narrow .btn-quick-view svg {
    width: 15px;
    height: 15px;
}

.trending-card.no-slider-dots .slider-dots {
    display: none;
}

/* ── Card body ──────────────────────────────────────────────────── */
.trending-items {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 6px;
    padding: 14px 0 0;
}

.trendingitems-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.product-title-link {
    display: -webkit-box;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    color: var(--text-primary, #222);
    text-decoration: none;
}

.product-short-desc {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text-secondary, #777);
    font-size: 13px;
    line-height: 1.4;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.product-reviews {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.product-stars {
    color: #f5a623;
}

.rev-count {
    color: var(--text-secondary, #999);
}

/* ── Pricing ────────────────────────────────────────────────────── */
.card-bar__pricing {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.current-price {
    color: var(--text-primary, #222);
    font-size: 17px;
    font-weight: 700;
}

.original-price {
    color: var(--text-secondary, #999);
    font-size: 13px;
    text-decoration: line-through;
}

.product-discount-badge {
    padding: 2px 8px;
    border-radius: 6px;
    background: #fdecea;
    color: #d64545;
    font-size: 12px;
    font-weight: 600;
}

/* ── View details button ────────────────────────────────────────── */
.btn-view-details {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-light, #ddd);
    border-radius: 50px;
    color: var(--text-primary, #222);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.btn-view-details:hover {
    background-color: var(--bg-card);
}

/* ── Accessibility ──────────────────────────────────────────────── */
.carousel-nav-btn:focus-visible,
.slider-arrow:focus-visible,
.btn-quick-view:focus-visible,
.btn-view-details:focus-visible,
.action-icon-btn:focus-visible {
    outline: 2px solid var(--primary-color, #3a2a1a);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .carousel-nav-btn, .slide-img, .slider-arrow, .slider-dots {
        transition: none;
        animation: none !important;
    }

    .btn-quick-view {
        animation: none;
    }
}

/* ================================================================
   Responsive
   ================================================================ */

/* Tablets and small screens */
@media screen and (max-width: 768px) {
    .product-carousel-section {
        padding: 0 10px !important;
    }

    .product-carousel-section[data-section="featured"] {
        margin-top: 40px !important;
    }

    .section-header {
        margin-bottom: 25px;
    }

    .section-title {
        font-size: 20px;
    }

    .carousel-grid {
        gap: 12px;
        margin-top: 25px;
    }
}

/* Large phones: one card per screen */
@media (max-width: 550px) {
    .carousel-grid .trending-card {
        flex-basis: 93vw;
        padding: 10px;
    }

    .carousel-grid .image-trending {
        height: auto;
    }

    .carousel-grid .trendingitems-title {
        font-size: 18px !important;
    }

    .carousel-grid .product-state {
        top: 20px;
        inset-inline-start: 20px;
        padding: 6px 14px !important;
        border-radius: 20px;
        font-size: 13px !important;
    }

    .carousel-grid .image-actions {
        top: 20px;
        inset-inline-end: 20px;
    }
}

/* Small phones */
@media screen and (max-width: 480px) {
    .section-header {
        flex-direction: row;
        margin-bottom: 20px;
    }

    .section-title {
        font-size: 18px;
    }

    .section-title::before {
        bottom: -6px;
        height: 3px;
    }

    .carousel-grid {
        gap: 10px;
        margin-top: 20px;
        padding: 0 2px;
    }

    .trending-items {
        padding-top: 8px;
    }

    .trendingitems-title {
        font-size: 14px;
    }

    .current-price {
        font-size: 15px;
    }

    .original-price {
        font-size: 11px;
    }

    .product-stars {
        font-size: 12px;
    }

    .rev-count,
    .reviews {
        margin-left: 3px;
        font-size: 11px;
    }

    .product-discount-badge,
    .discount {
        font-size: 11px;
    }
}

/* ================================================================
   Skeleton loading card
   ================================================================ */

:root {
    --skeleton-base: #ececec;
    --skeleton-highlight: #f7f7f7;
}

.skeleton-card {
    pointer-events: none;
    user-select: none;
}

.skeleton-block,
.skeleton-line,
.skeleton-btn {
    position: relative;
    overflow: hidden;
    background-color: var(--skeleton-base);
    border-radius: 6px;
}

.skeleton-block::after,
.skeleton-line::after,
.skeleton-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--skeleton-highlight) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-block {
    aspect-ratio: 1 / 1;
    border-radius: 10px;
}

.skeleton-line {
    height: 12px;
    border-radius: 4px;
}

.skeleton-line--title {
    height: 16px;
    width: 85%;
}

.skeleton-line--desc {
    height: 11px;
    width: 100%;
}

.skeleton-line--price {
    height: 18px;
    width: 40%;
}

.skeleton-line--price-old {
    height: 12px;
    width: 22%;
}

.skeleton-line--short {
    width: 60%;
}

.skeleton-btn {
    height: 40px;
    width: 100%;
    border-radius: 50px;
}

@keyframes skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-block::after,
    .skeleton-line::after,
    .skeleton-btn::after {
        animation: none;
        display: none;
    }
}

:root[data-theme="dark"] {
    --skeleton-base: #2a2a2a;
    --skeleton-highlight: #3a3a3a;
}
