/**
 * Pricetracker – Carousel Styles
 * Matches the WB24 Tool Kit product-carousel card design.
 */

.pt-cat-carousel {
    position: relative;
    padding: 0 2.5rem;
}

.pt-cat-carousel__track {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.5rem 0 1rem;
}

.pt-cat-carousel__track::-webkit-scrollbar {
    display: none;
}

.pt-cat-carousel__item {
    flex: 0 0 190px;
    scroll-snap-align: start;
    display: flex;
}

/* ── Arrow buttons ──────────────────────────────────────────────────────── */
button.pt-cat-carousel__arrow {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 4 !important;
    color: #374151 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: opacity 0.2s ease, box-shadow 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    line-height: 1 !important;
    outline: none !important;
    font-size: 0 !important;
}

button.pt-cat-carousel__arrow:hover:not(:disabled):not(.is-disabled) {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    color: #1f2937 !important;
    border-color: #d1d5db !important;
}

button.pt-cat-carousel__arrow.is-disabled,
button.pt-cat-carousel__arrow:disabled {
    opacity: 0.35 !important;
    pointer-events: none !important;
}

button.pt-cat-carousel__arrow svg {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}

button.pt-cat-carousel__arrow--prev {
    left: -4px !important;
}

button.pt-cat-carousel__arrow--next {
    right: -4px !important;
}

/* ── Card appearance (matching wb24-product-carousel__card) ─────────────── */
.pt-cat-carousel .pt-product-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    box-shadow: none !important;
    transition: border-color 0.15s !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #fff !important;
}
.pt-cat-carousel .pt-product-card:hover {
    box-shadow: none !important;
    transform: none !important;
    border-color: #d1d5db !important;
}

/* ── Card link (fill card) ──────────────────────────────────────────────── */
.pt-cat-carousel .pt-product-card__link {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    text-decoration: none !important;
    color: inherit !important;
}

/* ── Image area ─────────────────────────────────────────────────────────── */
.pt-cat-carousel .pt-product-card__image {
    position: relative !important;
    width: 100% !important;
    box-sizing: border-box !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    background: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    padding: 16px !important;
    border-radius: 0 !important;
}

.pt-cat-carousel .pt-product-card__image::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    background-color: rgb(139 140 142 / 5%) !important;
    pointer-events: none !important;
    z-index: 1 !important;
}

.pt-cat-carousel .pt-product-card__image img {
    width: 92% !important;
    height: 92% !important;
    max-width: 92% !important;
    max-height: 92% !important;
    object-fit: contain !important;
    object-position: center !important;
    position: relative !important;
    z-index: 0 !important;
    transition: transform 0.25s ease !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pt-cat-carousel .pt-product-card:hover .pt-product-card__image img {
    transform: scale(1.08) !important;
}

/* ── Overlay action buttons (fav + basket) ──────────────────────────────── */
.pt-cat-carousel .pt-product-card__overlay-actions {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 6px !important;
    z-index: 3 !important;
}

/* Override vmb-favorite-shared.css which sets position:absolute on .pt-favorite-btn.
   Specificity here (0-4-0) beats the shared rule (0-3-0). */
.pt-cat-carousel .pt-product-card__image .pt-favorite-btn[data-action="toggle-favorite"],
.pt-cat-carousel .pt-product-card__overlay-actions > .pt-product-card__favorite-btn,
.pt-cat-carousel .pt-product-card__overlay-actions > .pt-product-card__basket-btn {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    float: none !important;
    z-index: auto !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    max-width: 34px !important;
    max-height: 34px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    border: none !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--pt-color-gray-500, #6b7280) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateZ(0) scale(1) !important;
    transform-origin: center !important;
    transition: background 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.pt-cat-carousel .pt-product-card__image .pt-favorite-btn[data-action="toggle-favorite"] svg {
    width: 18px !important;
    height: 18px !important;
}

.pt-cat-carousel .pt-product-card__image .pt-favorite-btn[data-action="toggle-favorite"].pt-favorite-btn--active {
    color: var(--pt-fav-btn-active, #ef4444) !important;
}

.pt-cat-carousel .pt-product-card__image .pt-favorite-btn[data-action="toggle-favorite"].pt-favorite-btn--active svg path {
    fill: currentColor !important;
    stroke: currentColor !important;
}

.pt-cat-carousel .pt-product-card__favorite-btn:hover {
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    color: #f43f5e !important;
}

.pt-cat-carousel .pt-product-card__basket-btn:hover {
    color: #047857 !important;
}

/* "In basket" inside carousels: icon-color only, no fill, no green ring (2026-05). */
.pt-cat-carousel .pt-product-card__basket-btn.pt-basket-add-btn--active {
    color: #047857 !important;
}

/* ── Content area (matching wb24 card-body) ──────────────────────────────── */
.pt-cat-carousel .pt-product-card__content {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem !important;
    flex: 1;
}

.pt-cat-carousel .pt-product-card__brand {
    display: none !important;
}

.pt-cat-carousel .pt-product-card__title {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    color: #1f2937 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* ── Price ───────────────────────────────────────────────────────────────── */
.pt-cat-carousel .pt-product-card__price {
    margin-top: auto !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 0.375rem !important;
}

.pt-cat-carousel .pt-product-card__price-label {
    display: inline !important;
    font-size: 0.75rem !important;
    color: #6b7280 !important;
    font-weight: 400 !important;
}

.pt-cat-carousel .pt-product-card__price-value {
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #111827 !important;
}

/* ── Meta row (stores + rating) ──────────────────────────────────────────── */
.pt-cat-carousel .pt-product-card__meta-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-top: 0 !important;
}

.pt-cat-carousel .pt-product-card__stores {
    font-size: 0.75rem !important;
    color: #6b7280 !important;
    line-height: 1.3 !important;
}

.pt-cat-carousel .pt-product-card__rating {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    margin-left: auto !important;
    line-height: 1 !important;
}

.pt-cat-carousel .pt-product-card__stars {
    --pt-rating: 0;
    display: inline-block !important;
    width: 13px !important;
    height: 13px !important;
    vertical-align: middle !important;
    background: linear-gradient(
        90deg,
        #f59e0b calc(var(--pt-rating) / 5 * 100%),
        #e5e7eb calc(var(--pt-rating) / 5 * 100%)
    ) !important;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z'/%3E%3C/svg%3E") !important;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z'/%3E%3C/svg%3E") !important;
    -webkit-mask-size: contain !important;
    mask-size: contain !important;
    -webkit-mask-repeat: no-repeat !important;
    mask-repeat: no-repeat !important;
    flex-shrink: 0 !important;
    margin-bottom: -3px !important;
}

.pt-cat-carousel .pt-product-card__rating-count {
    font-size: 0.75rem !important;
    font-weight: 400 !important;
    color: #6b7280 !important;
}

/* Basket button visibility handled by > button rule above */

/* Suppress CSS ::after tooltip on card basket buttons (use JS body tooltip instead) */
.pt-product-card__basket-btn[data-tooltip]::after {
    display: none !important;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .pt-cat-carousel__item {
        flex: 0 0 170px;
    }
}

@media (max-width: 768px) {
    .pt-cat-carousel {
        padding: 0;
    }

    .pt-cat-carousel__track {
        gap: 0.25rem;
        padding: 0.25rem 0.75rem 0.75rem;
    }

    .pt-cat-carousel__item {
        flex: 0 0 155px;
    }

    .pt-cat-carousel .pt-product-card__content {
        padding: 0.625rem !important;
    }

    button.pt-cat-carousel__arrow {
        display: none !important;
    }
}
