/* ============================================================
   WC Product Slider — Frontend Styles
   ============================================================ */

/* ── Section wrapper ────────────────────────────────────── */
.wcps-section {
    position: relative;
    box-sizing: border-box;
}

.wcps-section *,
.wcps-section *::before,
.wcps-section *::after {
    box-sizing: border-box;
}

.wcps-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Title ──────────────────────────────────────────────── */
.wcps-title {
    margin: 0 0 20px;
    padding: 0;
    font-weight: 700;
    line-height: 1.3;
}

/* ── Header row (top nav mode) ─────────────────────────── */
.wcps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.wcps-header .wcps-title {
    margin-bottom: 0;
}

.wcps-nav-top .wcps-header .wcps-nav-top-btns {
    display: flex;
    gap: 8px;
}

/* ── Swiper wrapper ─────────────────────────────────────── */
.wcps-swiper-wrap {
    position: relative;
}

.wcps-swiper .swiper-slide {
    height: auto;
}

/* ── Product Card ────────────────────────────────────────── */
.wcps-product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
}

.wcps-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .12) !important;
}

/* ── Product Image ───────────────────────────────────────── */
.wcps-img-link {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.wcps-product-img {
    display: block;
    width: 100%;
    transition: transform 0.35s ease;
}

.wcps-img-link:hover .wcps-product-img {
    transform: scale(1.05);
}

.wcps-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: #f0f0f0;
}

.wcps-img-placeholder .dashicons {
    font-size: 48px;
    color: #ccc;
    width: auto;
    height: auto;
}

/* ── Badges ─────────────────────────────────────────────── */
.wcps-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    line-height: 1.4;
    z-index: 2;
    letter-spacing: .04em;
}

.wcps-badge-sale {
    background: #e44;
    color: #fff;
}

.wcps-badge-featured {
    background: #ffa500;
    color: #fff;
    top: 10px;
    left: auto;
    right: 10px;
}

/* ── Card Body ───────────────────────────────────────────── */
.wcps-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

/* ── Rating ──────────────────────────────────────────────── */
.wcps-rating .star-rating {
    margin: 0;
    font-size: 13px;
}

/* ── Product title ───────────────────────────────────────── */
.wcps-product-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wcps-product-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.wcps-product-title a:hover {
    color: #0073aa;
}

/* ── Price ───────────────────────────────────────────────── */
.wcps-price {
    font-size: 15px;
    font-weight: 700;
    margin-top: auto;
}

.wcps-price .woocommerce-Price-amount {
    color: inherit;
}

.wcps-price del {
    opacity: 0.55;
    margin-right: 5px;
    font-size: 12px;
}

/* ── Add-to-cart button ──────────────────────────────────── */
.wcps-btn-wrap {
    margin-top: 6px;
    display: flex;
    gap: 8px;
    align-items: stretch;
}

/* Cart button grows to fill remaining space */
.wcps-btn-wrap .wcps-add-to-cart {
    flex: 1;
}

.wcps-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    text-align: center;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s, opacity 0.2s;
    letter-spacing: .02em;
}

.wcps-add-to-cart:hover {
    opacity: 0.9;
    text-decoration: none;
}

.wcps-add-to-cart .wcps-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: currentColor;
}

/* icon-only cart button */
.wcps-btn-mode-icon.wcps-add-to-cart {
    width: auto;
    padding: 9px 12px;
}

/* ── Quick View button — image-overlay (old always mode, hover mode) ── */
.wcps-qv-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border: none;
    cursor: pointer;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 3;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.22s ease, transform 0.22s ease;
    text-decoration: none;
    border-radius: 0 !important;
    letter-spacing: .02em;
}

.wcps-img-link:hover .wcps-qv-btn,
.wcps-img-link:focus-within .wcps-qv-btn {
    opacity: 1;
    transform: translateY(0);
}

.wcps-qv-btn .wcps-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: currentColor;
}

/* icon-only QV button (image overlay) */
.wcps-qv-btn-mode-icon:not(.wcps-qv-inline) {
    left: 50%;
    right: auto;
    bottom: 12px;
    width: auto;
    padding: 8px;
    transform: translateX(-50%) translateY(10px);
    opacity: 0;
    border-radius: 50% !important;
}

.wcps-img-link:hover .wcps-qv-btn-mode-icon:not(.wcps-qv-inline) {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Quick View — INLINE mode (always visible in card body) ── */
.wcps-qv-inline {
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
    transition: background 0.2s, filter 0.2s !important;
    flex-shrink: 0;
    width: auto !important;
    padding: 9px 14px;
    border-radius: inherit !important;
}

/* icon-only inline QV: compact square */
.wcps-qv-inline.wcps-qv-btn-mode-icon {
    padding: 9px 12px;
}

/* ── Image area wrapper (hover action mode) ──────────────── */
.wcps-img-area {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    display: block;
}

/* Subtle image scale on card hover for depth */
.wcps-action-hover .wcps-product-img {
    transition: transform 0.35s ease;
}

.wcps-action-hover:hover .wcps-product-img {
    transform: scale(1.04);
}

/* ── Hover action strip (both buttons, slide up on card hover) ── */
.wcps-card-hover-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    z-index: 5;
    /* start hidden below the image */
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.28s ease;
    /* dark gradient behind buttons so they're readable on any image */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.0) 100%);
}

/* Trigger: card hover or keyboard focus inside */
.wcps-action-hover:hover .wcps-card-hover-actions,
.wcps-action-hover:focus-within .wcps-card-hover-actions {
    transform: translateY(0);
    opacity: 1;
}

