/**
 * LYG Tinder Slider - Styles
 */

/* === FORCE SCROLL ON BODY (Override antigravity-scroll-lock for Samsung/Android) === */
html:root body,
html:root body.antigravity-scroll-lock,
html body,
html,
body {
    overflow: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: auto !important;
    height: auto !important;
    min-height: 100% !important;
    scroll-behavior: smooth;
    touch-action: pan-y !important;
}

/* === RESET & CONTAINER === */
.lyg-tinder-slider {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 10px 20px 20px 20px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
    /* Ensure scroll is possible */
    overflow: visible;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* === CARDS STACK === */
.lyg-cards-stack {
    position: relative;
    width: 90%;
    max-width: 350px;
    margin: 0 auto 16px auto;
    aspect-ratio: 3 / 4;
    /* Fixed height instead of viewport-based to ensure consistency */
    height: 400px;
    max-height: 400px;
}

/* === PRODUCT CARD === */
.lyg-tinder-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        box-shadow 0.3s ease;
    will-change: transform;
}

.lyg-tinder-card.dragging {
    cursor: grabbing;
    transition: none;
}

.lyg-tinder-card.removing {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s ease;
}

/* Card Stacking Effect */
.lyg-tinder-card:nth-child(2) {
    transform: scale(0.95) translateY(8px);
    z-index: 8;
    opacity: 0.8;
}

.lyg-tinder-card:nth-child(3) {
    transform: scale(0.9) translateY(16px);
    z-index: 7;
    opacity: 0.6;
}

.lyg-tinder-card:nth-child(n+4) {
    transform: scale(0.85) translateY(24px);
    z-index: 6;
    opacity: 0.4;
}

.lyg-tinder-card.active {
    z-index: 10;
    transform: scale(1);
    opacity: 1;
}

/* === CARD IMAGE === */
.lyg-card-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
    overflow: hidden;
}

.lyg-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lyg-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 16px;
}

/* === STOCK BADGE === */
.lyg-stock-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 13px;
    font-weight: 500;
    z-index: 5;
}

.lyg-badge-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.lyg-stock-badge.in-stock .lyg-badge-dot {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.lyg-stock-badge.out-of-stock .lyg-badge-dot {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.lyg-stock-badge.in-stock .lyg-badge-text {
    color: #1f2937;
}

.lyg-stock-badge.out-of-stock .lyg-badge-text {
    color: #ef4444;
}

/* === LIKE/DISLIKE INDICATORS === */
.lyg-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 12px 24px;
    border-radius: 100px;
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 20;
}

.lyg-indicator.like {
    left: 30px;
    color: #10b981;
    border: 4px solid #10b981;
    background: rgba(16, 185, 129, 0.1);
    transform: translateY(-50%) rotate(-15deg);
}

.lyg-indicator.nope {
    right: 30px;
    color: #ef4444;
    border: 4px solid #ef4444;
    background: rgba(239, 68, 68, 0.1);
    transform: translateY(-50%) rotate(15deg);
}

.lyg-indicator.visible {
    opacity: 1;
}

/* === CARD INFO === */
.lyg-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 20px 16px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 70%, transparent 100%);
    z-index: 5;
}

.lyg-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lyg-card-price {
    font-size: 22px;
    font-weight: 700;
    color: #ec4899 !important;
    margin: 0;
}

.lyg-card-price,
.lyg-card-price span,
.lyg-card-price .woocommerce-Price-amount,
.lyg-card-price .amount,
.lyg-card-price bdi {
    color: #ec4899 !important;
}

.lyg-card-price del {
    color: #9ca3af !important;
    font-size: 16px;
    margin-right: 8px;
}

.lyg-card-price ins {
    text-decoration: none;
    color: #ec4899 !important;
}

/* === ACTION BUTTONS === */
.lyg-action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 16px 0;
    margin-bottom: 20px;
}

/* Spacer to force scroll on Android - Height calculated by JavaScript */
.lyg-scroll-spacer {
    display: block !important;
    /* Height set dynamically by JavaScript based on device */
    height: 0;
    width: 100% !important;
    pointer-events: none;
}

.lyg-action-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #000000;
    color: #ffffff;
    position: relative;
}

.lyg-action-btn:hover {
    transform: scale(1.1);
}

.lyg-action-btn:active {
    transform: scale(0.95);
}

/* Dislike Button (X) - Black with gradient border */
.lyg-action-btn.dislike {
    background: transparent;
    color: #ffffff;
    border: none;
    border-radius: 100px;
    position: relative;
    z-index: 1;
}

.lyg-action-btn.dislike::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 100px;
    background: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #f97316 100%);
    z-index: -1;
}

.lyg-action-btn.dislike::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 100px;
    background: #000000;
    z-index: -1;
}

.lyg-action-btn.dislike:hover {
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
}

/* Cart Button (Gradient Border) */
.lyg-action-btn.cart {
    width: 80px;
    height: 80px;
    background: none;
    color: #ffffff;
    position: relative;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
}

.lyg-action-btn.cart::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 100px;
    background: linear-gradient(135deg, #f97316 0%, #ec4899 50%, #f97316 100%);
    z-index: -1;
}

.lyg-action-btn.cart::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 100px;
    background: #000000;
    z-index: -1;
}

.lyg-action-btn.cart:hover,
.lyg-action-btn.cart:active,
.lyg-action-btn.cart:focus {
    background: none;
    box-shadow: none;
    outline: none;
}

/* Like Button (Heart) - Gradient Border with Black fill */
.lyg-action-btn.like {
    position: relative;
    z-index: 1;
    color: #ffffff;
    background: transparent;
}

.lyg-action-btn.like::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 100px;
    background: linear-gradient(135deg, #ec4899 0%, #f97316 100%);
    z-index: -1;
}

.lyg-action-btn.like::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: #000000;
    z-index: -1;
}

.lyg-action-btn.like:hover {
    box-shadow: 0 4px 20px rgba(236, 72, 153, 0.4);
}

/* === EMPTY STATE === */
.lyg-empty-state {
    text-align: center;
    padding: 60px 20px;
    display: none;
}

.lyg-empty-state.visible {
    display: block;
}

.lyg-empty-state h2 {
    font-size: 22px;
    color: #1f2937;
    margin-bottom: 12px;
    font-weight: 600;
}

.lyg-empty-state p {
    font-size: 15px;
    color: #6b7280;
    margin-bottom: 24px;
}

.lyg-reset-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #ec4899 0%, #f97316 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.lyg-reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.4);
}

/* === NO PRODUCTS === */
.lyg-no-products {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-size: 16px;
}

/* === PREVIEW MODE (Elementor Editor) === */
.lyg-preview .lyg-placeholder-image {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ec4899;
    font-size: 18px;
    font-weight: 500;
}

/* === RESPONSIVE === */
@media (max-width: 374px) {
    .lyg-tinder-slider {
        padding: 16px;
    }

    .lyg-card-title {
        font-size: 16px;
    }

    .lyg-card-price {
        font-size: 18px;
    }

    .lyg-action-btn {
        width: 56px;
        height: 56px;
    }

    .lyg-action-btn.cart {
        width: 70px;
        height: 70px;
    }
}

/* Hide on large screens by default - can be toggled */
@media (min-width: 1024px) {
    .lyg-tinder-slider {
        max-width: 400px;
    }
}