/**
 * Modern Frontend Styles - Special Deals WooCommerce
 * assets/frontend.css
 * Version: 2.0.0
 */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazir-font@v30.1.0/dist/font-face.css');

* {
    box-sizing: border-box;
}

/* Base Wrapper - مینیمال و کشیده */
.sdw-deals-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    font-family: Vazir, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Container - دو ستونی */
.sdw-deals-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    min-height: 280px;
}

/* بخش بنر صورتی (سمت راست) */
.sdw-banner-section {
    background: linear-gradient(135deg, var(--sdw-bg-color, #e91e8c) 0%, #c2185b 100%);
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--sdw-text-color, #ffffff);
    position: relative;
    overflow: hidden;
    animation: sdw-bannerEntrance 0.8s ease-out;
}

.sdw-banner-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    animation: sdw-rotate 25s linear infinite;
    pointer-events: none;
}

.sdw-banner-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: sdw-shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

.sdw-banner-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    color: #ffffff;
    animation: sdw-titleBounce 1s ease-out 0.3s both, sdw-titleGlow 2s ease-in-out infinite 1.5s;
}

.sdw-banner-image {
    margin: 0.75rem 0;
    position: relative;
    z-index: 1;
    animation: sdw-float 3s ease-in-out infinite, sdw-imageEntrance 0.8s ease-out 0.5s both;
}

.sdw-banner-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    animation: sdw-pulseRing 2s ease-in-out infinite;
    pointer-events: none;
}

.sdw-banner-image img {
    width: 140px;
    height: auto;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.25));
    max-width: 100%;
}

.sdw-banner-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    animation: sdw-subtitleFade 0.8s ease-out 0.7s both;
}

/* تایمر - ترتیب: ثانیه:دقیقه:ساعت */
.sdw-countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    position: relative;
    z-index: 1;
    animation: sdw-countdownEntrance 0.8s ease-out 0.9s both;
}

.sdw-countdown-item {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.35rem 0.8rem;
    min-width: 60px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sdw-countdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.sdw-countdown-item:hover {
    background: rgba(255, 255, 255, 0.28);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sdw-countdown-item:hover::before {
    left: 100%;
}

.sdw-countdown-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.15rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    animation: sdw-numberPulse 1s ease-in-out infinite;
}

.sdw-countdown-item:hover .sdw-countdown-value {
    transform: scale(1.1);
    animation: sdw-numberBounce 0.5s ease;
}

.sdw-countdown-label {
    display: block;
    font-size: 0.6rem;
    opacity: 0.9;
}

.sdw-countdown-separator {
    font-size: 1.2rem;
    font-weight: 700;
    opacity: 0.7;
    padding: 0 0.15rem;
}

/* بخش محصولات (سمت چپ) */
.sdw-products-section {
    padding: 1rem;
    background: #fafafa;
    position: relative;
    display: flex;
    flex-direction: column;
}

.sdw-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #4a5568;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 0;
}

.sdw-nav-prev {
    right: 0.75rem;
}

.sdw-nav-next {
    left: 0.75rem;
}

