/* ===================================================================
   Product Reels for WooCommerce – Frontend Styles
   =================================================================== */

:root {
    --prw-primary: #1a1a1a;
    --prw-primary-hover: #333;
    --prw-radius: 12px;
    --prw-footer-bg: rgba(0, 0, 0, 0.72);
    --prw-text-white: #ffffff;
    --prw-text-muted: rgba(255, 255, 255, 0.75);
    --prw-accent: #ffffff;
    --prw-modal-bg: #ffffff;
    --prw-shadow: 0 4px 24px rgba(0, 0, 0, 0.14);
    --prw-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ------------------------------------------------------------------
   Wrapper & Grid
   ------------------------------------------------------------------ */
.prw-reels-wrapper {
    display: grid;
    grid-template-columns: repeat(var(--prw-columns, 5), 1fr);
    gap: var(--prw-gap, 12px);
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .prw-reels-wrapper {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .prw-reels-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .prw-reels-wrapper {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------
   Reel Card
   ------------------------------------------------------------------ */
.prw-reel-card {
    position: relative;
    border-radius: var(--prw-radius);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}


/* ------------------------------------------------------------------
   Video Area
   ------------------------------------------------------------------ */
.prw-video-area {
    position: relative;
    width: 100%;
    /* padding-bottom set inline from aspect ratio */
    background: #000;
    flex-shrink: 0;
}

.prw-video-area::before {
    background: rgba(0, 0, 0, 0.15);
    position: absolute;
    content: '';
    width: 100%;
    height: 100%;
    z-index: 1;
}

.prw-video-element,
.prw-embed-placeholder,
.prw-thumbnail-only,
.prw-modal-iframe,
.prw-embed-placeholder iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.prw-embed-placeholder {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
}

.prw-thumbnail-only {
    background-size: cover;
    background-position: center;
    background-color: #222;
}

.prw-no-media {
    background-color: #2a2a2a;
}

/* Play button overlay */
.prw-play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    transition: transform var(--prw-transition), background var(--prw-transition);
    z-index: 2;
}

.prw-play-btn:hover {
    transform: scale(1.12);
    background: #fff;
}

.prw-play-btn svg {
    width: 28px;
    height: 28px;
}

/* Overlay text (like "AND THE QUALITY MAKES IT SUCH A GREAT VALUE") */
.prw-overlay-text {
    position: absolute;
    bottom: 90px;
    left: 0;
    right: 0;
    padding: 0 12px;
    font-family: 'Arial Black', Arial, sans-serif;
    font-weight: 900;
    font-size: clamp(10px, 2vw, 14px);
    text-transform: uppercase;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.6);
    line-height: 1.35;
    letter-spacing: 0.03em;
    pointer-events: none;
    z-index: 3;
}

/* Mute toggle */
.prw-mute-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 5;
    transition: background var(--prw-transition);
    padding: 0;
}

.prw-mute-toggle:hover {
    background: rgba(0, 0, 0, 0.75);
}

.prw-mute-toggle svg {
    width: 18px;
    height: 18px;
}

.prw-mute-toggle .prw-icon-unmuted {
    display: none;
}

.prw-mute-toggle.is-muted .prw-icon-muted {
    display: none;
}

.prw-mute-toggle.is-muted .prw-icon-unmuted {
    display: block;
}

/* Hide on cards, show in modal */
.prw-reel-card .prw-mute-toggle {
    display: none;
}

.prw-modal .prw-mute-toggle {
    display: flex;
}

/* ------------------------------------------------------------------
   Card Footer
   ------------------------------------------------------------------ */
.prw-card-footer {
    background: var(--prw-footer-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.prw-card-product-info {
    display: flex;
    align-items: center;
    gap: 10px;
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 10px;
    z-index: 3;
}

.prw-card-product-img {
    width: 44px;
    height: 44px !important;
    border-radius: 6px !important;
    object-fit: cover;
    flex-shrink: 0;
    background: #333;
}

.prw-card-product-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.prw-card-product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--prw-text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

.prw-card-product-price {
    font-size: 14px;
    color: var(--prw-text-white);
    line-height: 1.3;
}

.prw-card-product-price .woocommerce-Price-amount {
    color: var(--prw-text-white);
}

.prw-card-product-price ins {
    text-decoration: none;
}

/* Card actions row */
.prw-card-actions {
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: #000;
}

.prw-add-to-cart {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #ffffff;
    text-align: center;
    text-transform: unset;
    text-decoration: none;
    padding: 10px 10px;
    background-color: #000000;
    border: 0px;
    transition: all 0.25s ease 0s;
    position: relative;
    z-index: 2;
    cursor: pointer;
    font-size: 16px;
    margin: 0;
}


.prw-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.prw-add-to-cart.loading {
    opacity: 0.7;
    pointer-events: none;
}

.prw-add-to-cart.success {
    color: #6edd7f;
}

.prw-open-modal-arrow {
    background: #000;
    border: none;
    border-left: 1px solid #ffffff;
    color: var(--prw-text-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--prw-transition);
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    flex: 0 0 48px;
}

.prw-open-modal-arrow:hover {
    border-left: 1px solid #ffffff;
}

.prw-open-modal-arrow svg {
    width: 24px;
    height: 24px;
}

/* ------------------------------------------------------------------
   MODAL
   ------------------------------------------------------------------ */
.prw-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.prw-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

.prw-modal-content {
    position: relative;
    z-index: 1;
    display: flex;
    background: var(--prw-modal-bg);
    border-radius: 20px;
    overflow: hidden;
    max-width: 860px;
    width: 100%;
    max-height: 90vh;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    animation: prw-modal-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes prw-modal-in {
    from {
        opacity: 0;
        transform: scale(0.88) translateY(20px);
    }

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

/* Close button */
.prw-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background var(--prw-transition);
    padding: 0;
}

.prw-modal-close:hover {
    background: rgba(0, 0, 0, 0.15);
}

.prw-modal-close svg {
    width: 22px;
    height: 22px;
}

/* ---- Modal columns ---- */
.prw-modal-video-col {
    width: 42%;
    flex-shrink: 0;
    background: #000;
    display: flex;
    align-items: stretch;
}

.prw-modal-video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 177.78%;
    background: #111;
}

.prw-modal-video-wrap .prw-modal-video-element,
.prw-modal-video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
}

.prw-modal-video-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.prw-modal-product-col {
    flex: 1;
    overflow-y: auto;
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* ---- Modal product content (injected by JS) ---- */
.prw-modal-product-img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.prw-modal-product-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.prw-modal-product-header-text {
    flex: 1;
    min-width: 0;
}

.prw-modal-product-name {
    font-size: 15px;
    font-weight: 700;
    color: #111;
    line-height: 1.35;
    margin: 0 0 5px;
}

.prw-modal-product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--prw-primary);
}

.prw-modal-product-price .woocommerce-Price-amount {
    color: var(--prw-primary);
}

.prw-modal-product-price ins {
    text-decoration: none;
}

.prw-modal-product-price del {
    opacity: 0.45;
    font-weight: 400;
    font-size: 13px;
    margin-right: 4px;
}

/* Variations */
.prw-modal-variations {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.prw-variation-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prw-variation-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
}

.prw-variation-select {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #111;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%23555'/%3E%3C/svg%3E") no-repeat right 10px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color var(--prw-transition);
    box-sizing: border-box;
}

.prw-variation-select:focus {
    outline: none;
    border-color: var(--prw-primary);
}

/* Modal Add to Cart button */
.prw-modal-atc-wrap {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prw-modal-add-to-cart {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--prw-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-align: center;
    transition: background var(--prw-transition), transform var(--prw-transition);
}

.prw-modal-add-to-cart:hover {
    background: var(--prw-primary-hover);
    transform: translateY(-1px);
}

.prw-modal-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.prw-modal-add-to-cart.loading {
    opacity: 0.75;
    pointer-events: none;
}

.prw-modal-add-to-cart.success {
    background: #28a745;
}

.prw-modal-view-product {
    display: block;
    text-align: center;
    font-size: 13px;
    color: #888;
    text-decoration: none;
    transition: color var(--prw-transition);
}

.prw-modal-view-product:hover {
    color: var(--prw-primary);
    text-decoration: underline;
}

/* Toast notification */
.prw-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #222;
    color: #fff;
    padding: 12px 22px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    z-index: 9999999;
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
    white-space: nowrap;
    pointer-events: none;
}

.prw-toast.prw-toast-success {
    background: #1a7f3c;
}

.prw-toast.prw-toast-error {
    background: #c0392b;
}

.prw-toast.prw-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Spinner */
.prw-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--prw-primary);
    border-radius: 50%;
    animation: prw-spin 0.7s linear infinite;
    margin: 40px auto;
}

