/**
 * WooCommerce Smart Discounts - Frontend Styles
 */

/* ==========================================================================
   1. TIERED DISCOUNT BANNER & PROGRESS BAR (Cart & Checkout)
   ========================================================================== */
.wsd-tiered-discount-banner {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 20px;
    margin: 0 0 24px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.wsd-tiered-discount-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
}

.wsd-banner-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.wsd-banner-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.15);
}

.wsd-banner-title-wrap {
    flex: 1;
    min-width: 220px;
}

.wsd-banner-title {
    margin: 0 0 4px 0 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    line-height: 1.3 !important;
}

.wsd-banner-message {
    margin: 0 !important;
    font-size: 13.5px !important;
    color: #475569 !important;
    line-height: 1.4 !important;
}

.wsd-tag-hemat {
    display: inline-block;
    background: #dcfce7;
    color: #15803d;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
}

.wsd-highlight-success {
    color: #16a34a;
    font-weight: 700;
}

.wsd-banner-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.wsd-badge-level {
    background: #6366f1;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.wsd-badge-saving {
    font-size: 15px;
    font-weight: 800;
    color: #16a34a;
}

/* Progress Track */
.wsd-progress-track {
    width: 100%;
    height: 12px;
    background: #f1f5f9;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.wsd-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    border-radius: 20px;
    position: relative;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 6px;
}

.wsd-progress-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.35) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: wsdShimmer 2s infinite linear;
}

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

.wsd-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11.5px;
    color: #64748b;
    font-weight: 500;
}

.wsd-meta-center {
    font-weight: 600;
    color: #4f46e5;
}

/* ==========================================================================
   2. FLASH SALE BADGE (Shop Catalog & Loop)
   ========================================================================== */
.wsd-flash-sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: #ffffff !important;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    animation: wsdPulseBadge 2.5s infinite;
}

@keyframes wsdPulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* ==========================================================================
   3. SINGLE PRODUCT FLASH SALE BOX
   ========================================================================== */
.wsd-product-flash-box {
    background: linear-gradient(135deg, #fff1f2 0%, #fff7ed 100%);
    border: 1px solid #fed7aa;
    border-radius: 14px;
    padding: 16px 18px;
    margin: 16px 0 22px 0;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.08);
}

.wsd-flash-box-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.wsd-flash-lightning {
    font-size: 20px;
    animation: wsdFlicker 1.5s infinite alternate;
}

@keyframes wsdFlicker {
    0% { transform: rotate(-5deg) scale(0.95); opacity: 0.9; }
    100% { transform: rotate(5deg) scale(1.1); opacity: 1; }
}

.wsd-flash-header-title {
    font-weight: 800;
    font-size: 15px;
    color: #9a3412;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex: 1;
}

.wsd-flash-header-badge {
    background: #ea580c;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* Timer row */
.wsd-flash-timer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: #ffffff;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #ffedd5;
}

.wsd-timer-label {
    font-size: 12.5px;
    font-weight: 700;
    color: #7c2d12;
    text-transform: uppercase;
}

/* Countdown Grid */
.wsd-countdown-grid {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wsd-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #1e293b;
    color: #ffffff;
    border-radius: 6px;
    padding: 4px 6px;
    min-width: 38px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.wsd-countdown-num {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.1;
    font-family: monospace, sans-serif;
    color: #f8fafc;
}

.wsd-countdown-text {
    font-size: 9px;
    text-transform: uppercase;
    color: #94a3b8;
    line-height: 1;
    margin-top: 2px;
}

.wsd-countdown-sep {
    font-size: 16px;
    font-weight: 800;
    color: #ea580c;
    margin: 0 1px;
}

/* Stock bar */
.wsd-flash-stock-wrap {
    margin-top: 12px;
}

.wsd-stock-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
}

.wsd-stock-fire {
    color: #c2410c;
}

.wsd-stock-hint {
    color: #ea580c;
    font-weight: 600;
}

.wsd-stock-bar-track {
    width: 100%;
    height: 10px;
    background: #ffedd5;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.wsd-stock-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ea580c 0%, #dc2626 100%);
    border-radius: 20px;
    position: relative;
    transition: width 0.5s ease;
}

.wsd-stock-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: wsdShimmer 2s infinite linear;
}

/* ==========================================================================
   4. FLASH SALE BANNER (Top of Shop / Shortcode)
   ========================================================================== */
.wsd-flash-sale-banner {
    background: linear-gradient(135deg, #111827 0%, #1f2937 60%, #374151 100%);
    border-radius: 16px;
    padding: 24px 28px;
    margin: 0 0 30px 0;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.wsd-flash-sale-banner::after {
    content: "⚡";
    position: absolute;
    right: -20px;
    bottom: -30px;
    font-size: 140px;
    opacity: 0.05;
    pointer-events: none;
}

.wsd-fs-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.wsd-fs-banner-info {
    flex: 1;
    min-width: 250px;
}

.wsd-fs-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.wsd-pulse-dot {
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 8px #ef4444;
    animation: wsdPulseDot 1.2s infinite;
}

@keyframes wsdPulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
}

.wsd-fs-title {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    margin: 0 0 6px 0 !important;
    letter-spacing: 0.5px;
}

.wsd-fs-subtitle {
    font-size: 14px !important;
    color: #d1d5db !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

.wsd-fs-timer-container {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.wsd-fs-timer-title {
    font-size: 11px;
    font-weight: 800;
    color: #fb923c;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.wsd-grid-banner .wsd-countdown-item {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 44px;
    padding: 6px 8px;
}

.wsd-grid-banner .wsd-countdown-num {
    font-size: 18px;
}

.wsd-grid-banner .wsd-countdown-text {
    font-size: 10px;
}

/* ==========================================================================
   5. SHORTCODE PRODUCT GRID
   ========================================================================== */
.wsd-flash-sale-products-wrap {
    margin: 24px 0;
}

.wsd-no-products {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    color: #64748b;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wsd-fs-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .wsd-fs-timer-container {
        width: 100%;
        align-items: center;
    }

    .wsd-banner-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .wsd-banner-badge {
        align-items: flex-start;
        flex-direction: row;
        gap: 8px;
    }
}
