/* =============================================================================
   K-Tech Coupons Component (Mã Khuyến Mãi)
   File: assets/css/builder/ktech-coupons.css
   ============================================================================= */

:root {
    --ktech-cp-primary: #ff4d4f;
    --ktech-cp-primary-hover: #e02828;
    --ktech-cp-btn-red: #e50014;
    --ktech-cp-card-bg: #ffffff;
    --ktech-cp-gap: 12px;
}

/* ---- Main Wrapper ---- */
.ktech-coupons-wrap {
    position: relative;
    width: 100%;
    /*     margin-bottom: 20px; */
    box-sizing: border-box;
}

.ktech-coupons-header-title {
    margin-bottom: 12px;
}

.ktech-coupons-header-title h3 {
    font-size: 18px;
    font-weight: 700;
    color: #222222;
    margin: 0;
    text-transform: uppercase;
}

.ktech-coupons-slider-container {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* ---- Coupon Card ---- */
.ktech-coupon-card {
    display: flex;
    width: 100%;
    height: 100px;
    background: var(--ktech-cp-card-bg, #ffffff);
    border: 1px solid #ededed;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.ktech-coupon-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.09);
}

/* ---- Left Stub (Perforated Red Ticket) ---- */
.ktech-coupon-left {
    width: 78px;
    min-width: 78px;
    background: var(--primary-color);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 6px 8px 10px;
    box-sizing: border-box;
    overflow: hidden;
    user-select: none;
}

/* Scalloped cut / perforated stamp effect */
.ktech-coupon-scallop-edge {
    position: absolute;
    left: -4px;
    top: 0;
    bottom: 0;
    width: 8px;
    background-image: radial-gradient(circle at 0px 6px, #ffffff 3.5px, transparent 4px);
    background-size: 8px 12px;
    background-repeat: repeat-y;
    z-index: 2;
}

.ktech-coupon-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.ktech-coupon-icon {
    max-width: 80px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
    transition: transform 0.2s ease;
}

.ktech-coupon-card:hover .ktech-coupon-icon {
    transform: scale(1.06) rotate(-2deg);
}

/* ---- Right Content ---- */
.ktech-coupon-right {
    flex: 1;
    min-width: 0;
    padding: 9px 12px 9px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.ktech-coupon-header {
    margin-bottom: 2px;
}

.ktech-coupon-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    line-height: 1.25;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.1px;
}

.ktech-coupon-desc {
    font-size: 11.5px;
    color: #555555;
    line-height: 1.35;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 31px;
}

.ktech-coupon-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
}

.ktech-coupon-btn-copy {
    /* background-color: var(--ktech-cp-btn-red, #e50014); */
    background-color: var(--primary-color);
    color: #ffffff !important;
    border: none;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 14px;
    line-height: 1.4;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.ktech-coupon-btn-copy:hover {
    background-color: #c40011;
    transform: translateY(-1px);
}

.ktech-coupon-btn-copy:active {
    transform: scale(0.96);
}

.ktech-coupon-btn-copy.is-copied {
    background-color: #10b981 !important;
    color: #ffffff !important;
}

.ktech-coupon-btn-condition {
    color: #1890ff !important;
    font-size: 11.5px;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    background: transparent;
    border: none;
    padding: 0;
    line-height: 1.4;
}

.ktech-coupon-btn-condition:hover {
    color: #096dd9 !important;
    text-decoration: underline;
}

/* ---- Grid Layout ---- */
.ktech-coupons-grid {
    display: grid;
    grid-template-columns: repeat(var(--ktech-cp-cols, 5), 1fr);
    gap: var(--ktech-cp-gap, 12px);
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .ktech-coupons-grid {
        grid-template-columns: repeat(var(--ktech-cp-cols-tab, 3), 1fr);
    }
}

@media (max-width: 767px) {
    .ktech-coupons-grid {
        grid-template-columns: repeat(var(--ktech-cp-cols-mob, 1), 1fr);
    }
}

/* ---- Swiper Slider Navigation ---- */
.ktech-coupons-swiper {
    width: 100%;
    padding: 4px 2px 8px 2px;
    overflow: hidden;
}

.ktech-cp-nav-prev,
.ktech-cp-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 32px;
    height: 32px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444444;
    transition: all 0.2s ease;
    outline: none;
}

.ktech-cp-nav-prev {
    left: -14px;
}

.ktech-cp-nav-next {
    right: -14px;
}

.ktech-cp-nav-prev:hover,
.ktech-cp-nav-next:hover {
    background: #ffffff;
    color: #e50014;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.ktech-cp-nav-prev.swiper-button-disabled,
.ktech-cp-nav-next.swiper-button-disabled {
    opacity: 0;
    pointer-events: none;
}

.ktech-cp-pagination {
    position: relative;
    margin-top: 10px;
    text-align: center;
}

.ktech-cp-pagination .swiper-pagination-bullet {
    background: #cccccc;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.ktech-cp-pagination .swiper-pagination-bullet-active {
    background: #e50014;
    opacity: 1;
    width: 16px;
    border-radius: 4px;
}

/* =============================================================================
   Popup Modal Điều Kiện (Matching Screenshot 2)
   ============================================================================= */

.ktech-coupon-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    box-sizing: border-box;
}

.ktech-coupon-modal.is-active {
    opacity: 1;
    visibility: visible;
}

.ktech-coupon-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.ktech-coupon-modal-dialog {
    position: relative;
    z-index: 2;
    background: #ffffff;
    border-radius: 8px;
    width: 92%;
    max-width: 480px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: scale(0.92);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}

.ktech-coupon-modal.is-active .ktech-coupon-modal-dialog {
    transform: scale(1);
}

/* Modal Header */
.ktech-coupon-modal-header {
    padding: 18px 20px 14px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.ktech-coupon-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #ff2d37;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.ktech-coupon-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 24px;
    line-height: 1;
    color: #888888;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
    outline: none;
}

.ktech-coupon-modal-close:hover {
    color: #ff2d37;
}

/* Modal Body */
.ktech-coupon-modal-body {
    padding: 18px 24px;
    font-size: 14px;
    color: #333333;
    line-height: 1.5;
}

.ktech-coupon-modal-code-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
}

.ktech-modal-label {
    color: #666666;
    width: 140px;
    flex-shrink: 0;
}

.ktech-modal-code-val {
    font-weight: 700;
    color: #222222;
    font-size: 14.5px;
}

.ktech-modal-cond-wrap {
    margin-top: 4px;
}

.ktech-modal-cond-heading {
    font-weight: 600;
    color: #333333;
    margin-bottom: 8px;
}

.ktech-modal-cond-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ktech-modal-cond-list li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 6px;
    font-size: 13.5px;
    line-height: 1.5;
    color: #444444;
}

