/* ============================================================
   Smart Discount Pro — Frontend CSS  (v1.5)
   ============================================================ */

:root {
    --sdp-primary:  #6c63ff;
    --sdp-green:    #27ae60;
    --sdp-orange:   #f39c12;
    --sdp-red:      #e74c3c;
    --sdp-dark:     #2c3e50;
    --sdp-radius:   10px;
    --sdp-shadow:   0 4px 20px rgba(0,0,0,.10);
}

/* ---- Discount badge on product cards / price HTML ---- */
.sdp-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1.6;
}

/* Absolute badge on product thumbnails */
ul.products li.product { position: relative; }

.woocommerce ul.products li.product .sdp-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 9;
    border-radius: 6px;
    font-size: 12px;
}

/* Strike-through + discounted price */
.sdp-original-price  { color: #999; }
.sdp-discounted-price { color: var(--sdp-red); font-weight: 700; text-decoration: none; }

/* ===========================================================
   1. FREE-SHIPPING PROGRESS BAR
   =========================================================== */

.sdp-shipping-bar {
    background: #f8f9ff;
    border: 2px solid #e0deff;
    border-radius: var(--sdp-radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    direction: rtl;
}

.sdp-shipping-bar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--sdp-dark);
}

.sdp-shipping-icon { font-size: 18px; }

.sdp-shipping-track {
    background: #e0deff;
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
}

