/* Woo Discount Manager - Incentive Message Styles */

.wdm-incentive-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
    animation: wdm-pulse 2s ease-in-out infinite;
}

.wdm-incentive-message:empty {
    display: none;
}

.wdm-incentive-message strong {
    color: #fff;
    font-weight: 700;
}

.wdm-incentive-icon {
    margin-right: 6px;
    font-size: 16px;
}

/* Animation */
@keyframes wdm-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.01);
    }
}

/* WoodMart drawer cart specific */
.wd-cart-widget .wdm-incentive-message,
.cart-widget-side .wdm-incentive-message {
    margin: 10px 15px;
    font-size: 13px;
    padding: 10px 14px;
}

/* Mini cart widget */
.widget_shopping_cart .wdm-incentive-message {
    margin: 10px 0;
}

/* Cart page */
.woocommerce-cart .wdm-incentive-message {
    max-width: 600px;
    margin: 0 auto 20px;
}

/* Success state - max discount reached */
.wdm-incentive-message:has(.wdm-incentive-icon:first-child:contains("🎉")) {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* Alternative colors for different message types */
.wdm-incentive-message--success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.wdm-incentive-message--spending {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* RTL Support */
[dir="rtl"] .wdm-incentive-icon {
    margin-right: 0;
    margin-left: 6px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wdm-incentive-message {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .wdm-incentive-message {
        font-size: 13px;
        padding: 10px 12px;
        border-radius: 6px;
    }

    .wdm-incentive-icon {
        font-size: 14px;
    }
}

/* ========================================
   Gift Feature Styles
   ======================================== */

/* Gift Badge - shown next to gift items in cart */
.wdm-gift-badge {
    display: inline-block;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(17, 153, 142, 0.3);
}

/* Gift quantity display (replaces input) */
.wdm-gift-quantity {
    display: inline-block;
    background: #f5f5f5;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: 600;
    color: #333;
    border: 1px solid #ddd;
}

/* Gift remove link disabled state */
.wdm-gift-no-remove {
    color: #ccc;
    cursor: not-allowed;
    font-size: 18px;
}

/* Gift icon for placeholder gifts */
.wdm-gift-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    font-size: 32px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-radius: 8px;
}

/* Gift Incentive Message */
.wdm-gift-incentive-message {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    box-shadow: 0 2px 10px rgba(17, 153, 142, 0.3);
}

.wdm-gift-incentive-message:empty {
    display: none;
}

.wdm-gift-incentive-message strong {
    color: #fff;
    font-weight: 700;
}

/* WoodMart drawer cart specific */
.wd-cart-widget .wdm-gift-incentive-message,
.cart-widget-side .wdm-gift-incentive-message {
    margin: 10px 15px;
    font-size: 13px;
    padding: 10px 14px;
}

/* Mini cart widget */
.widget_shopping_cart .wdm-gift-incentive-message {
    margin: 10px 0;
}

/* Cart page */
.woocommerce-cart .wdm-gift-incentive-message {
    max-width: 600px;
    margin: 0 auto 20px;
}

/* Gift item row styling */
.woocommerce-cart-form .cart_item .wdm-gift-badge {
    animation: wdm-gift-shine 2s ease-in-out infinite;
}

@keyframes wdm-gift-shine {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(17, 153, 142, 0.3);
    }
    50% {
        box-shadow: 0 2px 12px rgba(17, 153, 142, 0.5);
    }
}

/* RTL Support for gifts */
[dir="rtl"] .wdm-gift-badge {
    margin-left: 0;
    margin-right: 8px;
}

/* Checkout order review gift styling */
.woocommerce-checkout-review-order-table .wdm-gift-badge {
    font-size: 10px;
    padding: 2px 6px;
    margin-left: 5px;
}

/* Gift item row in checkout */
.woocommerce-checkout-review-order-table .wdm-gift-item {
    background: linear-gradient(135deg, rgba(17, 153, 142, 0.1) 0%, rgba(56, 239, 125, 0.1) 100%);
}


.woocommerce-checkout-review-order-table .wdm-gift-item .product-total {
    color: #11998e;
    font-weight: 600;
}

/* Small badge for orders */
.wdm-gift-badge-small {
    display: inline-block;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 5px;
    vertical-align: middle;
}

/* Order emails and admin order view */
.woocommerce-table--order-details .wdm-gift-badge,
.woocommerce-order-details .wdm-gift-badge {
    font-size: 10px;
    padding: 2px 6px;
}

/* Mobile responsive for gifts */
@media (max-width: 768px) {
    .wdm-gift-badge {
        font-size: 10px;
        padding: 2px 8px;
        margin-left: 5px;
    }

    .wdm-gift-incentive-message {
        font-size: 13px;
        padding: 10px 12px;
    }

    .wdm-gift-quantity {
        padding: 4px 10px;
        font-size: 13px;
    }
}

/* ========================================
   Free Shipping Progress Bar Styles
   ======================================== */

/* Main progress container */
.wdm-free-shipping-progress {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe4cc 100%);
    border: 2px solid #f5a623;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.2);
}