.sdw-nav-arrow:hover {
    background: var(--sdw-bg-color, #e91e8c);
    border-color: var(--sdw-bg-color, #e91e8c);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(233, 30, 140, 0.3);
}

.sdw-nav-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.sdw-nav-arrow svg {
    width: 18px;
    height: 18px;
}

/* Products Track */
.sdw-products-track {
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5rem 0;
    scroll-behavior: smooth;
    flex: 1;
}

.sdw-products-track::-webkit-scrollbar {
    display: none;
}

/* کارت محصول - مینیمال و کوچک */
.sdw-product-card {
    flex: 0 0 200px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    scroll-snap-align: start;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.sdw-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--sdw-bg-color, #e91e8c);
}

/* بج تخفیف */
.sdw-discount-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--sdw-discount-badge-color, #fc5c65) 0%, var(--sdw-accent-color, #fd79a8) 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(252, 92, 101, 0.3);
    animation: sdw-pulse 2s infinite;
}

.sdw-discount-percent {
    font-size: 12px;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.sdw-discount-text {
    font-size: 10px;
    font-weight: 700;
    color: white;
    opacity: 1;
    line-height: 1;
    margin-top: -1px;
}

/* Product Image */
.sdw-product-image-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 0.75rem;
    min-height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sdw-product-link {
    display: block;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sdw-product-image-wrapper img,
.sdw-product-img {
    width: 100%;
    height: auto;
    max-height: 110px;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.sdw-product-card:hover .sdw-product-image-wrapper img,
.sdw-product-card:hover .sdw-product-img {
    transform: scale(1.05) translateY(-2px);
}

/* Product Content */
.sdw-product-content {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.sdw-product-brand {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--sdw-bg-color, #e91e8c);
    margin: 0 0 0.3rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.sdw-product-title {
    margin: 0 0 0.3rem 0;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.3;
    color: #2d3748;
    min-height: 2.6em;
}

.sdw-product-title a {
    color: #2d3748;
    text-decoration: none;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sdw-product-title a:hover {
    color: var(--sdw-bg-color, #e91e8c);
}

.sdw-product-excerpt {
    font-size: 0.7rem;
    color: #718096;
    line-height: 1.4;
    margin: 0 0 0.6rem 0;
    min-height: 2.1em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pricing */
.sdw-product-pricing {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: auto 0 0 0;
    flex-wrap: wrap;
}

.sdw-price-regular {
    font-size: 0.75rem;
    color: #a0aec0;
    text-decoration: line-through;
}

.sdw-price-sale {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fc5c65;
}

.sdw-price-single {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2d3748;
}

.sdw-price-unit {
    font-size: 0.7rem;
    color: #718096;
}

/* انیمیشن‌ها */
@keyframes sdw-fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sdw-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sdw-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes sdw-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

@keyframes sdw-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* انیمیشن‌های حرفه‌ای جدید */
@keyframes sdw-bannerEntrance {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes sdw-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes sdw-titleBounce {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    60% {
        transform: translateY(5px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes sdw-titleGlow {
    0%, 100% {
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 10px rgba(255, 255, 255, 0.1);
    }
    50% {
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 255, 255, 0.3), 0 0 30px rgba(255, 255, 255, 0.2);
    }
}

@keyframes sdw-imageEntrance {
    0% {
        opacity: 0;
        transform: scale(0.8) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes sdw-pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

@keyframes sdw-subtitleFade {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 0.95;
        transform: translateY(0);
    }
}

@keyframes sdw-countdownEntrance {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes sdw-numberPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes sdw-numberBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* No Products */
.sdw-no-products {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 1rem;
    color: #718096;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 1rem;
}

/* ریسپانسیو تبلت */
@media (max-width: 1024px) {
    .sdw-deals-container {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .sdw-banner-section {
        min-height: 260px;
        padding: 1.25rem 1rem;
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .sdw-deals-wrapper {
        border-radius: 12px;
    }

    .sdw-deals-container {
        min-height: auto;
    }

    .sdw-products-section {
        padding: 0.75rem 0.5rem;
    }

    .sdw-nav-arrow {
        display: none;
    }

    .sdw-product-card {
        flex: 0 0 160px;
    }

    .sdw-product-image-wrapper {
        min-height: 110px;
        padding: 0.6rem;
    }

    .sdw-product-image-wrapper img,
    .sdw-product-img {
        max-height: 90px;
    }

    .sdw-product-content {
        padding: 0.6rem;
    }

    .sdw-product-title {
        font-size: 0.75rem;
        min-height: 2.4em;
    }

    .sdw-product-excerpt {
        font-size: 0.65rem;
        min-height: 1.95em;
    }

    .sdw-price-sale {
        font-size: 0.9rem;
    }

    /* بنر در موبایل - کشیده و افقی */
    .sdw-banner-section {
        padding: 1rem 1.25rem;
        min-height: auto;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.75rem;
        text-align: center;
    }

    .sdw-banner-image {
        display: none !important; /* مخفی کردن تصویر در موبایل */
    }

    .sdw-banner-title {
        font-size: 1.1rem;
        margin: 0;
        color: #ffffff !important;
        white-space: normal;
        flex-shrink: 0;
    }

    .sdw-banner-subtitle {
        display: none !important; /* مخفی کردن زیرعنوان در موبایل */
    }

    .sdw-countdown {
        gap: 0.25rem;
        margin: 0;
        width: 100%;
        max-width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .sdw-countdown-item {
        padding: 0.3rem 0.6rem;
        min-width: 50px;
        max-width: 60px;
        border-radius: 6px;
        flex-shrink: 0;
    }

    .sdw-countdown-value {
        font-size: 1.2rem;
    }

    .sdw-countdown-label {
        font-size: 0.55rem;
    }

    .sdw-countdown-separator {
        font-size: 1rem;
        padding: 0 0.1rem;
    }
}

@media (max-width: 480px) {
    .sdw-products-section {
        padding: 0.6rem 0.4rem;
    }

    .sdw-product-card {
        flex: 0 0 140px;
        border-radius: 8px;
    }

    .sdw-discount-badge {
        width: 35px;
        height: 35px;
        top: 5px;
        right: 5px;
    }

    .sdw-discount-percent {
        font-size: 11px;
    }

    .sdw-discount-text {
        font-size: 9px;
    }

    .sdw-product-image-wrapper {
        min-height: 100px;
        padding: 0.5rem;
    }

    .sdw-product-image-wrapper img,
    .sdw-product-img {
        max-height: 80px;
    }

    .sdw-product-content {
        padding: 0.5rem;
    }

    .sdw-product-brand {
        font-size: 0.6rem;
        margin-bottom: 0.25rem;
    }

    .sdw-product-title {
        font-size: 0.7rem;
        min-height: 2.1em;
        margin-bottom: 0.25rem;
    }

    .sdw-product-excerpt {
        font-size: 0.6rem;
        min-height: 1.8em;
        margin-bottom: 0.5rem;
    }

    .sdw-product-pricing {
        gap: 0.3rem;
    }

    .sdw-price-regular {
        font-size: 0.65rem;
    }

    .sdw-price-sale {
        font-size: 0.85rem;
    }

    .sdw-price-unit {
        font-size: 0.65rem;
    }

    /* بنر در موبایل کوچک - کشیده و افقی */
    .sdw-banner-section {
        padding: 0.85rem 1rem;
        min-height: auto;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.6rem;
        text-align: center;
    }

    .sdw-banner-image {
        display: none !important; /* مخفی کردن تصویر در موبایل */
    }

    .sdw-banner-title {
        font-size: 0.95rem;
        margin: 0;
        color: #ffffff !important;
        white-space: normal;
        flex-shrink: 0;
    }

    .sdw-banner-subtitle {
        display: none !important; /* مخفی کردن زیرعنوان در موبایل */
    }

    .sdw-countdown {
        gap: 0.2rem;
        margin: 0;
        width: 100%;
        max-width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .sdw-countdown-item {
        padding: 0.25rem 0.5rem;
        min-width: 42px;
        max-width: 50px;
        border-radius: 6px;
        flex-shrink: 0;
    }

    .sdw-countdown-value {
        font-size: 1rem;
        margin-bottom: 0.1rem;
    }

    .sdw-countdown-label {
        font-size: 0.5rem;
    }

    .sdw-countdown-separator {
        font-size: 0.9rem;
        padding: 0 0.08rem;
    }
}
