/* ================================================================
   Weekly Promotion – Popup Banner (Frontend)
   ================================================================ */

.wct-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.4s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.wct-popup-overlay.wct-popup-visible {
    opacity: 1;
}

.wct-popup-overlay.wct-popup-hiding {
    opacity: 0;
}

/* Container holds dismiss bar + the scrollable banner */
.wct-popup-container {
    position: relative;
    width: min(100%, 560px);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    transform: scale(0.92);
    transition: transform 0.4s ease;
}

.wct-popup-visible .wct-popup-container {
    transform: scale(1);
}

.wct-popup-hiding .wct-popup-container {
    transform: scale(0.92);
}

/* Dismiss bar: sits ABOVE the banner, aligned right */
.wct-popup-dismiss {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 999px;
    padding: 5px 6px 5px 14px;
    color: #fff;
    font-family: Arial, sans-serif;
    margin-bottom: 10px;
    -webkit-tap-highlight-color: transparent;
}

.wct-popup-countdown {
    font-size: 15px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    line-height: 1;
}

.wct-popup-close {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
}

.wct-popup-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Scrollable banner card */
.wct-popup-inner {
    width: 100%;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

/* ─── Flyer ──────────────────────────────────────────────── */

.wct-flyer {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #eef4ef center / cover no-repeat;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    font-family: 'Arial', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
    color: #163123;
}

.wct-top-note {
    position: absolute;
    left: 16px;
    top: 10px;
    font-size: 13px;
    font-weight: 700;
    color: #2e2e2e;
    z-index: 2;
}

/* Header */
.wct-flyer-header {
    position: relative;
    padding: 52px 24px 0px;
    min-height: 100px;
    z-index: 1;
}

.wct-store-badge {
    position: absolute;
    right: 18px;
    top: 18px;
    width: 72px;
    height: 72px;
    background: center / contain no-repeat;
    transform: rotate(1deg);
}

.wct-headline-wrap {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding-top: 4px;
}

.wct-headline {
    display: inline-block;
    padding: 14px 28px 16px;
    border-radius: 22px;
    font-size: 46px;
    line-height: 1;
    font-weight: 900;
    color: #fff7ce;
    background: linear-gradient(180deg, #40c877 0%, #29ac64 56%, #1f8c50 100%);
    text-shadow:
        -3px 0 #1f7f49,
        0 3px #1f7f49,
        3px 0 #1f7f49,
        0 -3px #1f7f49,
        3px 6px 0 rgba(255, 198, 88, 0.95);
    box-shadow: 0 8px 0 rgba(255, 194, 76, 0.9);
    transform: skewX(-4deg);
}

.wct-headline > span {
    display: inline-block;
    transform: skewX(4deg);
}

.wct-period {
    font-size: 15px;
    font-weight: 800;
    color: #202020;
    text-align: center;
}

/* Products grid — 2×2 */
.wct-products-grid {
    position: relative;
    padding: 4px 16px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    z-index: 1;
}

/* Product card */
.wct-product-card {
    --wct-badge-color: #7b54d8;
    --wct-tag-size: 42px;
    position: relative;
    background: rgba(255, 253, 248, 0.96);
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(41, 172, 100, 0.12);
    border: 2px solid rgba(41, 172, 100, 0.14);
    padding: 16px 14px 78px;
    overflow: hidden;
}

.wct-product-name {
    font-size: 14px;
    line-height: 1.2;
    font-weight: 900;
    margin: 0 62px 4px 0;
    color: #1b261d;
}

.wct-product-subtitle {
    font-size: 11px;
    line-height: 1.25;
    font-weight: 700;
    color: #2e3e31;
    margin-bottom: 8px;
    padding-right: 70px;
}

.wct-spec-badge {
    position: absolute;
    right: 12px;
    top: 12px;
    width: var(--wct-tag-size);
    height: var(--wct-tag-size);
    border-radius: 999px;
    display: grid;
    place-items: center;
    text-align: center;
    font-size: 18px;
    line-height: 1;
    font-weight: 900;
    color: #fff7cd;
    background: var(--wct-badge-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
}

.wct-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 5px;
    max-width: 50%;
}

.wct-feature-list li {
    min-height: 24px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f7e47c;
    border-radius: 7px;
    padding: 3px 7px;
    color: #374117;
    font-size: 10px;
    line-height: 1.15;
    font-weight: 800;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.05);
}

.wct-feature-list li::before {
    content: '+';
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #fff6d4;
    color: #e7352c;
    font-size: 11px;
    font-weight: 900;
}

.wct-product-visual {
    position: absolute;
    right: 14px;
    top: 76px;
    width: 42%;
    height: 120px;
    display: grid;
    place-items: center;
}

.wct-product-visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Old price */
.wct-old-price {
    position: absolute;
    z-index: 3;
    left: 14px;
    bottom: 45px;
    font-size: 15px;
    line-height: 1;
    font-weight: 900;
    color: #7f7466;
    white-space: nowrap;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.wct-old-price::after {
    content: '';
    position: absolute;
    left: -6px;
    right: -6px;
    top: 55%;
    height: 2px;
    background: #d84d43;
    border-radius: 999px;
    transform: rotate(-18deg);
    transform-origin: center;
    pointer-events: none;
}

/* Price flag */
.wct-price-flag {
    position: absolute;
    left: 78px;
    bottom: 60px;
    z-index: 2;
    background: #67ac43;
    color: #fff;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: 900;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
}

/* Price row */
.wct-price-row {
    position: absolute;
    left: 14px;
    bottom: 8px;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    max-width: 55%;
    z-index: 2;
}

.wct-price-box {
    display: flex;
    align-items: flex-end;
}

.wct-price-main {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 1px;
    line-height: 1;
    padding-right: 24px;
}

.wct-currency {
    font-size: 26px;
    line-height: 0.9;
    font-weight: 900;
    color: #1f8c50;
    letter-spacing: -1px;
    transform: translateY(-1px);
}

.wct-price {
    font-size: 46px;
    line-height: 0.84;
    letter-spacing: -2px;
    font-weight: 900;
    color: #1f8c50;
    font-style: italic;
    font-family: Arial, 'Arial Black', 'Helvetica Neue', sans-serif;
    transform: skewX(-6deg);
}

.wct-price-unit {
    position: absolute;
    right: 0;
    top: 2px;
    font-size: 13px;
    line-height: 1;
    font-weight: 900;
    color: #1f8c50;
    white-space: nowrap;
}

/* CTA button */
.wct-cta {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 48%;
    height: 54px;
    border: 0;
    border-radius: 18px 0 16px 0;
    background: linear-gradient(180deg, #41c778 0%, #1f8c50 100%);
    color: #fff6b7;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1px;
    box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.16);
    display: grid;
    place-items: center;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.2s;
}

.wct-cta:hover {
    filter: brightness(1.08);
    color: #fff6b7;
    text-decoration: none;
}

/* Footer */
.wct-flyer-footer {
    position: relative;
    padding: 20px 24px 14px;
    min-height: 80px;
    display: grid;
    place-items: end center;
    margin-top: auto;
}

.wct-flyer-footer::before {
    content: '';
    position: absolute;
    inset: 14px 0 0;
    background: linear-gradient(
        180deg,
        rgba(54, 192, 107, 0.18) 0%,
        rgba(41, 172, 100, 0.5) 100%
    );
    z-index: -1;
}

.wct-footer-cta {
    width: 58%;
    min-width: 200px;
    height: 54px;
    border-radius: 999px;
    border: 3px solid rgba(41, 172, 100, 0.75);
    background: rgba(255, 248, 245, 0.88);
    display: grid;
    place-items: center;
    color: #1f8c50;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 8px;
    box-shadow: 0 4px 12px rgba(41, 172, 100, 0.12);
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

/* ─── Responsive: mobile (full-width, 2×2 grid) ──────── */

@media (max-width: 640px) {
    .wct-popup-overlay {
        padding: 0;
        align-items: flex-start;
        justify-content: center;
    }

    .wct-popup-container {
        width: 100vw;
        max-width: none;
        align-items: center;
    }

    .wct-popup-dismiss {
        position: fixed;
        top: 8px;
        right: 8px;
        z-index: 1000000;
        margin-bottom: 0;
        padding: 3px 4px 3px 10px;
        gap: 4px;
    }

    .wct-popup-countdown {
        font-size: 12px;
        min-width: 14px;
    }

    .wct-popup-close {
        width: 28px;
        height: 28px;
        font-size: 17px;
    }

    .wct-popup-inner {
        border-radius: 0;
        max-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wct-flyer {
        border-radius: 0;
    }

    .wct-top-note {
        font-size: 9px;
        left: 10px;
        top: 7px;
    }

    .wct-flyer-header {
        padding: 34px 12px 8px;
        min-height: 80px;
    }

    .wct-headline {
        font-size: 22px;
        padding: 8px 14px 10px;
        border-radius: 14px;
        text-shadow:
            -2px 0 #1f7f49,
            0 2px #1f7f49,
            2px 0 #1f7f49,
            0 -2px #1f7f49,
            2px 3px 0 rgba(255, 198, 88, 0.95);
        box-shadow: 0 5px 0 rgba(255, 194, 76, 0.9);
    }

    .wct-headline-wrap {
        gap: 6px;
    }

    .wct-period {
        font-size: 10px;
    }

    .wct-store-badge {
        width: 38px;
        height: 38px;
        right: 8px;
        top: 8px;
    }

    .wct-products-grid {
        grid-template-columns: 1fr 1fr;
        padding: 2px 6px 8px;
        gap: 6px;
    }

    .wct-product-card {
        --wct-tag-size: 32px;
        min-height: 110px;
        border-radius: 10px;
        padding: 8px 6px 52px;
        border-width: 1.5px;
    }

    .wct-product-name {
        font-size: 9px;
        margin: 0 36px 2px 0;
    }

    .wct-product-subtitle {
        font-size: 7px;
        padding-right: 38px;
        margin-bottom: 3px;
    }

    .wct-spec-badge {
        font-size: 11px;
        right: 4px;
        top: 4px;
    }

    .wct-feature-list {
        gap: 2px;
        max-width: 54%;
    }

    .wct-feature-list li {
        min-height: 14px;
        font-size: 6.5px;
        padding: 2px 3px;
        border-radius: 3px;
        gap: 2px;
    }

    .wct-feature-list li::before {
        flex: 0 0 10px;
        width: 10px;
        height: 10px;
        font-size: 7px;
    }

    .wct-product-visual {
        right: 4px;
        top: 46px;
        width: 42%;
        height: 60px;
    }

    .wct-old-price {
        font-size: 13px;
        left: 6px;
        bottom: 29px;
    }

    .wct-old-price::after {
        height: 1.5px;
        left: -3px;
        right: -3px;
    }

    .wct-price-flag {
        font-size: 7px;
        left: 44px;
        bottom: 40px;
        padding: 2px 5px;
        border-radius: 3px;
    }

    .wct-price-row {
        left: 6px;
        bottom: 2px;
    }

    .wct-price-main {
        padding-right: 14px;
    }

    .wct-currency {
        font-size: 14px;
    }

    .wct-price {
        font-size: 26px;
        letter-spacing: -1px;
    }

    .wct-price-unit {
        font-size: 8px;
    }

    .wct-cta {
        width: 48%;
        height: 32px;
        font-size: 9px;
        border-radius: 10px 0 8px 0;
        letter-spacing: 0;
    }

    .wct-flyer-footer {
        padding: 10px 10px 6px;
        min-height: 44px;
    }

    .wct-flyer-footer::before {
        inset: 6px 0 0;
    }

    .wct-footer-cta {
        width: 68%;
        min-width: 0;
        height: 34px;
        border-width: 2px;
        font-size: 13px;
        letter-spacing: 4px;
    }
}
