
/* Floating Button */
.cwc-modern-btn {
    position: fixed; bottom: 24px; right: 24px; background: #e11d48; color: #fff;
    padding: 14px 24px; border-radius: 50px; cursor: pointer; box-shadow: 0 10px 15px -3px rgba(225, 29, 72, 0.3);
    z-index: 9999; font-weight: 600; font-family: sans-serif; transition: transform 0.2s, background 0.2s;
}
.cwc-modern-btn:hover { transform: translateY(-2px); background: #be123c; }

/* Modal & Overlay */
.cwc-modern-modal {
    display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(15, 23, 42, 0.6); align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.cwc-modal-content {
    background-color: #f8fafc; border-radius: 20px; width: 90%; max-width: 550px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); overflow: hidden;
    animation: cwcModalSlideIn 0.3s ease-out forwards;
}
@keyframes cwcModalSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modal Header */
.cwc-modal-header {
    background: #ffffff; padding: 20px 24px; border-bottom: 1px solid #e2e8f0;
    display: flex; justify-content: space-between; align-items: center;
}
.cwc-modal-header h2 { margin: 0; font-size: 20px; font-weight: 700; color: #0f172a; }
.cwc-close { font-size: 28px; cursor: pointer; color: #94a3b8; transition: color 0.2s; line-height: 1;}
.cwc-close:hover { color: #ef4444; }

/* List Area */
.cwc-coupon-list { padding: 24px; max-height: 60vh; overflow-y: auto; }
.cwc-coupon-list::-webkit-scrollbar { width: 6px; }
.cwc-coupon-list::-webkit-scrollbar-track { background: #f1f5f9; }
.cwc-coupon-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* Modern Card Layout */
.cwc-modern-card {
    display: flex; background: #ffffff; border-radius: 12px; margin-bottom: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); border: 1px solid #e2e8f0; overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.cwc-modern-card:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }

/* Card Left (Ticket Edge) */
.cwc-card-left {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    color: #ffffff; 
    padding: 20px; width: 35%; display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center; border-right: 2px dashed #fda4af;
    position: relative;
}
.cwc-discount-title { 
    font-size: 24px; 
    font-weight: 800; 
    line-height: 1.2; 
    margin-bottom: 8px;
    color: #ffffff !important; 
}
.cwc-discount-title *,
.cwc-discount-title span,
.cwc-discount-title .woocommerce-Price-amount, 
.cwc-discount-title .woocommerce-Price-currencySymbol { 
    color: #ffffff !important; 
    font-size: 28px;
}
.cwc-coupon-code-badge { background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 6px; font-size: 13px; font-family: monospace; letter-spacing: 1px;}

/* Card Right (Details) */
.cwc-card-right { padding: 20px; width: 65%; display: flex; flex-direction: column; justify-content: space-between; }
.cwc-description { margin: 0 0 12px 0; color: #475569; font-size: 14px; line-height: 1.5; }
.cwc-expiry { margin: 0 0 16px 0; color: #f59e0b; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px;}

/* Buttons inside Popup */
.cwc-btn { padding: 10px 16px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; transition: all 0.2s; text-align: center; font-size: 14px; font-family: inherit;}
.cwc-btn-primary { background: #0f172a; color: #ffffff; }
.cwc-btn-primary:hover { background: #1e293b; box-shadow: 0 4px 6px rgba(15, 23, 42, 0.2); }
.cwc-btn-disabled { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; border: 1px solid #e2e8f0;}

/* Cart Integration Styles - Adjusted for Sidebar */
.cwc-cart-coupons-wrapper { 
    margin-top: 20px; margin-bottom: 20px; padding: 20px; 
    background: #ffffff; border: 1px solid #e2e8f0; border-radius: 8px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.cwc-cart-coupon-item {
    display: flex; justify-content: space-between; align-items: center; padding: 12px;
    border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 12px; background: #f8fafc;
    transition: border-color 0.2s;
    flex-wrap: wrap; gap: 10px; /* ยอมให้ปุ่มปัดตกบรรทัดใหม่ถ้าพื้นที่แคบ */
}
.cwc-cart-coupon-item:hover { border-color: #cbd5e1; }
.cwc-cart-coupon-item.cwc-applied { border-color: #10b981; background: #ecfdf5; }

.cwc-btn-cart { padding: 8px 12px; border-radius: 6px; border: none; font-weight: 600; cursor: pointer; font-size: 12px; font-family: inherit; transition: background 0.2s;}
.cwc-btn-cart-use { background: #0f172a; color: #fff; }
.cwc-btn-cart-use:hover { background: #334155; }
.cwc-btn-cart-applied { background: #dcfce7; color: #166534; cursor: not-allowed; }

/* Responsive */
@media (max-width: 480px) {
    .cwc-modern-card { flex-direction: column; }
    .cwc-card-left { width: 100%; border-right: none; border-bottom: 2px dashed #fda4af; padding: 16px; }
    .cwc-card-right { width: 100%; }
}
