/* ==========================================================================
   Yooktel Campaign Elementor Widget Styles
   RTL-First, Modern Persian E-commerce Design System
   ========================================================================== */

.yook-campaign-container {
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
    font-family: inherit;
    position: relative;
    width: 100%;
}

.yook-campaign-container * {
    box-sizing: border-box;
}

/* Grid Layout */
.yook-campaign-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

/* Product Card */
.yook-campaign-card {
    background: #ffffff;
    border: 1px solid #e0e0e2;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
}

.yook-campaign-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
    border-color: #d0d1d5;
}

.yook-campaign-card.yook-out-of-stock {
    opacity: 0.72;
    filter: grayscale(0.2);
}

/* Media & Gallery */
.yook-card-media {
    position: relative;
    width: 100%;
    height: 220px;
    background-color: #fbfbfb;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.yook-media-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.yook-gallery-track {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.yook-main-img, 
.yook-gallery-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.yook-campaign-card:hover .yook-main-img {
    transform: scale(1.03);
}

/* Gallery Navigation Dots */
.yook-gallery-dots {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.yook-card-media:hover .yook-gallery-dots,
.yook-card-media.touch-active .yook-gallery-dots {
    opacity: 1;
}

.yook-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
}

.yook-dot.active {
    width: 16px;
    border-radius: 999px;
    background-color: #ef394e;
}

/* Discount Badge */
.yook-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ef394e;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    padding: 4px 9px;
    border-radius: 9999px;
    z-index: 4;
    box-shadow: 0 4px 10px rgba(239, 57, 78, 0.35);
    letter-spacing: 0.5px;
}

/* Card Body */
.yook-card-body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Product Title */
.yook-card-title {
    font-size: 13.5px;
    line-height: 22px;
    font-weight: 700;
    margin: 0 0 10px;
    min-height: 44px;
    max-height: 44px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yook-card-title a {
    color: #23254e;
    text-decoration: none;
    transition: color 0.2s ease;
}

.yook-card-title a:hover {
    color: #ef394e;
}

/* Pricing Area */
.yook-card-pricing {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 44px;
    margin-bottom: 12px;
}

.yook-price-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.yook-regular-price {
    font-size: 12px;
    color: #9e9fb1;
    text-decoration: line-through;
    text-decoration-color: #ef394e;
    opacity: 0.85;
}

.yook-sale-price {
    font-size: 16px;
    font-weight: 800;
    color: #23254e;
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.yook-price-out-label {
    font-size: 13px;
    font-weight: 700;
    color: #9e9fb1;
}

/* Stock Progress Bar */
.yook-stock-bar-wrap {
    margin-bottom: 12px;
    width: 100%;
}

.yook-stock-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.yook-stock-text {
    font-size: 11px;
    font-weight: 700;
    color: #ef394e;
}

.yook-stock-progress-track {
    width: 100%;
    height: 6px;
    background-color: #f0f0f1;
    border-radius: 9999px;
    overflow: hidden;
}

.yook-stock-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #ef394e 100%);
    border-radius: 9999px;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Countdown Timer */
.yook-card-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    background: #fdf2f3;
    border-radius: 10px;
    margin-bottom: 12px;
}

.yook-timer-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 32px;
}

.yook-timer-num {
    font-size: 13px;
    font-weight: 800;
    color: #ef394e;
    line-height: 1.2;
}

.yook-timer-label {
    font-size: 9px;
    font-weight: 600;
    color: #933842;
    line-height: 1;
}

.yook-timer-sep {
    font-size: 12px;
    font-weight: 800;
    color: #ef394e;
    margin: 0 1px;
}

/* Actions */
.yook-card-action {
    margin-top: auto;
    width: 100%;
}

.yook-action-box {
    position: relative;
    width: 100%;
}

.yook-card-btn {
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 10px;
    background-color: #ef394e;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s active;
}

.yook-card-btn:hover {
    background-color: #d82a3e;
    box-shadow: 0 4px 14px rgba(239, 57, 78, 0.32);
}

.yook-card-btn:active {
    transform: scale(0.98);
}

