/* Account Coupon Page Styles */
.nexrule-coupons-page {
    padding: 20px 0;
}

.page-title-wrapper {
    margin-bottom: 14px;
}

.coupon-tabs-wrapper {
    border: 1px solid #e3e3e3;
    padding: 24px;
    margin-top: 14px;
}

/* Account page coupon list styles */
.nexrule-coupons-page .coupon-list-container {
    margin-top: 20px;
}

.nexrule-coupons-page .coupon-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(328px, 1fr));
    gap: 16px;
    justify-content: flex-start;
}

.coupon-tabs ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
    border-bottom: 1px solid #e3e3e3;
    align-items: center;
}

.coupon-tabs li {
    position: relative;
    padding: 5px 0;
    margin: 5px 25px -1px;
    font-size: 14px;
    font-weight: normal;
    letter-spacing: 0;
    color: #999;
    text-align: center;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.coupon-tabs li.active {
    font-weight: 500;
    color: #1979c3;
    border-bottom-color: #ff6900;
}

.coupon-tabs li:hover {
    color: #1979c3;
}

.coupon-tabs li:not(:last-of-type)::after {
    position: absolute;
    top: 7px;
    right: -25px;
    display: block;
    width: 1px;
    height: 14px;
    background: rgba(0, 0, 0, 0.08);
    content: '';
}

.coupon-tab-content {
    display: none;
}

.coupon-tab-content.active {
    display: block;
}

.coupon-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.coupon-item {
    border: 1px solid #e3e3e3;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    position: relative;
    transition: box-shadow 0.3s;
}

.coupon-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.coupon-item.expired,
.coupon-item.used {
    opacity: 0.6;
}

.coupon-item__header {
    background: linear-gradient(135deg, #1979c3 0%, #004488 100%);
    color: #fff;
    padding: 20px;
    text-align: center;
}

.coupon-item__header.exclusive {
    background: linear-gradient(135deg, #ff6900 0%, #cc5200 100%);
}

.coupon-price {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
}

.coupon-price .symbol {
    font-size: 20px;
}

.coupon-item__header p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
}

.coupon-item__content {
    padding: 16px 20px;
}

.coupon-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.coupon-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.5;
}

.coupon-details {
    font-size: 12px;
    color: #999;
    border-top: 1px dashed #e3e3e3;
    padding-top: 12px;
    margin-top: 12px;
}

.coupon-details span {
    display: block;
    margin-bottom: 5px;
}

.coupon-details span:last-child {
    margin-bottom: 0;
}

.coupon-code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #333;
    margin-top: 8px;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

.coupon__empty {
    padding: 45px 0 40px;
    font-size: 14px;
    text-align: center;
    color: #999;
}

/* Checkout Coupon Section */
.nexrule-coupon-section {
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.coupon-section-header h3 {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 16px;
    color: #333;
}

/* Tabs Styles */
.coupon-tabs-wrapper {
    margin-top: 16px;
}

.nexperia-tabs {
    position: relative;
}

.nexperia-tabs-nav {
    position: relative;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 24px;
}

.nexperia-tabs-nav-list {
    position: relative;
    display: flex;
    align-items: center;
}

.nexperia-tabs-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 12px 0;
    margin: 0 16px;
    cursor: pointer;
    transition: color 0.3s;
}

.nexperia-tabs-tab:first-child {
    margin-left: 0;
}

.nexperia-tabs-tab-btn {
    font-size: 16px;
    color: #666;
    transition: color 0.3s;
}

.nexperia-tabs-tab:hover .nexperia-tabs-tab-btn {
    color: #333;
}

.nexperia-tabs-tab-active .nexperia-tabs-tab-btn {
    color: rgb(3, 111, 123);
    font-weight: 500;
}

.nexperia-tabs-ink-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: rgb(3, 111, 123);
    transform: translateX(-50%);
    transition: left 0.3s ease, width 0.3s ease;
    pointer-events: none;
}

.nexperia-tabs-content-holder {
    position: relative;
}

.nexperia-tabs-tabpane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.nexperia-tabs-tabpane-active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Coupon List */
.coupon-list-container {
    margin-top: 20px;
}

.coupon-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 328px);
    gap: 16px;
    justify-content: flex-start;
}

.coupon-card {
    position: relative;
    display: flex;
    background: rgba(3, 111, 123, 0.1);
    border: 1px solid rgba(3, 111, 123, 0.2);
    border-radius: 8px;
    overflow: visible;
    transition: box-shadow 0.3s;
    min-height: 90px;
    width: 328px;
}

.coupon-card:hover {
    box-shadow: 0 2px 8px rgba(3, 111, 123, 0.15);
}