@keyframes prw-spin {
    to {
        transform: rotate(360deg);
    }
}

.prw-modal-product-loading {
    text-align: center;
}

/* Stock badge */
.prw-stock-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}

.prw-in-stock {
    background: #e6f4ea;
    color: #1a7f3c;
}

.prw-out-stock {
    background: #fce8e6;
    color: #c0392b;
}

/* ------------------------------------------------------------------
   Responsive: modal stacks on mobile
   ------------------------------------------------------------------ */
@media (max-width: 640px) {
    .prw-modal-content {
        flex-direction: column;
        max-height: 95vh;
        border-radius: 16px;
    }

    .prw-modal-video-col {
        width: 100%;
    }

    .prw-modal-video-wrap {
        padding-bottom: 100%;
    }

    .prw-modal-product-col {
        max-height: 55vh;
        overflow-y: auto;
    }

}

/* ------------------------------------------------------------------
   Variation Slide-in (Sheet) - Card Relative
   ------------------------------------------------------------------ */
.prw-variation-sheet {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    border-radius: var(--prw-radius);
    overflow: hidden;
}

.prw-variation-sheet-content {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 90%;
    overflow-y: auto;
}

.prw-variation-sheet.is-open {
    display: flex;
}

.prw-variation-sheet.is-open .prw-variation-sheet-content {
    transform: translateY(0);
}