/* Each button shares the strip width equally */
.wcps-card-hover-actions .wcps-add-to-cart,
.wcps-card-hover-actions .wcps-qv-btn {
    flex: 1;
    width: auto !important;
    border-radius: 0 !important;
    margin: 0;
    padding: 12px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.18s ease, background 0.18s ease;
}

.wcps-card-hover-actions .wcps-add-to-cart:hover,
.wcps-card-hover-actions .wcps-qv-btn:hover {
    filter: brightness(1.12);
}

/* Thin divider between the two buttons */
.wcps-card-hover-actions .wcps-add-to-cart+.wcps-qv-btn {
    border-left: 1px solid rgba(255, 255, 255, 0.22);
}

/* Icon sizing inside hover strip */
.wcps-card-hover-actions .wcps-icon {
    width: 17px;
    height: 17px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ── Navigation arrows ───────────────────────────────────── */
.wcps-swiper-wrap .swiper-button-next,
.wcps-swiper-wrap .swiper-button-prev {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.2s;
}

.wcps-swiper-wrap .swiper-button-next:active,
.wcps-swiper-wrap .swiper-button-prev:active {
    opacity: 0.8;
}

/* Outside arrows */
.wcps-nav-outside .wcps-swiper-wrap {
    padding: 0 54px;
}

.wcps-swiper-wrap .swiper-button-prev.wcps-outside,
.wcps-swiper-wrap .swiper-button-next.wcps-outside {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 0;
    z-index: 10;
}

.wcps-swiper-wrap .swiper-button-prev.wcps-outside {
    left: 0;
}

.wcps-swiper-wrap .swiper-button-next.wcps-outside {
    right: 0;
}

/* Top nav arrows */
.wcps-nav-top .swiper-button-next,
.wcps-nav-top .swiper-button-prev {
    position: static;
    margin-top: 0;
    transform: none !important;
}

/* ── Pagination ──────────────────────────────────────────── */
.swiper-pagination {
    position: relative;
    margin-top: 18px;
    bottom: auto !important;
}

/* ── Disabled arrows ─────────────────────────────────────── */
.swiper-button-disabled {
    opacity: 0.35 !important;
    pointer-events: none;
}

/* ── No-products / error message ─────────────────────────── */
.wcps-no-products,
.wcps-error {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    font-size: 14px;
    color: #856404;
}

/* ============================================================
   Quick View Modal
   ============================================================ */
#wcps-qv-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wcps-qv-modal[hidden] {
    display: none;
}

.wcps-qv-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
    animation: wcpsOverlayIn 0.2s ease;
}

.wcps-qv-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 860px;
    width: calc(100% - 40px);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
    animation: wcpsDialogIn 0.22s ease;
    z-index: 1;
}

@keyframes wcpsOverlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes wcpsDialogIn {
    from {
        opacity: 0;
        transform: scale(.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.wcps-qv-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: #333;
    transition: background 0.15s;
}

.wcps-qv-close:hover {
    background: #e0e0e0;
}

.wcps-qv-content {
    display: flex;
    flex-wrap: wrap;
    min-height: 300px;
}

/* Loading spinner */
.wcps-qv-spinner {
    margin: auto;
    width: 40px;
    height: 40px;
    border: 3px solid #eee;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: wcpsSpin 0.7s linear infinite;
}

@keyframes wcpsSpin {
    to {
        transform: rotate(360deg);
    }
}

/* QV layout */
.wcps-qv-img {
    flex: 0 0 45%;
    max-width: 45%;
}

.wcps-qv-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px 0 0 12px;
}

.wcps-qv-info {
    flex: 1;
    padding: 32px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wcps-qv-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 30px 0 0;
    line-height: 1.3;
}

.wcps-qv-name a {
    color: inherit;
    text-decoration: none;
}

.wcps-qv-name a:hover {
    color: #0073aa;
}

.wcps-qv-rating .star-rating {
    margin: 0;
}

.wcps-qv-price {
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.wcps-qv-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    flex: 1;
}

.wcps-qv-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.wcps-qv-cart-btn {
    flex: 1;
    text-align: center;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    background: #0073aa;
    color: #fff;
    border: none;
    transition: background 0.18s;
}

.wcps-qv-cart-btn:hover,
.wcps-qv-cart-btn:focus {
    background: #005177;
    color: #fff;
    text-decoration: none;
}

.wcps-qv-view-btn {
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: 2px solid #ddd;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.18s;
}

.wcps-qv-view-btn:hover {
    border-color: #0073aa;
    color: #0073aa;
}

/* ── RTL ─────────────────────────────────────────────────── */
.rtl .wcps-badge-sale {
    left: auto;
    right: 10px;
}

.rtl .wcps-badge-featured {
    right: auto;
    left: 10px;
}

/* ── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 767px) {
    .wcps-inner {
        padding: 0 12px;
    }

    .wcps-nav-outside .wcps-swiper-wrap {
        padding: 0 40px;
    }

    .wcps-title {
        font-size: 18px !important;
    }

    .wcps-qv-img {
        flex: 0 0 100%;
        max-width: 100%;
        max-height: 260px;
        overflow: hidden;
    }

    .wcps-qv-img img {
        border-radius: 12px 12px 0 0;
    }

    .wcps-qv-info {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .wcps-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .wcps-card-body {
        padding: 10px 12px 12px;
    }

    .wcps-qv-dialog {
        width: calc(100% - 20px);
        border-radius: 10px;
    }
}