.wdm-free-shipping-progress:empty {
    display: none;
}

/* Progress bar track */
.wdm-progress-bar {
    height: 12px;
    background: #e8e0d5;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Progress bar fill */
.wdm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f5a623 0%, #ff8c00 50%, #ff6b00 100%);
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Animated shine effect on progress bar */
.wdm-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: wdm-progress-shine 2s ease-in-out infinite;
}

@keyframes wdm-progress-shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Progress text */
.wdm-progress-text {
    font-size: 14px;
    color: #5a4a32;
    text-align: center;
    font-weight: 500;
    line-height: 1.4;
}

.wdm-progress-text strong {
    color: #d4740c;
    font-weight: 700;
}

/* Progress icon */
.wdm-progress-icon {
    margin-right: 8px;
    font-size: 18px;
    vertical-align: middle;
}

/* Qualified state - free shipping unlocked */
.wdm-free-shipping-progress.qualified {
    background: linear-gradient(135deg, #e6fff0 0%, #ccffe0 100%);
    border-color: #38ef7d;
    box-shadow: 0 2px 8px rgba(56, 239, 125, 0.25);
}

.wdm-free-shipping-progress.qualified .wdm-progress-bar {
    background: #c8f7dc;
}

.wdm-free-shipping-progress.qualified .wdm-progress-fill {
    background: linear-gradient(90deg, #11998e 0%, #38ef7d 100%);
}

.wdm-free-shipping-progress.qualified .wdm-progress-text {
    color: #1a6b4c;
}

.wdm-free-shipping-progress.qualified .wdm-progress-text strong {
    color: #0d7a54;
}

.wdm-free-shipping-progress.qualified .wdm-progress-icon {
    color: #11998e;
}

/* WoodMart drawer cart specific */
.wd-cart-widget .wdm-free-shipping-progress,
.cart-widget-side .wdm-free-shipping-progress {
    margin: 10px 15px;
    padding: 12px 14px;
}

.wd-cart-widget .wdm-progress-text,
.cart-widget-side .wdm-progress-text {
    font-size: 13px;
}

/* Mini cart widget */
.widget_shopping_cart .wdm-free-shipping-progress {
    margin: 10px 0;
}

/* Cart page */
.woocommerce-cart .wdm-free-shipping-progress {
    max-width: 600px;
    margin: 0 auto 20px;
}

/* RTL Support */
[dir="rtl"] .wdm-progress-icon {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .wdm-progress-fill::after {
    animation-name: wdm-progress-shine-rtl;
}

@keyframes wdm-progress-shine-rtl {
    0% {
        right: -100%;
        left: auto;
    }
    100% {
        right: 100%;
        left: auto;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .wdm-free-shipping-progress {
        padding: 12px 14px;
        border-radius: 8px;
    }

    .wdm-progress-bar {
        height: 10px;
    }

    .wdm-progress-text {
        font-size: 13px;
    }

    .wdm-progress-icon {
        font-size: 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wdm-free-shipping-progress {
        background: linear-gradient(135deg, #3d3529 0%, #4a3f2e 100%);
        border-color: #b37f1a;
    }

    .wdm-progress-bar {
        background: #2d2820;
    }

    .wdm-progress-text {
        color: #f0e6d6;
    }

    .wdm-progress-text strong {
        color: #ffb84d;
    }

    .wdm-free-shipping-progress.qualified {
        background: linear-gradient(135deg, #1a3d2e 0%, #2d4a3d 100%);
        border-color: #38ef7d;
    }

    .wdm-free-shipping-progress.qualified .wdm-progress-bar {
        background: #1a3d2e;
    }

    .wdm-free-shipping-progress.qualified .wdm-progress-text {
        color: #c8f7dc;
    }

    .wdm-free-shipping-progress.qualified .wdm-progress-text strong {
        color: #6fff9e;
    }
}

/* ========================================
   Catalog Discount Badge Styles
   ======================================== */

/* Percentage badge shown next to prices */
.wdm-catalog-discount-badge {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    vertical-align: middle;
    margin-left: 6px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .wdm-catalog-discount-badge {
        font-size: 10px;
        padding: 1px 6px;
        margin-left: 4px;
    }
}

/* RTL Support */
[dir="rtl"] .wdm-catalog-discount-badge {
    margin-left: 0;
    margin-right: 6px;
}

/* ========================================
   Progressive Quantity Discount message
   ======================================== */
.wdm-reward-bar:empty { display: none; }

/* ---- Reward ticket ---- */
.wdm-pm {
    --wdm-green: #1b8a5a;
    --wdm-green-deep: #136b46;
    --wdm-ink: #1f2d27;
    --wdm-muted: #5d7269;

    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0 0 24px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    color: var(--wdm-ink);
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 1px 2px rgba(19, 71, 48, 0.05),
                0 10px 28px -8px rgba(19, 71, 48, 0.18);
    animation: wdm-rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Tinted left stub holding the icon */
.wdm-pm__main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 auto;
    padding: 18px 20px;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(27, 138, 90, 0.10) 0%, rgba(27, 138, 90, 0) 60%),
        #ffffff;
}

.wdm-pm__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    font-size: 22px;
    border-radius: 50%;
    background: linear-gradient(150deg, #2bb673 0%, var(--wdm-green) 55%, var(--wdm-green-deep) 100%);
    box-shadow: 0 0 0 6px rgba(27, 138, 90, 0.10),
                0 6px 14px -4px rgba(27, 138, 90, 0.5);
}

.wdm-pm__copy {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    flex: 1 1 auto;
}

.wdm-pm__title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.1px;
    color: var(--wdm-ink);
}

.wdm-pm__sub {
    font-size: 13px;
    color: var(--wdm-muted);
}

.wdm-pm__title strong,
.wdm-pm__sub strong { font-weight: 800; color: var(--wdm-green-deep); }

/* Progress rail */
.wdm-pm__track {
    position: relative;
    height: 7px;
    margin-top: 4px;
    border-radius: 999px;
    background: #e8efe9;
    overflow: hidden;
}

.wdm-pm__fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #2bb673, var(--wdm-green));
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.wdm-pm__fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: translateX(-100%);
    animation: wdm-shimmer 2.4s ease-in-out infinite;
}

/* Perforated reward stub */
.wdm-pm__reward {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 22px;
    background: linear-gradient(160deg, #f3faf6 0%, #e7f4ec 100%);
    border-left: 2px dashed rgba(27, 138, 90, 0.35);
}

/* Notches that cut the perforation line */
.wdm-pm__reward::before,
.wdm-pm__reward::after {
    content: "";
    position: absolute;
    left: -7px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(19, 71, 48, 0.06);
}
.wdm-pm__reward::before { top: -7px; }
.wdm-pm__reward::after  { bottom: -7px; }

.wdm-pm__reward-pct {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    color: var(--wdm-green-deep);
}

.wdm-pm__reward-label {
    margin-top: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--wdm-muted);
}

/* Unlocked state: solid celebratory stub */
.wdm-pm--unlocked .wdm-pm__reward {
    background: linear-gradient(160deg, #2bb673 0%, var(--wdm-green) 60%, var(--wdm-green-deep) 100%);
    border-left-color: rgba(255, 255, 255, 0.5);
}
.wdm-pm--unlocked .wdm-pm__reward-pct   { color: #fff; }
.wdm-pm--unlocked .wdm-pm__reward-label { color: rgba(255, 255, 255, 0.85); }
.wdm-pm--unlocked .wdm-pm__icon {
    box-shadow: 0 0 0 6px rgba(27, 138, 90, 0.16),
                0 6px 16px -3px rgba(27, 138, 90, 0.6);
}

@keyframes wdm-rise {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes wdm-shimmer {
    0%   { transform: translateX(-100%); }
    60%, 100% { transform: translateX(100%); }
}

/* RTL */
[dir="rtl"] .wdm-pm__fill { inset: 0 0 0 auto; }
[dir="rtl"] .wdm-pm__reward { border-left: 0; border-right: 2px dashed rgba(27, 138, 90, 0.35); }
[dir="rtl"] .wdm-pm__reward::before,
[dir="rtl"] .wdm-pm__reward::after { left: auto; right: -7px; }

/* Small screens: stack the reward under the message */
@media (max-width: 600px) {
    .wdm-pm { flex-direction: column; }
    .wdm-pm__reward {
        flex-direction: row;
        gap: 8px;
        border-left: 0;
        border-top: 2px dashed rgba(27, 138, 90, 0.35);
    }
    .wdm-pm__reward::before { top: -7px; left: -7px; }
    .wdm-pm__reward::after  { top: -7px; left: auto; right: -7px; bottom: auto; }
    .wdm-pm__reward-label { margin-top: 0; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .wdm-pm { animation: none; }
    .wdm-pm__fill { transition: none; }
    .wdm-pm__fill::after { animation: none; display: none; }
}

/* Per-line progressive discount badge (cart & checkout) */
.wdm-progressive-wrap {
    position: relative;
    display: inline-block;
    padding-top: 16px;
}

.wdm-progressive-prices {
    display: inline-block;
}

.wdm-progressive-saved {
    display: block;
    margin-top: 4px;
    color: #e53935;
    font-size: 12px;
    font-weight: 600;
}

.wdm-progressive-badge {
    position: absolute;
    top: -2px;
    right: 0;
    z-index: 2;
    display: inline-block;
    background: #e53935;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    transform: rotate(-8deg);
    box-shadow: 0 2px 5px rgba(229, 57, 53, 0.4);
}

[dir="rtl"] .wdm-progressive-badge {
    right: auto;
    left: 0;
    transform: rotate(8deg);
}
