/* ===== Smart Coupon Manager ===== */
:root {
    --scm-primary: #e74c3c;
    --scm-secondary: #2c3e50;
    --scm-green: #27ae60;
    --scm-gray: #7f8c8d;
    --scm-light: #f8f9fa;
    --scm-white: #ffffff;
    --scm-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --scm-radius: 12px;
    --scm-transition: all 0.3s ease;
}

.scm-coupons-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}
.scm-coupons-wrapper.scm-col-2 .scm-coupon-card { width: calc(50% - 10px); }
.scm-coupons-wrapper.scm-col-3 .scm-coupon-card { width: calc(33.333% - 14px); }
.scm-coupons-wrapper.scm-col-4 .scm-coupon-card { width: calc(25% - 15px); }
@media (max-width: 768px) {
    .scm-coupons-wrapper.scm-col-2 .scm-coupon-card,
    .scm-coupons-wrapper.scm-col-3 .scm-coupon-card,
    .scm-coupons-wrapper.scm-col-4 .scm-coupon-card { width: 100%; }
}

.scm-coupon-card {
    width: 100%;
    max-width: 100%;
    background: var(--scm-white);
    border-radius: var(--scm-radius);
    box-shadow: var(--scm-shadow);
    overflow: hidden;
    position: relative;
    transition: var(--scm-transition);
    border: 1px solid #e9ecef;
    cursor: pointer;
}
.scm-coupon-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.scm-coupon-inner { padding: 24px; position: relative; }

.scm-badge {
    position: absolute;
    top: -1px;
    right: 20px;
    background: var(--scm-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 0 0 8px 8px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(231,76,60,0.3);
}

.scm-coupon-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    padding-right: 80px;
}
.scm-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--scm-light);
    display: flex;
    align-items: center;
    justify-content: center;
}
.scm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.scm-header-info { flex: 1; min-width: 0; }
.scm-store {
    font-size: 12px;
    color: var(--scm-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.scm-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--scm-secondary);
    margin: 0 0 6px 0;
    line-height: 1.3;
}
.scm-discount {
    display: inline-block;
    background: linear-gradient(135deg, var(--scm-primary), #c0392b);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
}

.scm-description {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 16px;
}

.scm-coupon-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.scm-reveal-btn, .scm-deal-btn {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, var(--scm-primary), #c0392b);
    color: #fff !important;
    text-decoration: none !important;
    border: none;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--scm-transition);
    width: 100%;
}
.scm-reveal-btn:hover, .scm-deal-btn:hover {
    background: linear-gradient(135deg, #c0392b, var(--scm-primary));
    transform: scale(1.02);
}
.scm-deal-btn { background: linear-gradient(135deg, var(--scm-green), #1e8449); }
.scm-deal-btn:hover { background: linear-gradient(135deg, #1e8449, var(--scm-green)); }
.scm-expiry {
    font-size: 12px;
    color: var(--scm-gray);
    text-align: center;
}

@media (min-width: 769px) { .scm-hide-desktop { display: none !important; } }
@media (max-width: 768px) { .scm-hide-mobile { display: none !important; } }

.scm-style-dark { background: var(--scm-secondary); border-color: #34495e; }
.scm-style-dark .scm-title { color: #fff; }
.scm-style-dark .scm-description { color: #bdc3c7; }
.scm-style-dark .scm-store { color: #95a5a6; }

.scm-style-gradient .scm-coupon-header {
    background: linear-gradient(135deg, var(--scm-primary), #8e44ad);
    margin: -24px -24px 16px -24px;
    padding: 20px 24px;
    border-radius: var(--scm-radius) var(--scm-radius) 0 0;
}
.scm-style-gradient .scm-title { color: #fff; }
.scm-style-gradient .scm-store { color: rgba(255,255,255,0.8); }
.scm-style-gradient .scm-discount { background: rgba(255,255,255,0.2); }
.scm-style-gradient .scm-badge { top: 12px; right: 12px; border-radius: 20px; }

.scm-style-minimal {
    box-shadow: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}
.scm-style-minimal .scm-coupon-inner { padding: 18px; }
.scm-style-minimal .scm-badge {
    position: static;
    display: inline-block;
    margin-bottom: 10px;
    border-radius: 4px;
}

/* POPUP */
.scm-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.scm-popup-overlay.scm-active { display: flex; }

.scm-popup {
    background: var(--scm-white);
    border-radius: var(--scm-radius);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: scmPopupIn 0.3s ease;
}
@keyframes scmPopupIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.scm-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--scm-transition);
}
.scm-popup-close:hover { background: #f0f0f0; color: #333; }

.scm-popup-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 28px 20px 28px;
    border-bottom: 1px solid #eee;
}
.scm-popup-thumb {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--scm-light);
}
.scm-popup-thumb img { width: 100%; height: 100%; object-fit: cover; }
.scm-popup-info { flex: 1; }
.scm-popup-store {
    font-size: 12px;
    color: var(--scm-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.scm-popup-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--scm-secondary);
    margin: 4px 0;
    line-height: 1.3;
}
.scm-popup-discount {
    display: inline-block;
    background: linear-gradient(135deg, var(--scm-primary), #c0392b);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.scm-popup-body { padding: 24px 28px 28px 28px; }
.scm-popup-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.scm-popup-code-box {
    display: flex;
    gap: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 2px dashed var(--scm-primary);
    background: #fff5f5;
    margin-bottom: 16px;
}
.scm-popup-code {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 22px;
    font-weight: 700;
    color: var(--scm-secondary);
    letter-spacing: 3px;
    background: #fff;
    padding: 14px;
    word-break: break-all;
}
.scm-popup-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--scm-primary), #c0392b);
    color: #fff;
    border: none;
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--scm-transition);
    white-space: nowrap;
}
.scm-popup-copy:hover { background: linear-gradient(135deg, #c0392b, var(--scm-primary)); }
.scm-popup-copy.scm-copied { background: var(--scm-green) !important; }
.scm-popup-copy.scm-copied::after { content: " ✓"; }

.scm-popup-go {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, var(--scm-green), #1e8449);
    color: #fff !important;
    text-decoration: none !important;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 10px;
    transition: var(--scm-transition);
}
.scm-popup-go:hover {
    background: linear-gradient(135deg, #1e8449, var(--scm-green));
    transform: scale(1.02);
    color: #fff !important;
}

@media (max-width: 480px) {
    .scm-popup { max-width: 100%; }
    .scm-popup-header { padding: 20px 20px 16px 20px; }
    .scm-popup-body { padding: 18px 20px 22px 20px; }
    .scm-popup-code { font-size: 18px; padding: 10px; }
}