.coupon-card.unavailable {
    opacity: 0.5;
}

.coupon-card.exclusive .discount {
    background: rgb(3, 111, 123);
}

.coupon-card .discount {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100px;
    background: rgb(3, 111, 123);
    color: #fff;
    padding: 12px 10px;
    text-align: center;
}

/* 锯齿状边缘效果 */
.coupon-card .discount::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 0;
    bottom: 0;
    width: 10px;
    background: 
        radial-gradient(circle at 0 0, transparent 5px, rgb(3, 111, 123) 5px) 0 0 / 10px 10px,
        radial-gradient(circle at 0 10px, transparent 5px, rgb(3, 111, 123) 5px) 0 5px / 10px 10px;
    background-repeat: repeat-y;
}

.coupon-card .discount p {
    margin: 0 0 5px 0;
    line-height: 1;
}

.coupon-card .discount .amount {
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
}

.coupon-card .discount .unit {
    font-size: 16px;
    font-weight: 500;
    margin-left: 3px;
}

.coupon-card .discount .rule {
    font-size: 11px;
    opacity: 0.9;
    white-space: nowrap;
}

.coupon-card .description {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-left: 10px;
    min-width: 0;
}

.coupon-card .information {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
}

.coupon-card .information h5 {
    font-size: 13px;
    font-weight: 500;
    color: rgb(3, 111, 123);
    margin: 0 0 6px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coupon-card .information .date {
    font-size: 11px;
    color: #666;
    margin: 0;
}

.coupon-card .coupon-checkbox {
    display: flex;
    align-items: center;
    margin-left: 12px;
}


/* Checkbox Styles */
.nexperia-checkbox-wrapper {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.nexperia-checkbox {
    position: relative;
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
    outline: none;
    cursor: pointer;
}

.nexperia-checkbox-input {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    cursor: pointer;
    opacity: 0;
}

.nexperia-checkbox-inner {
    position: relative;
    display: block;
    width: 18px;
    height: 18px;
    border: 1px solid #d9d9d9;
    border-radius: 3px;
    background-color: #fff;
    transition: all 0.3s;
}

.nexperia-checkbox-input:checked + .nexperia-checkbox-inner {
    background-color: rgb(3, 111, 123);
    border-color: rgb(3, 111, 123);
}

.nexperia-checkbox-input:checked + .nexperia-checkbox-inner::after {
    position: absolute;
    top: 50%;
    left: 50%;
    display: table;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: translate(-50%, -60%) rotate(45deg);
    opacity: 1;
    transition: all 0.2s cubic-bezier(0.12, 0.4, 0.29, 1.46) 0.1s;
    content: '';
}

.nexperia-checkbox-input:disabled + .nexperia-checkbox-inner {
    background-color: #f5f5f5;
    border-color: #d9d9d9;
    cursor: not-allowed;
}


/* Empty State */
.coupon-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Promotion Code Input Section */
.coupon-input-section {
    margin-top: 16px;
}

.coupon-input-section label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: #666;
}

.coupon-input-wrapper {
    display: flex;
    gap: 8px;
}

.coupon-code-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    font-size: 14px;
}

.coupon-code-input:focus {
    border-color: rgb(3, 111, 123);
    outline: none;
    box-shadow: 0 0 0 2px rgba(3, 111, 123, 0.1);
}

.coupon-code-input:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.action.apply-coupon,
.action.remove-coupon {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.action.apply-coupon {
    background: rgb(3, 111, 123);
    color: #fff;
}

.action.apply-coupon:hover {
    background: rgb(2, 89, 99);
}

.action.remove-coupon {
    background: #f5f5f5;
    color: #666;
}

.action.remove-coupon:hover {
    background: #e3e3e3;
}

/* Messages */
.coupon-messages {
    margin-top: 16px;
}

.coupon-messages .message {
    padding: 12px 16px 12px 45px;
    border-radius: 4px;
    font-size: 14px;
}

.coupon-messages .message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.coupon-messages .message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .coupon-list {
        grid-template-columns: 1fr;
        justify-content: center;
    }
    
    .coupon-card {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .coupon-card {
        flex-direction: column;
        width: 100%;
    }
    
    .coupon-card .discount {
        width: unset;
        flex-direction: row;
        justify-content: space-between;
        padding: 16px;
    }
    
    .coupon-card .discount::after {
        display: none;
    }
    
    .coupon-card .discount p {
        margin: 0;
    }
    
    .coupon-card .description {
        padding: 16px;
    }
}

/* Hide cart page discount block in order summary */
.checkout-cart-index .cart-summary #block-discount,
.checkout-cart-index .cart-summary .block.discount {
    display: none;
}