.prw-variation-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.prw-variation-sheet-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
}

.prw-variation-sheet-close {
    background: #f5f5f5;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    padding: 0;
}

.prw-variation-sheet .prw-modal-variations {
    padding: 0;
    gap: 10px;
}

.prw-variation-sheet .prw-variation-group {
    gap: 4px;
}

.prw-variation-sheet .prw-variation-select {
    padding: 8px 30px 8px 10px;
    font-size: 13px;
}

.prw-variation-sheet .prw-modal-atc-wrap {
    margin-top: 0;
}

.prw-variation-sheet .prw-modal-add-to-cart {
    padding: 10px;
    font-size: 14px;
}


/* ------------------------------------------------------------------
   Carousel (Swiper) Styles
   ------------------------------------------------------------------ */
.prw-carousel.swiper {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    /* Hide slides outside the view */
    display: block !important;
    /* Ensure it's not a grid */
    padding-bottom: 40px;
    /* Space for pagination */
}

/* Position pagination */
.prw-carousel .swiper-pagination {
    bottom: 5px !important;
}

/* Ensure slides fill height */
.prw-carousel .swiper-wrapper {
    display: flex !important;
    /* Override grid */
}

.prw-carousel .swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
}

/* Navigation Arrows - Premium Look */
.prw-arrow {
    width: 44px;
    height: 44px;
    background: #fff;
    color: #1a1a1a;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
    z-index: 10;
}

.prw-arrow:after {
    font-size: 18px !important;
    font-weight: 700;
    font-family: swiper-icons;
    /* Ensure Swiper icons are used */
    line-height: 1;
    /* Match Swiper defaults */
}

.prw-arrow-prev:after {
    content: 'prev';
}

.prw-arrow-next:after {
    content: 'next';
}

.prw-arrow:hover {
    background: #1a1a1a;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.prw-arrow-prev {
    left: 10px;
}

.prw-arrow-next {
    right: 10px;
}

/* Arrow Types */
.prw-arrow-type-slim:after {
    font-size: 14px !important;
}

.prw-arrow-type-circle {
    border: 1px solid #e0e0e0;
    background: rgba(255, 255, 255, 0.9);
}

/* Pagination Bullets */
.prw-carousel .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #ccc;
    opacity: 1;
    transition: all 0.3s ease;
}

.prw-carousel .swiper-pagination-bullet-active {
    background: var(--prw-primary);
    width: 24px;
    border-radius: 5px;
}

/* Scrollbar */
.prw-carousel .swiper-scrollbar {
    background: rgba(0, 0, 0, 0.05);
    height: 4px;
}

.prw-carousel .swiper-scrollbar-drag {
    background: var(--prw-primary);
}

/* Fade Effect Fix */
.swiper-fade .swiper-slide {
    pointer-events: none;
    transition-property: opacity;
}

.swiper-fade .swiper-slide-active {
    pointer-events: auto;
}

/* Hide navigation on touch devices if preferred, or keep for premium feel */
@media (max-width: 768px) {
    .prw-carousel.swiper {
        overflow: visible;
    }

    .prw-arrow {
        display: none !important;
    }

    .prw-overlay-text {
        font-size: 9px;
        bottom: 70px;
    }
}

@media (max-width: 375px) {
    .prw-carousel.swiper {
        overflow: visible;
    }
}

/* @media (max-width: 320px) {
    .prw-carousel .swiper-slide {
        height: 455px;
    }

    .prw-carousel.swiper {
        padding-bottom: 0;
    }
} */

@media (max-width: 425px) {
    .prw-carousel.swiper {
        padding-bottom: 0;
    }
}