.sdp-shipping-fill {
    background: linear-gradient( 90deg, var(--sdp-primary), #a78bfa );
    height: 100%;
    border-radius: 20px;
    transition: width .5s ease;
    min-width: 4px;
}

.sdp-shipping-achieved {
    background: #e8f8f0;
    border-color: #a8e6c3;
    color: var(--sdp-green);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===========================================================
   2. COUNTDOWN TIMER
   =========================================================== */

.sdp-countdown {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    background: linear-gradient( 135deg, #fff5f5, #fff );
    border: 2px solid #fde8e8;
    border-radius: var(--sdp-radius);
    padding: 12px 16px;
    margin: 12px 0;
    direction: rtl;
}

.sdp-countdown-label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.sdp-countdown-timer {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sdp-cd-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--sdp-red);
    color: #fff;
    border-radius: 6px;
    padding: 6px 10px;
    min-width: 44px;
}

.sdp-cd-num {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.sdp-cd-block small {
    font-size: 10px;
    opacity: .85;
    margin-top: 2px;
}

.sdp-cd-sep {
    font-size: 22px;
    font-weight: 700;
    color: var(--sdp-red);
    line-height: 1;
    margin: 0 2px;
    align-self: flex-start;
    padding-top: 4px;
}

.sdp-cd-expired {
    color: var(--sdp-red);
    font-weight: 700;
    font-size: 14px;
}

/* Cart compact countdown */
.sdp-cart-countdown {
    background: #fff8e1;
    border-right: 4px solid var(--sdp-orange);
    border-radius: 0 var(--sdp-radius) var(--sdp-radius) 0;
    padding: 10px 14px;
    font-size: 13px;
    color: #7a5800;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    direction: rtl;
}

.sdp-cart-countdown .dashicons { color: var(--sdp-orange); }

.sdp-cart-cd-timer {
    color: var(--sdp-red);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ===========================================================
   3. SAVINGS NOTICE (cart page)
   =========================================================== */

.sdp-savings-notice {
    background: linear-gradient( 135deg, #e8f8f0, #f0fff4 );
    border: 2px solid #a8e6c3;
    border-radius: var(--sdp-radius);
    padding: 14px 18px;
    font-size: 15px;
    color: var(--sdp-green);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    direction: rtl;

    /* Hidden initially */
    opacity: 0;
    transform: translateY( -8px );
    transition: opacity .4s ease, transform .4s ease;
}

.sdp-savings-notice.sdp-savings-visible {
    opacity: 1;
    transform: translateY( 0 );
}

.sdp-savings-icon { font-size: 20px; }

@keyframes sdp-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(39,174,96,.4); }
    70%  { box-shadow: 0 0 0 10px rgba(39,174,96,0); }
    100% { box-shadow: 0 0 0 0 rgba(39,174,96,0); }
}

.sdp-savings-notice.sdp-savings-pulse {
    animation: sdp-pulse .6s ease;
}

/* ===========================================================
   4. FREQUENTLY BOUGHT TOGETHER
   =========================================================== */

.sdp-fbt-widget {
    margin: 32px 0;
    padding: 24px;
    border: 2px solid #e8e4ff;
    border-radius: 14px;
    background: #fafafe;
    direction: rtl;
}

.sdp-fbt-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--sdp-dark);
    margin: 0 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sdp-fbt-title .dashicons {
    color: var(--sdp-primary);
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.sdp-fbt-products {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sdp-fbt-plus {
    font-size: 24px;
    font-weight: 700;
    color: #bbb;
    padding: 0 4px;
}

.sdp-fbt-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    background: #fff;
    border: 2px solid #eee;
    border-radius: 10px;
    width: 140px;
    text-align: center;
    transition: border-color .2s;
    position: relative;
}

.sdp-fbt-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 6px;
}

.sdp-fbt-main {
    border-color: var(--sdp-primary);
    background: #f5f3ff;
}

.sdp-fbt-discounted {
    border-color: var(--sdp-green);
}

.sdp-fbt-discounted::before {
    content: '🏷️';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 18px;
}

.sdp-fbt-pname {
    font-size: 12px;
    color: var(--sdp-dark);
    line-height: 1.4;
    max-height: 34px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sdp-fbt-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--sdp-primary);
}

.sdp-fbt-price del {
    font-size: 11px;
    color: #999;
    font-weight: 400;
    display: block;
}

.sdp-fbt-price ins {
    color: var(--sdp-red);
    text-decoration: none;
}

.sdp-fbt-add-btn {
    background: var(--sdp-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    width: 100%;
}

.sdp-fbt-add-btn:hover    { background: #574fd6; }
.sdp-fbt-add-btn:disabled { background: #ccc; cursor: default; }

.sdp-fbt-added {
    background: var(--sdp-green) !important;
}

/* ===========================================================
   5. CASHBACK WALLET WIDGET (cart & checkout)
   =========================================================== */

.sdp-cashback-widget {
    background: linear-gradient(135deg, #f5f3ff, #eef8ff);
    border: 2px solid #d0c8ff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    direction: rtl;
    font-size: 14px;
}

.sdp-cw-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(108,99,255,.15);
}

.sdp-cw-icon { font-size: 22px; flex-shrink: 0; }

.sdp-cw-title {
    font-weight: 700;
    color: #2c3e50;
    font-size: 15px;
    flex: 1;
}

.sdp-cw-balance {
    font-weight: 800;
    color: #6c63ff;
    font-size: 16px;
}

.sdp-cw-earn {
    background: rgba(39,174,96,.09);
    border: 1px solid rgba(39,174,96,.25);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    color: #1a7040;
    line-height: 1.5;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.sdp-cw-earn-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.sdp-cw-tier-hint {
    background: rgba(243,156,18,.09);
    border: 1px solid rgba(243,156,18,.3);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 8px;
    color: #7a5200;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sdp-cw-redeem {
    margin-top: 8px;
}

.sdp-cw-redeem-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #2c3e50;
    line-height: 1.5;
}

.sdp-cw-redeem-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    accent-color: #6c63ff;
    cursor: pointer;
}

/* Mini-cart wallet notice */
.sdp-mini-cashback {
    padding: 8px 12px;
    background: #f5f3ff;
    border-top: 1px solid #e0deff;
    font-size: 13px;
    color: #4a3fa0;
    direction: rtl;
    text-align: center;
}
