/* CSS chung */
.wc-coupons-grid,
.wc-coupons-list {
    box-sizing: border-box;
}

.coupon-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 9;
}

.coupon-info {
    z-index: 10;
}
.coupon-footer {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.coupon-info {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 10;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.wc-coupons-grid *,
.wc-coupons-list *,
.wc-coupons-grid *::before,
.wc-coupons-grid *::after,
.wc-coupons-list *::before,
.wc-coupons-list *::after {
    box-sizing: border-box;
}

/* Style grid layout */
.wc-coupons-grid {
    display: flex
;
    flex-wrap: wrap;
    margin: 0 -12px;
    flex-direction: row;
    justify-content: space-between;
}
.wc-coupons-grid .coupon-column {
    width: 50%;
    padding: 12px;
}

@media (max-width: 1199px) {
    .wc-coupons-grid .coupon-column {
        width: 33.333%;
    }
}

@media (max-width: 991px) {
    .wc-coupons-grid .coupon-column {
        width: 41.6667%;
    }
}

@media (max-width: 767px) {
    .wc-coupons-grid .coupon-column {
        width: 100%;
    }
    
    .wc-coupons-grid {
        flex-wrap: nowrap;
        overflow-x: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .wc-coupons-grid::-webkit-scrollbar {
        display: none;
    }
}

/* Style coupon item */
.coupon-item {
    position: relative;
    filter: drop-shadow(0px 0px 3px rgba(0, 0, 0, 0.15));
    display: flex;
    min-height: 120px;
    border-radius: 5px;
    min-height: 100px;
    margin: 10px auto;
}

.coupon-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: -3px;
    height: 100%;
    width: 10px;
    color: var(--coupon-code-background, #f8f9fa);
    background-clip: padding-box;
    background: #8b7046;
    border-radius: 12px 0 0 12px;
}

.coupon-icon {
    flex: 0 0 96px;
    padding: 8px 4px 8px 8px;
    background-color: var(--coupon-code-background, #f8f9fa);
    margin-left: 3px;
    border-radius: 0 12px 12px 0px;
    position: relative;
}

.coupon-icon img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 59.37px;
    max-height: 100%;
    width: auto;
    height: auto;
}

.coupon-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 27px 10px 12px;
    background: #fff;
    border-radius: 12px;
    position: relative;
    width: 100%;
}

.coupon-body::before {
    content: "";
    height: calc(50% - 1px);
    border-left: 2px dashed #BEB1BB;
    width: 2px;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.coupon-head {
    padding-bottom: 10px;
}

.coupon-title {
    font-size: 13.5px;
    line-height: 1.2;
    color: var(--coupon-title-color, #212529);
    font-weight: 700;
    margin-bottom: 0px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 168px;
    margin-top: 0;
}

.coupon-desc b{
    font-weight: bold;
}

.coupon-desc {
    font-size: 12px;
    line-height: 1.2;
    color: #828282;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    height: 32px;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
}

.coupon-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.coupon-code {
    font-size: 12px;
    margin-bottom: 5px;
}

.coupon-date {
    font-size: 12px;
}

.coupon-date p {
    margin-bottom: 0;
    color: #828282;
    font-size: 12px;
}

.coupon-date.has-min-height {
    min-height: 1.25rem;
}

.coupon-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-top: 10px;
}

.coupon-info-toggle {
    font-size: 12px;
    text-decoration: underline;
    color: var(--coupon-button-color, #007bff);
    cursor: pointer;
    border-radius: 100%;
    border: 2.5px solid;
    line-height: 1.2rem;
    width: 24px;
    height: 24px;
    text-align: center;
    margin-bottom: 3px;
    position: absolute;
    top: 0;
    right: 12px;
}

.info-icon {
    display: inline-block;
}

.coupon-info-toggle.text {
    display: none;
    border-radius: 0;
    width: unset;
    height: unset;
    border: none;
    position: static;
}

.coupon-info {
    display: none;
    font-size: 12px;
    color: #828282;
    margin-top: 5px;
}

.coupon-copy {
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: #8b7046;
    color: #fff;
    border: none;
    padding: 2px 15px;
    border-radius: 27.5273px;
    margin-bottom: 3px;
    outline: none !important;
    box-shadow: none;
    font-size: 12px;
}

.coupon-copy:hover {
    filter: brightness(1.08);
}

.coupon-copy span {
    display: block;
    line-height: 24px;
    height: 24px;
    font-size: 12px;
}

.outdated-img {
    position: absolute;
    bottom: 12px;
    right: 12px;
    max-width: 58px;
    height: auto;
}

/* Style list layout */
.wc-coupons-list {
    margin-bottom: 30px;
}

.coupon-list-item {
    padding: 15px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.coupon-list-image {
    margin-right: 20px;
}

.coupon-list-image img {
    max-width: 60px;
    height: auto;
}

.coupon-list-content {
    flex: 1;
}

.coupon-list-title {
    font-size: 18px;
    margin-bottom: 5px;
    margin-top: 0;
}

.coupon-list-description {
    margin-bottom: 5px;
    color: #666;
}

.coupon-list-code {
    margin-bottom: 5px;
}

.coupon-list-expiry {
    font-size: 12px;
    color: #999;
}

.coupon-list-expiry.expired {
    color: #dc3545;
}

.coupon-expired-label {
    color: #dc3545;
    font-weight: bold;
}

.coupon-list-actions {
    margin-left: 20px;
    position: relative;
    min-width: 140px;
}

.coupon-list-actions .coupon-copy {
    min-width: 140px;
}

/* Custom Popover styles */
.wc-coupon-custom-popover {
    position: absolute;
    background: #fff;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 6px;
    max-width: 276px;
    text-align: left;
    z-index: 1060;
    box-shadow: 0 5px 10px rgba(0,0,0,.2);
}

.wc-coupon-popover-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.wc-coupon-custom-popover[data-placement="top"] .wc-coupon-popover-arrow {
    bottom: -10px;
    left: 50%;
    margin-left: -10px;
    border-width: 10px 10px 0;
    border-color: #fff transparent transparent;
}

.wc-coupon-custom-popover[data-placement="bottom"] .wc-coupon-popover-arrow {
    top: -10px;
    left: 50%;
    margin-left: -10px;
    border-width: 0 10px 10px;
    border-color: transparent transparent #fff;
}

.wc-coupon-custom-popover[data-placement="left"] .wc-coupon-popover-arrow {
    right: -10px;
    top: 50%;
    margin-top: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent #fff;
}

.wc-coupon-custom-popover[data-placement="right"] .wc-coupon-popover-arrow {
    left: -10px;
    top: 50%;
    margin-top: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent #fff transparent transparent;
}

.wc-coupon-popover-inner {
    padding: 10px;
}

.wc-coupon-popover-title {
    margin: 0;
    padding: 0 0 8px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.wc-coupon-popover-content {
    padding: 9px 0 0;
}

.coupon-code-line {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.coupon-code-line .title {
    display: inline-block;
    width: 40px;
    font-weight: bold;
}

.coupon-code-line .content {
    margin: 0 5px;
    font-weight: bold;
}

.popover-trigger {
    cursor: pointer;
    margin-left: 5px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .coupon-info-toggle {
        display: none;
    }
    
    .coupon-info-toggle.text {
        display: block;
    }
    
    .coupon-footer {
        flex-direction: row;
        align-items: baseline;
    }
}

@media (max-width: 767px) {
    .coupon-body {
        padding: 10px;
    }
    
    .coupon-footer {
        align-items: baseline;
        margin-top: 0;
    }
    
    .coupon-item {
        margin: 4px auto;
    }
}

@media (max-width: 480px) {
    .coupon-icon {
        flex: 0 0 80px;
    }
    
    .coupon-title {
        width: 140px;
    }
}