.ec-coupons-wrap {
    font-family: inherit;
    margin: 20px 0;
    width: 100%;
}

.ec-no-coupons {
    color: #8c8c8c;
    font-size: 14px;
    font-style: italic;
}

/* ── General Card Design ────────────────────────────────── */
.ec-coupon-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    /* border-radius: 0px; */
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ec-coupon-card:hover {
    border-color: color-mix(in srgb, var(--ec-card-hover-color, #6366f1) 50%, transparent) !important;
}

/* Header Styles */
.ec-coupon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ec-coupon-discount {
    font-size: 16px;
    font-weight: 700;
    color: var(--ec-discount-color, #4f46e5);
}

.ec-coupon-code {
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    /* border-radius: 6px; */
    padding: 2px 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--ec-code-color, #1f2937);
    letter-spacing: 0.5px;
    text-transform: uppercase !important;
}

/* Description Styles */
.ec-coupon-description {
    font-size: 13px;
    color: #4b5563;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

/* Footer Styles */
.ec-coupon-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid #f3f4f6;
    padding-top: 10px;
}

.ec-coupon-expiry {
    font-size: 11px;
    color: #9ca3af;
}

/* Action buttons */
.ec-coupon-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.ec-coupons-wrap button.ec-apply-btn,
button.ec-apply-btn {
    font-family: 'Outfit', sans-serif !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    padding: 5px 10px !important;
    border-radius: 0px !important;
    border: 1px solid transparent !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    background: var(--ec-apply-bg, #4f46e5) !important;
    color: var(--ec-apply-color, #ffffff) !important;
    text-shadow: none !important;
    box-shadow: none !important;
    text-transform: none !important;
    line-height: 1.4 !important;
    display: inline-block !important;
    height: auto !important;
    min-height: 0 !important;
}

.ec-coupons-wrap button.ec-apply-btn:hover,
button.ec-apply-btn:hover {
    opacity: 0.9 !important;
    background: var(--ec-apply-bg, #4f46e5) !important;
    color: var(--ec-apply-color, #ffffff) !important;
}

.ec-coupons-wrap button.ec-apply-btn:hover:not(:disabled):not(.applied):not(.blocked),
button.ec-apply-btn:hover:not(:disabled):not(.applied):not(.blocked) {
    transform: scale(1.1) !important;
}

.ec-coupons-wrap button.ec-apply-btn.applied,
button.ec-apply-btn.applied {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #fff !important;
    cursor: default !important;
}

.ec-coupon-card-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ── Grid Layout specific styles ────────────────────────── */
.ec-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.ec-layout-grid .ec-coupon-card-wrapper {
    margin-bottom: 0;
}

/* ── Custom AJAX notices ───────────────────────────────── */
.ec-notice {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
    animation: slideDown 0.3s ease;
}

.ec-notice--error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* Ensure WooCommerce error notices injected via AJAX have proper error styling */
.woocommerce-error {
    background: #fee2e2 !important;
    border: 1px solid #fca5a5 !important;
    border-left: 4px solid #ef4444 !important;
    color: #991b1b !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    list-style: none !important;
    margin: 0 0 20px 0 !important;
}

.woocommerce-error li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ec-notice--info {
    background: #e0e7ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
}

.ec-coupon-card-error {
    color: #dc2626;
    font-size: 12px;
    margin-top: 6px;
    margin-bottom: 12px;
    text-align: left;
    line-height: 1.4;
    animation: slideDown 0.25s ease;
}

/* Disabled and blocked coupon apply buttons */
.ec-coupons-wrap button.ec-apply-btn:disabled:not(.applied),
.ec-coupons-wrap button.ec-apply-btn.blocked,
button.ec-apply-btn:disabled:not(.applied),
button.ec-apply-btn.blocked {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* Coupon restrictions list */
.ec-coupon-restrictions {
    margin-bottom: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ec-restriction-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.2;
}

.ec-restriction-item .dashicons {
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
    line-height: 14px !important;
    color: #9ca3af !important;
}

.ec-restriction-text {
    font-weight: 400;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Checkout Table Row ──────────────────────────────────── */
.ec-checkout-coupons-row td {
    padding: 15px 0 !important;
    border: none !important;
    text-align: left !important;
    /* Force left align inside checkout tables */
}

/* ── Sidebar Trigger Button ────────────────────────────── */
.ec-sidebar-trigger-container {
    margin: 15px 0 !important;
    display: inline-block !important;
    text-align: left !important;
    width: 100% !important;
}

.ec-sidebar-trigger-btn {
    font-family: 'Outfit', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ec-apply-bg, #4f46e5) !important;
    text-decoration: none !important;
    /* Remove underline */
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: color 0.2s ease, transform 0.2s ease !important;
    border-bottom: none !important;
    /* Remove border underline */
    padding-bottom: 0 !important;
}

.ec-sidebar-trigger-btn:hover {
    color: #1f2937 !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

.ec-sidebar-trigger-btn:hover .ec-trigger-text {
    text-decoration: underline !important;
}

.ec-sidebar-trigger-btn .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    line-height: 18px !important;
    display: inline-block !important;
    text-decoration: none !important;
}

/* ── Sidebar Drawer & Overlay ───────────────────────────── */
.ec-coupon-sidebar-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
    z-index: 999998 !important;
}

.ec-coupon-sidebar-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
}

.ec-coupon-sidebar-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 420px !important;
    max-width: 100% !important;
    height: 100% !important;
    background: #ffffff !important;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15) !important;
    transform: translateX(100%) !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

.ec-coupon-sidebar-drawer.open {
    transform: translateX(0) !important;
}

.ec-sidebar-header {
    padding: 20px 24px !important;
    border-bottom: 1px solid #f3f4f6 !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-sizing: border-box !important;
    height: 70px !important;
    min-height: 70px !important;
    width: 100% !important;
    background: #ffffff !important;
}

.ec-sidebar-header h3 {
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.2 !important;
    border: none !important;
    text-align: left !important;
}

.ec-sidebar-close-btn {
    border: none !important;
    background: transparent !important;
    font-size: 28px !important;
    font-weight: 300 !important;
    color: #9ca3af !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    display: inline-block !important;
    box-shadow: none !important;
    transition: color 0.2s ease !important;
}

.ec-sidebar-close-btn:hover {
    color: #ff0000 !important;
}

.ec-sidebar-body {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 24px !important;
    box-sizing: border-box !important;
}

.ec-sidebar-body .ec-coupons-wrap {
    margin: 0 !important;
}

/* ── Mobile Responsive ─────────────────────────────────── */
@media (max-width: 782px) {
    .ec-coupon-sidebar-drawer {
        width: 100% !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
    }
}

/* ── Near-Valid Coupons Styles ──────────────────────────── */
.ec-coupon-card--near-valid {
    border-style: dashed !important;
    border-color: rgba(217, 119, 6, 0.4) !important;
    background: rgba(255, 251, 235, 0.4) !important;
}

.ec-coupon-card--near-valid .ec-coupon-footer {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.ec-coupon-card--near-valid .ec-coupon-hint {
    flex: 1 !important;
    margin-right: 16px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    text-align: left !important;
}

.ec-coupon-card--near-valid .ec-coupon-actions {
    flex-shrink: 0 !important;
    margin-left: auto !important;
}

.ec-coupon-card--near-valid .ec-apply-btn {
    white-space: nowrap !important;
}

.ec-coupon-hint {
    font-size: 11px;
    color: #d97706;
    font-weight: 500;
    line-height: 1.4;
}