.yook-btn-disabled {
    background-color: #f0f0f1 !important;
    color: #9e9fb1 !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

/* Quantity Controller */
.yook-action-box .yook-qty-controller {
    display: none;
}

.yook-action-box.is-in-cart .yook-card-btn.yook-btn-simple {
    display: none;
}

.yook-action-box.is-in-cart .yook-qty-controller {
    display: flex;
}

.yook-qty-controller {
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 42px;
    border: 1.5px solid #ef394e;
    border-radius: 10px;
    background-color: #ffffff;
    padding: 0 8px;
}

.yook-qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background-color: #fdf2f3;
    color: #ef394e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s active;
}

.yook-qty-btn:hover {
    background-color: #fce1e4;
}

.yook-qty-btn:active {
    transform: scale(0.92);
}

.yook-trash-icon {
    display: none;
    stroke: #ef394e;
}

.yook-trash-icon.visible {
    display: block;
}

.yook-minus-icon {
    display: none;
    line-height: 1;
}

.yook-minus-icon.visible {
    display: block;
}

.yook-qty-num {
    font-size: 15px;
    font-weight: 800;
    color: #23254e;
    min-width: 24px;
    text-align: center;
}

/* Loading & Infinite Scroll */
.yook-infinite-sentinel {
    width: 100%;
    height: 20px;
    margin-top: 10px;
    opacity: 0;
    pointer-events: none;
}

.yook-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    width: 100%;
}

.yook-load-more-btn {
    padding: 12px 28px;
    background-color: #ffffff;
    border: 1.5px solid #ef394e;
    color: #ef394e;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.yook-load-more-btn:hover {
    background-color: #ef394e;
    color: #ffffff;
}

/* Skeletons */
.yook-campaign-skeletons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
    width: 100%;
}

.yook-skeleton-card {
    pointer-events: none;
    border: 1px solid #e8e8ea;
}

.yook-skeleton-media {
    background: #f4f4f6;
    position: relative;
    overflow: hidden;
}

.yook-skeleton-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.7) 50%, transparent 100%);
    animation: yookShimmer 1.5s infinite;
}

.yook-skeleton-line {
    background: #f0f0f2;
    border-radius: 6px;
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}

.yook-skeleton-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.8) 50%, transparent 100%);
    animation: yookShimmer 1.5s infinite;
}

.yook-skeleton-title {
    height: 14px;
    width: 90%;
}

.yook-skeleton-title-short {
    height: 14px;
    width: 60%;
    margin-bottom: 12px;
}

.yook-skeleton-price {
    height: 18px;
    width: 45%;
    margin-bottom: 12px;
}

.yook-skeleton-stock {
    height: 6px;
    width: 100%;
    margin-bottom: 12px;
}

.yook-skeleton-timer {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: 12px;
}

.yook-skeleton-box {
    width: 32px;
    height: 32px;
    background: #f0f0f2;
    border-radius: 8px;
}

.yook-skeleton-btn {
    height: 42px;
    width: 100%;
    border-radius: 10px;
    margin-top: auto;
}

@keyframes yookShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Spinner */
.yook-btn-spinner,
.yook-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: yookSpin 0.7s linear infinite;
    display: none;
}

.is-loading .yook-btn-spinner {
    display: inline-block;
}

@keyframes yookSpin {
    to { transform: rotate(360deg); }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .yook-campaign-grid,
    .yook-campaign-skeletons {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 767px) {
    .yook-campaign-grid,
    .yook-campaign-skeletons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .yook-card-media {
        height: 170px;
    }

    .yook-card-body {
        padding: 10px 10px 12px;
    }

    .yook-card-title {
        font-size: 12.5px;
        line-height: 19px;
        min-height: 38px;
        max-height: 38px;
    }

    .yook-sale-price {
        font-size: 14px;
    }

    .yook-card-btn,
    .yook-qty-controller {
        height: 38px;
        font-size: 12px;
    }

    .yook-qty-btn {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .yook-campaign-grid,
    .yook-campaign-skeletons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}
