.creaworld-coupon-system {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.creaworld-coupon-system h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #333;
}

.coupon-list {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 15px;
    margin-bottom: 30px;
    padding: 10px 5px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.coupon-list::-webkit-scrollbar {
    height: 6px;
}

.coupon-list::-webkit-scrollbar-track {
    background: transparent;
}

.coupon-list::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 3px;
}

.coupon-list::-webkit-scrollbar-thumb:hover {
    background-color: #bbb;
}

/* Coupon List Container */
.coupon-list-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* Scroll Buttons */
.coupon-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.coupon-list-container:hover .coupon-scroll-btn {
    opacity: 1;
    visibility: visible;
}

.coupon-scroll-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.coupon-scroll-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.scroll-left {
    left: -20px;
}

.scroll-right {
    right: -20px;
}

@media (max-width: 768px) {
    .coupon-scroll-btn {
        width: 36px;
        height: 36px;
    }
    
    .scroll-left {
        left: -15px;
    }
    
    .scroll-right {
        right: -15px;
    }
}

.coupon-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    flex: 0 0 calc(50% - 10px);
    min-width: 300px;
    max-width: 400px;
}

@media (max-width: 768px) {
    .coupon-item {
        flex: 0 0 calc(50% - 7.5px);
        min-width: 280px;
    }
}

@media (max-width: 480px) {
    .coupon-item {
        flex: 0 0 85%;
        min-width: 260px;
    }
}

.coupon-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.coupon-item.applied {
    border-color: #4CAF50;
    background-color: #f8fff8;
}

.coupon-item.expired {
    opacity: 0.6;
    pointer-events: none;
}

.coupon-item.collected {
    border-color: #2196F3;
    background-color: #f8faff;
}

.coupon-item.recommended {
    border-color: #FF9800;
    background: linear-gradient(135deg, #fff8e1 0%, #ffe0b2 100%);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
    position: relative;
}

.coupon-item.recommended::before {
    content: "★ Recommended";
    position: absolute;
    top: -12px;
    left: 12px;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
    z-index: 1;
}

.coupon-item.invalid {
    filter: grayscale(100%);
    opacity: 0.7;
    pointer-events: none;
}

.coupon-item.invalid .coupon-actions .button {
    background-color: #ccc !important;
    cursor: not-allowed;
}

.coupon-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.coupon-code {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.coupon-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
}

.coupon-status.applied {
    background-color: #4CAF50;
    color: white;
}

.coupon-status.expired {
    background-color: #f44336;
    color: white;
}

.coupon-status.collected {
    background-color: #2196F3;
    color: white;
}

.coupon-details {
    margin-bottom: 15px;
}

.coupon-description {
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.coupon-amount {
    font-size: 1.3em;
    font-weight: bold;
    color: #E91E63;
    margin: 0 0 10px 0;
}

.coupon-expiry {
    font-size: 0.9em;
    color: #999;
    margin: 0;
}

.coupon-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.coupon-actions .button {
    flex: 1;
    min-width: 100px;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.coupon-actions .button.apply-coupon {
    background-color: #4CAF50;
    color: white;
}

.coupon-actions .button.apply-coupon:hover {
    background-color: #45a049;
}

.coupon-actions .button.collect-coupon {
    background-color: #2196F3;
    color: white;
}

.coupon-actions .button.collect-coupon:hover {
    background-color: #0b7dda;
}

.coupon-actions .button.remove-coupon {
    background-color: #f44336;
    color: white;
}

.coupon-actions .button.remove-coupon:hover {
    background-color: #da190b;
}

.no-coupons {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1em;
}

/* Cart and Checkout Page Styles */
.creaworld-collected-coupons-wrapper {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.creaworld-collected-coupons-wrapper h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .coupon-list {
        grid-template-columns: 1fr;
    }

    .coupon-actions {
        flex-direction: column;
    }

    .coupon-actions .button {
        width: 100%;
    }
}

/* Loading State */
.coupon-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.coupon-item.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error Messages */
.creaworld-coupon-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: none;
}

.creaworld-coupon-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.creaworld-coupon-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Coupon Info Icon */
.coupon-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 8px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.coupon-info-icon:hover {
    color: #2196F3;
}

.coupon-info-icon svg {
    width: 16px;
    height: 16px;
}

/* Coupon Conditions Tooltip */
.coupon-conditions-tooltip {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    min-width: 200px;
}

.coupon-conditions-list {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.coupon-conditions-list li {
    margin-bottom: 6px;
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

.coupon-conditions-list li:last-child {
    margin-bottom: 0;
}

/* Remove Collection Icon Button */
.remove-collection-coupon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-collection-coupon:hover {
    background: #ffebee;
    border-color: #f44336;
    color: #f44336;
}

.remove-collection-coupon svg {
    width: 16px;
    height: 16px;
}

/* Checkout loading overlay */
.creaworld-coupons-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.85);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.creaworld-coupons-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #FF9800;
    border-radius: 50%;
    animation: creaworld-spin 1s linear infinite;
}

@keyframes creaworld-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.creaworld-checkout-coupons.checkout-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.creaworld-checkout-coupons.checkout-loading .coupon-actions .button {
    pointer-events: none;
    opacity: 0.5;
}