.ktech-modal-cond-list li::before {
    content: '- ';
    position: absolute;
    left: 0;
    top: 0;
    color: #555555;
}

/* Modal Footer */
.ktech-coupon-modal-footer {
    padding: 12px 24px 20px;
    display: flex;
    gap: 14px;
    box-sizing: border-box;
}

.ktech-coupon-modal-btn-close {
    flex: 1;
    background: #ffffff;
    border: 1px solid #ff4d4f;
    color: #ff4d4f;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    text-align: center;
}

.ktech-coupon-modal-btn-close:hover {
    background: #fff1f0;
}

.ktech-coupon-modal-btn-copy {
    flex: 1;
    background: #e50014;
    border: 1px solid #e50014;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    text-align: center;
}

.ktech-coupon-modal-btn-copy:hover {
    background: #c40011;
    border-color: #c40011;
}

.ktech-coupon-modal-btn-copy.is-copied {
    background: #10b981;
    border-color: #10b981;
}

/* =============================================================================
   Toast Notification
   ============================================================================= */

.ktech-coupon-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
    background: #222222;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 1000000;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    box-sizing: border-box;
}

.ktech-coupon-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ktech-toast-icon {
    width: 18px;
    height: 18px;
    background: #10b981;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Responsive Tweaks */
@media (max-width: 576px) {
    .ktech-cp-nav-prev {
        left: -8px;
    }

    .ktech-cp-nav-next {
        right: -8px;
    }

    .ktech-coupon-modal-dialog {
        width: 95%;
    }

    .ktech-coupon-modal-body {
        padding: 14px 16px;
    }

    .ktech-coupon-modal-footer {
        padding: 10px 16px 16px;
    }
}