/* ═══════════════════════════════════════════════════════════════
   Shopbar Pro Addons — Product Carousel Widget
   ═══════════════════════════════════════════════════════════════ */

/* ==========================================
   SECTION HEADER
   ========================================== */

.sbpa-pc-section-header {
    text-align: center;
    margin-bottom: 34px;
}

.sbpa-pc-section-tag {
    display: inline-block;
    font-family: var(--font-mono, 'DM Mono', monospace);
    font-size: 12.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #B8977E;
    margin-bottom: 8px;
}

.sbpa-pc-section-title {
    font-family: var(--font-display, 'Fraunces', serif);
    font-size: 30px;
    font-weight: 500;
    color: #1C1C1C;
    margin: 0 0 12px 0;
    line-height: 1.2em;
    letter-spacing: -0.015em;
}

.sbpa-pc-section-subtitle {
    font-family: var(--font-sans, 'Hanken Grotesk', sans-serif);
    font-size: 15px;
    font-weight: 400;
    color: #6B6560;
    margin: 0;
    line-height: 1.6em;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================
   SWIPER BASE STRUCTURAL STYLES
   (Required for proper carousel layout)
   ========================================== */

.sbpa-pc-carousel .swiper {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: hidden;
    list-style: none;
    padding: 0;
    z-index: 1;
    display: block;
}

.sbpa-pc-carousel .swiper-vertical > .swiper-wrapper {
    flex-direction: column;
}

.sbpa-pc-carousel .swiper-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: flex;
    transition-property: transform;
    box-sizing: content-box;
}

.sbpa-pc-carousel .swiper-android .swiper-slide,
.sbpa-pc-carousel .swiper-wrapper {
    transform: translate3d(0, 0, 0);
}

.sbpa-pc-carousel .swiper-horizontal {
    touch-action: pan-y;
}

.sbpa-pc-carousel .swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
    transition-property: transform;
    display: block;
}

.sbpa-pc-carousel .swiper-slide-invisible-blank {
    visibility: hidden;
}

/* Auto-height */
.sbpa-pc-carousel .swiper-autoheight,
.sbpa-pc-carousel .swiper-autoheight .swiper-slide {
    height: auto;
}

.sbpa-pc-carousel .swiper-autoheight .swiper-wrapper {
    align-items: flex-start;
    transition-property: transform, height;
}

/* Backface hidden (3D transforms fix) */
.sbpa-pc-carousel .swiper-backface-hidden .swiper-slide {
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ─── Notice ─── */
.sbpa-pc-notice {
    text-align: center;
    padding: 40px 20px;
    color: #6B6560;
    font-size: 14px;
    background: #FBF9F6;
    border-radius: 10px;
    border: 1px dashed #E8E4DF;
}

/* ─── Carousel Container ─── */
.sbpa-pc-carousel {
    position: relative;
    width: 100%;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}

@media (min-width: 1024px) {
    .sbpa-pc-carousel {
        padding-left: 32px;
        padding-right: 32px;
    }
}

/* ==========================================
   PRODUCT CARD — carousel-context overrides
   (Visuals come from the theme's shop.css .product-card rules.)
   ========================================== */

/* Slides size to their content so cards keep equal height per row. */
.sbpa-pc-carousel .swiper-slide {
    height: auto;
}

.sbpa-pc-carousel .product-card {
    height: 100%;
    width: 100%;
}

/* Neutralise the theme's entrance fade/translate so cards are always
   visible inside the swiper — the keyframe can leave opacity:0 when a
   slide is moved or cloned. Hover lift is re-declared below. */
.sbpa-pc-carousel .product-card {
    opacity: 1;
    transform: translateY(0);
    animation: none;
}

.sbpa-pc-carousel .product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(28, 28, 28, 0.08);
}

/* Allow Elementor Typography controls to override theme price sizes.
   load-order neutral: uses 3-class specificity like the theme rules
   but scoped under .sbpa-pc-carousel so it only affects the widget. */
.sbpa-pc-carousel .product-card-price .price ins .woocommerce-Price-amount,
.sbpa-pc-carousel .product-card-price .price > .woocommerce-Price-amount,
.sbpa-pc-carousel .product-card-price .price del .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    font-style: inherit;
}

