/* =========================================================
   Mobile Product Carousel — carousel.css
   Loaded only on WooCommerce single product pages.
   ========================================================= */

/* ---------------------------------------------------------
   Wrapper
   --------------------------------------------------------- */
.prpdc {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999999;
    min-height: auto;
    transition: height 0.3s ease, transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
    animation: prpdc-slideUp 0.3s ease-out;
}

.prpdc.prpdc-scrolled-down {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* ---------------------------------------------------------
   Container (clips overflow)
   --------------------------------------------------------- */
.prpdc-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.prpdc-track-wrapper {
    flex: 1;
    overflow: hidden;
    height: 100%;
}

.prpdc-fixed-box {
    margin-left: 10px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.prpdc-fixed-box+.prpdc-track-wrapper .prpdc-track {
    padding-left: 10px;
}

/* ---------------------------------------------------------
   Track (the scrolling row of items)
   --------------------------------------------------------- */
.prpdc-track {
    box-shadow: none;
    background: transparent;
    padding: 0;
    display: flex;
    gap: 10px;
    padding: 0 5px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: transform 0.3s ease;
    height: 100%;
    align-items: center;
}

.prpdc-track:active {
    cursor: grabbing;
}

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

/* ---------------------------------------------------------
   Individual product item bounds
   Default size = 70px (matches PRPDC_NORMAL_SIZE in PHP)
   --------------------------------------------------------- */
.prpdc-item-bounds {
    flex: 0 0 70px;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease,
        box-shadow 0.2s ease,
        width 0.2s ease,
        height 0.2s ease,
        flex-basis 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prpdc-item:hover {}

.prpdc-item:active {
    transform: translateY(0);
}

/* ---------------------------------------------------------
   Link inside each item
   --------------------------------------------------------- */
.prpdc-item-bounds a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    border-radius: 8px;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
}

/* ---------------------------------------------------------
   Product image
   --------------------------------------------------------- */
.prpdc-item-bounds img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: opacity 0.2s ease;
    display: block;
    margin: 0 auto;
}

.prpdc-item-bounds img:hover {
    opacity: 0.9;
}

/* ---------------------------------------------------------
   Slide-up entrance animation
   --------------------------------------------------------- */
@keyframes prpdc-slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ---------------------------------------------------------
   Dark mode
   --------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
    .prpdc {
        background: rgba(30, 30, 30, 0.95);
        border-top-color: #404040;
    }
}

/* ---------------------------------------------------------
   Desktop Mode
   --------------------------------------------------------- */
@media (min-width: 769px) {
    .prpdc.prpdc-mobile-mode {
        display: none !important;
    }
}

.prpdc.prpdc-desktop-mode {
    border-radius: 8px;
    z-index: 10000;
    transition: transform 0.4s ease, opacity 0.4s ease;
    overflow: hidden;
}

/* Base Desktop Track Properties */

.prpdc.prpdc-desktop-mode .prpdc-track {
    align-items: center;
}

.prpdc.prpdc-desktop-mode .prpdc-track::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
}

/* Bottom Horizontal */
.prpdc.prpdc-desktop-mode.prpdc-pos-bottom {
    bottom: var(--prpdc-desktop-margin);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: var(--prpdc-desktop-length);
}

.prpdc.prpdc-desktop-mode.prpdc-pos-bottom.prpdc-hover-extend-100:hover {
    width: 100vw !important;
    max-width: 100vw !important;
}

.prpdc.prpdc-desktop-mode.prpdc-pos-bottom.prpdc-scrolled-down {
    transform: translate(-50%, calc(100% + var(--prpdc-desktop-margin) + 20px));
}

/* Left & Right Vertical Container Stack */
.prpdc.prpdc-desktop-mode.prpdc-pos-left .prpdc-container,
.prpdc.prpdc-desktop-mode.prpdc-pos-right .prpdc-container {
    flex-direction: column;
    padding: 5px 0;
}

.prpdc.prpdc-desktop-mode.prpdc-pos-left .prpdc-fixed-box,
.prpdc.prpdc-desktop-mode.prpdc-pos-right .prpdc-fixed-box {
    margin-left: 0;
    margin-bottom: 10px;
}

