/**
 * 优惠券模块样式 - 全新设计
 * QiMeng Theme - Coupon Module
 */


.qm-coupon-container {
    width: 100%;
    overflow: hidden;
}


@media (max-width: 640px) {
    .qm-coupon-container--home {
        display: none;
    }
}

.qm-coupon-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(13.63rem, 1fr));
    gap: 2.5rem 1.5rem;
    padding: 0.75rem 0;
    align-items: start;
    width: 100%;
    justify-items: center;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .qm-coupon-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        justify-items: center;
    }
}

@media (min-width: 1024px) {
    .qm-coupon-grid {
        
        grid-template-columns: repeat(4, minmax(13.63rem, 1fr));
    }
}


.qm-coupon-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 13.63rem;
    height: 12.46rem;
    min-height: 12.46rem;
    font-family: 'AlibabaPuHuiTi', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Microsoft YaHei', sans-serif;
    margin-bottom: 1.5rem;
    box-sizing: border-box;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .qm-coupon-card {
        margin-bottom: 1.25rem;
    }
}

@media (max-width: 640px) {
    .qm-coupon-card {
        width: 100%;
        max-width: 13.63rem;
        margin: 0 auto 1rem;
    }
}


.qm-coupon-card__bg {
    position: absolute;
    top: 67px !important;
    left: 0;
    right: 0;
    height: 8.56rem;
    background-image: linear-gradient(298.4deg, #27272f 9%, #38353c 98.2%);
    border-radius: 0.63rem;
    z-index: 1;
    width: 100%;
    max-width: 13.63rem;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}


.qm-coupon-card__main {
    position: absolute;
    top: 0 !important;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 !important;
    margin: 0 !important;
    filter: drop-shadow(-0.019rem -0.019rem 0.0063rem #fff6f2);
    background-image: url('../images/82dc148857388da2ca4cb7c3ccea7220.png') !important;
    background-size: 100% 100% !important;
    background-position: 0px -15px !important;
    background-origin: padding-box !important;
    background-clip: padding-box !important;
    background-repeat: no-repeat !important;
    width: 89.8%;
    max-width: 12.25rem;
    height: 12.46rem;
    z-index: 2;
    box-sizing: border-box;
}

.qm-coupon-card__content {
    position: absolute;
    left: 0.69rem;
    right: 0.69rem;
    top: 0 !important;
    bottom: 0;
    margin: 0 !important;
    margin-left: 0.25rem !important;
    margin-right: 0.25rem !important;
    padding: 1.38rem 2.63rem 6.5rem;
    filter: drop-shadow(0.019rem 0.019rem 0.0031rem #fff6f2);
    background-image: url('../images/20443c018cd791e5f4bc5843c2a8a68d.png');
    background-size: 100% 100%;
    background-position: top center !important;
    background-origin: border-box !important;
    background-repeat: no-repeat;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-height: 100%;
}


.qm-coupon-card__title {
    margin-left: 0.75rem;
    line-height: 0.93rem;
    font-size: 1rem;
    color: transparent;
    background-image: linear-gradient(90deg, #646578 8.5%, #2c2c4d 92.6%);
    -webkit-background-clip: text;
    background-clip: text;
    font-weight: 500;
}


.qm-coupon-card__amount-wrapper {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    gap: 0.13rem;
    width: 100%;
}

.qm-coupon-card__amount {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    color: transparent;
    font-size: 4rem;
    font-family: 'AlibabaPuHuiTi', sans-serif;
    font-weight: 700;
    line-height: 3.6rem;
    background-image: linear-gradient(90deg, #646578 8.5%, #2c2c4d 92.6%);
    -webkit-background-clip: text;
    background-clip: text;
    overflow: visible;
}


.qm-coupon-card__currency-wrapper {
    position: relative;
    padding: 0.25rem 0;
    background-image: linear-gradient(312.6deg, #f3c3ad 26.6%, #fdf1eb 96.7%);
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}


.qm-coupon-card__condition-text {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    font-family: 'AlibabaPuHuiTi', sans-serif;
    line-height: 1.2;
    color: #646578 !important;
    font-weight: 500;
    width: 100%;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10;
    position: relative;
}

.qm-coupon-card__currency {
    font-size: 1rem;
    font-family: 'AlibabaPuHuiTi', sans-serif;
    line-height: 0.87rem;
    color: transparent;
    background-image: linear-gradient(90deg, #646578 8.5%, #2c2c4d 92.6%);
    -webkit-background-clip: text;
    background-clip: text;
}


.qm-coupon-card__footer {
    position: absolute;
    left: 0;
    right: 0;
    top: 7.33rem;
    padding-top: 0.88rem;
    background-image: url('../images/85bfce409eab2e064fe1a9770aaa5885.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    width: 100%;
    max-width: 13.63rem;
    height: 5.13rem;
    z-index: 3;
    box-sizing: border-box;
    border-radius: 0 0 0.63rem 0.63rem;
    overflow: hidden;
}

.qm-coupon-card__button-area {
    padding: 1.5rem 0 1.25rem;
    filter: drop-shadow(-0.13rem -0.69rem 0.63rem rgba(25, 25, 38, 0.2));
    background-image: url('../images/7975ad3160fe8a4231483dbcc0e76d3a.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    width: 100%;
    max-width: 13.63rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
    border-radius: 0 0 0.63rem 0.63rem;
    overflow: hidden;
}


.qm-coupon-card__action {
    padding: 0.38rem 0;
    background-image: linear-gradient(283.1deg, #f1b095 27.1%, #fdf1eb 99.6%);
    border-radius: 13.56rem;
    filter: drop-shadow(0.019rem 0.019rem 0rem #ffebeb);
    width: 6.44rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qm-coupon-card__action:hover {
    transform: scale(1.05);
    filter: drop-shadow(0.025rem 0.025rem 0.1rem #ffebeb);
}

.qm-coupon-card__action:active {
    transform: scale(0.98);
}

.qm-coupon-card__action-text {
    line-height: 0.92rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: transparent;
    background-image: linear-gradient(273.1deg, #18181f 3.4%, #33333e 48.9%, #1c1b21 87.6%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0.019rem 0.019rem 0rem #ffebeb;
}


.qm-coupon-card__condition {
    position: absolute;
    right: 0;
    bottom: 4.74rem;
    padding-right: 3.68rem;
    font-size: 1rem;
    font-family: 'AlibabaPuHuiTi', sans-serif;
    line-height: 0.91rem;
    color: transparent;
    background-image: linear-gradient(90deg, #646578 8.5%, #2c2c4d 92.6%);
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0.031rem 0.031rem 0rem #ffebeb;
    z-index: 4;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .qm-coupon-card__condition {
        font-size: 0.875rem;
        padding-right: 1rem;
    }
}


.qm-coupon-card--claimed .qm-coupon-card__action {
    background-image: linear-gradient(283.1deg, #9ca3af 27.1%, #d1d5db 99.6%) !important;
    cursor: default;
}

.qm-coupon-card--claimed .qm-coupon-card__action:hover {
    transform: none !important;
    background-image: linear-gradient(283.1deg, #9ca3af 27.1%, #d1d5db 99.6%) !important;
}

.qm-coupon-card--claimed .qm-coupon-card__action-text {
    background-image: linear-gradient(273.1deg, #6b7280 3.4%, #9ca3af 48.9%, #6b7280 87.6%) !important;
}


.qm-coupon-card--expired {
    opacity: 0.6;
    filter: grayscale(0.3);
}

.qm-coupon-card--expired .qm-coupon-card__bg {
    background-image: linear-gradient(298.4deg, #4b5563 9%, #6b7280 98.2%);
}

.qm-coupon-card--expired .qm-coupon-card__action {
    background-image: linear-gradient(283.1deg, #9ca3af 27.1%, #d1d5db 99.6%);
    cursor: not-allowed;
}

.qm-coupon-card--expired .qm-coupon-card__action:hover {
    transform: none;
}


.qm-coupon-card__badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.125rem 0.375rem;
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #fff;
    font-size: 0.5625rem;
    font-weight: 600;
    border-radius: 0.1875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(250, 112, 154, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 10;
}


.qm-coupon-card__hot {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    right: auto;
    padding: 0.125rem 0.5rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 0.5625rem;
    font-weight: 700;
    border-radius: 0.1875rem;
    text-transform: uppercase;
    box-shadow: 
        0 2px 8px rgba(239, 68, 68, 0.4),
        0 4px 12px rgba(239, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: pulse 2s infinite;
    z-index: 10;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}


.qm-coupon-card__stock-warning {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.125rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 0.25rem;
    box-shadow: 
        0 2px 8px rgba(239, 68, 68, 0.4),
        0 4px 12px rgba(239, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 15;
    animation: stockPulse 2s ease-in-out infinite;
    transform-origin: center;
}

.qm-coupon-card__stock-text {
    font-size: 0.5625rem;
    opacity: 0.95;
}

.qm-coupon-card__stock-number {
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    animation: stockNumberBounce 1.5s ease-in-out infinite;
}

@keyframes stockPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 2px 8px rgba(239, 68, 68, 0.4),
            0 4px 12px rgba(239, 68, 68, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 
            0 4px 12px rgba(239, 68, 68, 0.5),
            0 6px 16px rgba(239, 68, 68, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

@keyframes stockNumberBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}


.qm-coupon-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.qm-coupon-empty__icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 9999px;
}

.qm-coupon-empty__icon i {
    font-size: 2rem;
    color: #9ca3af;
}

.qm-coupon-empty__text {
    color: #6b7280;
    font-size: 0.875rem;
}


.qm-coupon-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
}

.qm-coupon-loading i {
    font-size: 2rem;
    color: #9ca3af;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}


.dark .qm-coupon-card__bg {
    background-image: linear-gradient(298.4deg, #1f2937 9%, #374151 98.2%);
}

.dark .qm-coupon-empty {
    background: #1f2937;
}

.dark .qm-coupon-empty__icon {
    background: #374151;
}

.dark .qm-coupon-empty__text {
    color: #9ca3af;
}

/* 夜间模式适配 - 优惠券模块标题 */
.dark .qm-coupon-container h2.h5,
.dark .qm-coupon-container h2 {
    color: #f9fafb !important;
}

.dark .qm-coupon-container .text-muted {
    color: #9ca3af !important;
}

.dark .qm-coupon-card__condition-text {
    color: #646578 !important;
}


.qm-coupon-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.qm-coupon-modal.active {
    display: flex;
}

.qm-coupon-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.qm-coupon-modal__container {
    position: relative;
    background: #fff;
    border-radius: 1rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.qm-coupon-modal__header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qm-coupon-modal__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.qm-coupon-modal__close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f3f4f6;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

.qm-coupon-modal__close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.qm-coupon-modal__body {
    padding: 1.5rem;
}

.qm-coupon-modal__footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
}

.dark .qm-coupon-modal__container {
    background: #1f2937;
}

.dark .qm-coupon-modal__header {
    border-bottom-color: #374151;
}

.dark .qm-coupon-modal__title {
    color: #f3f4f6;
}

.dark .qm-coupon-modal__close {
    background: #374151;
    color: #9ca3af;
}

.dark .qm-coupon-modal__close:hover {
    background: #4b5563;
    color: #f3f4f6;
}

.dark .qm-coupon-modal__footer {
    border-top-color: #374151;
    color: #6b7280;
}