/* Make images fill the square media stage edge-to-edge. */
.sbpa-pc-carousel .product-card-img-link img,
.sbpa-pc-carousel .product-image-wrapper img,
.sbpa-pc-carousel .secondary-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─── Color swatches (variable products) ─── */
.product-card-info .sbpa-color-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.product-card-info .sbpa-color-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #E8E4DF;
    display: inline-block;
}

.product-card-info .sbpa-color-badge--light {
    border-color: rgba(28, 28, 28, 0.35);
}

/* ─── Action button states (look from theme .product-card-actions button) ─── */
.sbpa-pc-carousel .sbpa-pc-add-to-cart-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.sbpa-pc-carousel .sbpa-pc-select-options-btn {
    text-decoration: none;
    color: inherit;
}

/* Variable products render the add-to-cart slot as an <a>
   (.sbpa-pc-select-options-btn) instead of a <button>. The theme's
   footer centering/sizing only hits real buttons + the
   wishlist/compare/quick-view classes, so the anchor ends up unsized
   and its icon rides higher than the row. Match it to the buttons. */
.sbpa-pc-carousel .product-card-actions .sbpa-pc-select-options-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

/* The anchor isn't a <button>, so it misses the theme's
   .product-card-actions button:hover inversion. Replicate it. */
.sbpa-pc-carousel .product-card-actions .sbpa-pc-select-options-btn:hover {
    background: var(--brand-dark);
    color: #fff;
    box-shadow: 0 12px 40px rgba(28, 28, 28, 0.08);
}

/* Keep every action icon centered on the same baseline
   (covers all add-to-cart variants + the icon buttons). */
.sbpa-pc-carousel .product-card-actions > a,
.sbpa-pc-carousel .product-card-actions > button {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Footer: keep action buttons always below the price ───
   The theme lays the footer out as a row (price left, actions right),
   which lets the actions ride up beside the price in narrow carousel
   slides. Force a column stack so the action row always sits beneath
   the price, matching the shop archive. */
.sbpa-pc-carousel .product-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.sbpa-pc-carousel .product-card-footer .product-card-price {
    flex: 0 0 auto;
    width: 100%;
}

.sbpa-pc-carousel .product-card-footer .product-card-actions {
    align-items: center;
    width: 100%;
    justify-content: flex-start;
}

/* ==========================================
   CAROUSEL NAVIGATION ARROWS
   ========================================== */

.sbpa-pc-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(28, 28, 28, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1C1C1C;
    padding: 0;
}

.sbpa-pc-carousel-arrow svg {
    width: 18px;
    height: 18px;
}

.sbpa-pc-carousel-arrow:hover {
    background: #1C1C1C;
    color: #FFFFFF;
    box-shadow: 0 8px 24px rgba(28, 28, 28, 0.15);
    transform: translateY(-50%) scale(1.05);
}

.sbpa-pc-carousel-arrow--prev {
    left: 4px;
}

.sbpa-pc-carousel-arrow--next {
    right: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .sbpa-pc-section-title {
        font-size: 26px;
    }
    .sbpa-pc-carousel-arrow--prev {
        left: 2px;
    }
    .sbpa-pc-carousel-arrow--next {
        right: 2px;
    }
    .sbpa-pc-carousel-arrow {
        width: 36px;
        height: 36px;
    }
    .sbpa-pc-carousel-arrow svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 768px) {
    .sbpa-pc-section-header {
        margin-bottom: 24px;
    }
    .sbpa-pc-section-title {
        font-size: 23px;
    }
    /* Keep action buttons reachable on touch devices. */
    .sbpa-pc-carousel .product-card-actions {
        opacity: 1;
        transform: translateY(0);
    }
    .sbpa-pc-carousel-arrow--prev {
        left: 4px;
    }
    .sbpa-pc-carousel-arrow--next {
        right: 4px;
    }
    .sbpa-pc-carousel-arrow {
        width: 34px;
        height: 34px;
    }
    .sbpa-pc-carousel-arrow svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 480px) {
    .sbpa-pc-section-title {
        font-size: 20px;
    }
}