.prpdc.prpdc-desktop-mode.prpdc-pos-left .prpdc-fixed-box+.prpdc-track-wrapper .prpdc-track,
.prpdc.prpdc-desktop-mode.prpdc-pos-right .prpdc-fixed-box+.prpdc-track-wrapper .prpdc-track {
    padding-left: 0;
}

.prpdc.prpdc-desktop-mode.prpdc-pos-left .prpdc-track-wrapper,
.prpdc.prpdc-desktop-mode.prpdc-pos-right .prpdc-track-wrapper {
    width: 100%;
}

/* Left Vertical */
.prpdc.prpdc-desktop-mode.prpdc-pos-left {
    left: var(--prpdc-desktop-margin);
    top: 50%;
    transform: translateY(-50%);
    height: max-content;
    max-height: var(--prpdc-desktop-length);
    bottom: auto;
    border-top: none;
}

.prpdc.prpdc-desktop-mode.prpdc-pos-left.prpdc-hover-extend-100:hover {
    height: 100vh !important;
    max-height: 100vh !important;
}

.prpdc.prpdc-desktop-mode.prpdc-pos-left .prpdc-track {
    flex-direction: column;
    width: 100%;
    height: min-content;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

.prpdc.prpdc-desktop-mode.prpdc-pos-left.prpdc-scrolled-down {
    transform: translate(calc(-100% - var(--prpdc-desktop-margin) - 20px), -50%);
}

/* Right Vertical */
.prpdc.prpdc-desktop-mode.prpdc-pos-right {
    right: var(--prpdc-desktop-margin);
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    height: max-content;
    max-height: var(--prpdc-desktop-length);
    bottom: auto;
    border-top: none;
}

.prpdc.prpdc-desktop-mode.prpdc-pos-right.prpdc-hover-extend-100:hover {
    height: 100vh !important;
    max-height: 100vh !important;
}

.prpdc.prpdc-desktop-mode.prpdc-pos-right .prpdc-track {
    flex-direction: column;
    width: 100%;
    height: min-content;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

.prpdc.prpdc-desktop-mode.prpdc-pos-right.prpdc-scrolled-down {
    transform: translate(calc(100% + var(--prpdc-desktop-margin) + 20px), -50%);
}

/* ---------------------------------------------------------
   Small phones (320px and below)
   --------------------------------------------------------- */
@media (max-width: 320px) {
    .prpdc-track {
        padding: 0 10px;
        gap: 8px;
    }

    .prpdc-item-bounds {
        flex: 0 0 70px;
        width: 70px;
        height: 70px;
    }
}

/* ---------------------------------------------------------
   Shadow Modifier
   --------------------------------------------------------- */
.prpdc-has-shadow .prpdc-item-bounds,
.prpdc-has-shadow .prpdc-price-badge {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.prpdc-cta-has-shadow .prpdc-cta-button {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* ---------------------------------------------------------
   Price Badge Styling
   --------------------------------------------------------- */
.prpdc-price-badge {
    box-sizing: border-box;
    background-color: var(--prpdc-price-bg, #ffffff);
    color: var(--prpdc-price-text, #000000);
    font-family: var(--prpdc-price-font, inherit);
    border-radius: 4px;
    padding: 3px 6px;
    font-size: var(--prpdc-price-size, 11px);
    line-height: 1.2;
    font-weight: 600;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    margin-top: 4px;
    width: 100%;
}

@media (max-width: 768px) {
    .prpdc-price-badge {
        font-size: var(--prpdc-price-size-mob, 11px);
    }
}

/* Reset Woocommerce spans inside badge */
.prpdc-price-badge .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
}

/* ---------------------------------------------------------
   CTA Button
   --------------------------------------------------------- */
.prpdc-cta-button {
    display: block;
    box-sizing: border-box;
    background-color: var(--prpdc-cta-bg, #2271b1);
    color: var(--prpdc-cta-text, #ffffff);
    font-family: var(--prpdc-cta-font, inherit);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: var(--prpdc-cta-size, 11px);
    line-height: 1.2;
    font-weight: 700;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    margin-top: 4px;
    width: 100%;
    text-decoration: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}

.prpdc-cta-button:hover {
    opacity: 0.85;
    transform: translateY(-1px);
    text-decoration: none;
}

@media (max-width: 768px) {
    .prpdc-cta-button {
        font-size: var(--prpdc-cta-size-mob, 11px);
    }
}