/* IT Store Campaign Manager - Red & White theme (design only) */

:root {
    --itscm-red: #e11d2e;
    --itscm-red-dark: #b3121f;
    --itscm-red-soft: #fff1f2;
    --itscm-red-line: #fecdd3;
    --itscm-text: #1f1f1f;
    --itscm-muted: #6b7280;
    --itscm-white: #ffffff;
}

/* ---------- Offer listing page ---------- */
.itscm-campaign-wrapper {
    max-width: 1280px;
    margin: 40px auto;
    padding: 20px;
}

.itscm-heading {
    text-align: center;
    margin-bottom: 34px;
}

.itscm-heading h2 {
    display: inline-block;
    position: relative;
    font-size: 34px;
    font-weight: 800;
    color: var(--itscm-red);
    margin: 0 0 12px;
    padding-bottom: 12px;
    letter-spacing: .3px;
}

.itscm-heading h2::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 70px;
    height: 4px;
    border-radius: 4px;
    background: var(--itscm-red);
    transform: translateX(-50%);
}

.itscm-heading p {
    color: var(--itscm-muted);
    margin: 0;
}

.itscm-campaign-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
}

.itscm-campaign-card {
    position: relative;
    background: var(--itscm-white);
    border: 1px solid var(--itscm-red-line);
    border-top: 4px solid var(--itscm-red);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 22px rgba(225, 29, 46, .08);
    transition: transform .25s ease, box-shadow .25s ease;
}

.itscm-campaign-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(225, 29, 46, .18);
}

.itscm-banner-link img,
.itscm-details-banner img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.itscm-banner-link img {
    aspect-ratio: 16 / 8;
}

.itscm-card-content {
    padding: 22px;
    text-align: center;
}

.itscm-card-content h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--itscm-text);
    margin: 0 0 14px;
}

.itscm-countdown-label,
.itscm-details-header h4 {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--itscm-red);
    background: var(--itscm-red-soft);
    border-radius: 999px;
    padding: 5px 14px;
    margin: 0 0 10px;
}

/* ---------- Countdown ---------- */
.itscm-countdown {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 12px 0 22px;
}

.itscm-countdown div {
    background: var(--itscm-red);
    border-radius: 10px;
    padding: 10px 8px;
    min-width: 76px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(225, 29, 46, .25);
}

.itscm-countdown strong {
    display: block;
    font-size: 22px;
    line-height: 1.2;
    color: var(--itscm-white);
}

.itscm-countdown small {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: rgba(255, 255, 255, .85);
}

/* ---------- Buttons ---------- */
.itscm-view-button,
.itscm-add-cart,
.itscm-offer-button {
    display: inline-block;
    padding: 12px 26px;
    background: var(--itscm-red);
    color: var(--itscm-white) !important;
    border: 2px solid var(--itscm-red);
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .15s ease;
}

.itscm-view-button:hover,
.itscm-add-cart:hover,
.itscm-offer-button:hover {
    background: var(--itscm-white);
    color: var(--itscm-red) !important;
    transform: translateY(-1px);
}

.itscm-offer-button {
    padding: 8px 18px;
    border-radius: 999px;
}

.itscm-add-cart[disabled],
.itscm-add-cart:disabled {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #9ca3af !important;
    cursor: not-allowed;
    transform: none;
}

/* ---------- Campaign detail page ---------- */
.itscm-details {
    max-width: 1280px;
    margin: 30px auto;
    padding: 20px;
}

.itscm-details-banner img {
    border-radius: 14px;
    max-height: 450px;
    border: 3px solid var(--itscm-red);
}

.itscm-details-header {
    text-align: center;
    margin: 30px 0;
}

.itscm-details-header h1 {
    color: var(--itscm-red);
    font-weight: 800;
    margin-bottom: 10px;
}

.itscm-description {
    color: var(--itscm-muted);
    max-width: 760px;
    margin: 0 auto 18px;
}

.itscm-stock-badge {
    display: inline-block;
    background: var(--itscm-red-soft);
    color: var(--itscm-red-dark);
    border: 1px solid var(--itscm-red-line);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin: 8px 0;
}

/* ---------- Product cards ---------- */
.itscm-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.itscm-product-card {
    position: relative;
    padding: 15px;
    background: var(--itscm-white);
    border: 1px solid var(--itscm-red-line);
    border-radius: 12px;
    text-align: center;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.itscm-product-card:hover {
    transform: translateY(-4px);
    border-color: var(--itscm-red);
    box-shadow: 0 10px 24px rgba(225, 29, 46, .15);
}

.itscm-product-card img {
    width: 100%;
    height: 190px;
    object-fit: contain;
}

.itscm-product-card h3 {
    font-size: 15px;
    font-weight: 600;
    min-height: 42px;
}

.itscm-product-card h3 a {
    color: var(--itscm-text);
    text-decoration: none;
}

.itscm-product-card h3 a:hover {
    color: var(--itscm-red);
}

.itscm-product-prices {
    margin: 15px 0;
}

.itscm-product-prices del {
    display: block;
    color: #9ca3af;
    font-size: 13px;
}

.itscm-product-prices strong {
    color: var(--itscm-red);
    font-size: 21px;
    font-weight: 800;
}

.itscm-product-card .itscm-add-cart {
    display: block;
}

.itscm-expired,
.itscm-empty {
    text-align: center;
    padding: 40px 15px;
    color: var(--itscm-red-dark);
    background: var(--itscm-red-soft);
    border: 1px dashed var(--itscm-red-line);
    border-radius: 12px;
}

/* ---------- Mobile ---------- */
@media (max-width: 1024px) {
    .itscm-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {

    .itscm-campaign-grid {
        grid-template-columns: 1fr;
    }

    .itscm-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .itscm-campaign-wrapper,
    .itscm-details {
        padding: 12px;
    }

    .itscm-heading h2 {
        font-size: 26px;
    }

    .itscm-card-content {
        padding: 15px;
    }

    .itscm-countdown {
        gap: 5px;
    }

    .itscm-countdown div {
        min-width: 48px;
        padding: 8px 5px;
    }

    .itscm-countdown strong {
        font-size: 18px;
    }

    .itscm-product-card {
        padding: 10px;
    }

    .itscm-product-card img {
        height: 130px;
    }

    .itscm-add-cart,
    .itscm-view-button {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Clean campaign page template */
.itscm-campaign-page {
    display: block;
    width: 100%;
    max-width: 100%;
    float: none;
    padding-top: 10px;
    padding-bottom: 40px;
}

.itscm-campaign-page .itscm-details,
.itscm-campaign-page .itscm-campaign-wrapper {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.itscm-campaign-page .itscm-countdown-label,
.itscm-campaign-page .itscm-details-header h4 {
    white-space: nowrap;
}

.itscm-campaign-page .itscm-details-banner img {
    width: 100%;
    height: auto;
}


/* ---------- v1.1: poster + hover original photo, badge, stock progress ---------- */
.itscm-img-wrap {
    position: relative;
}

.itscm-img-wrap.has-poster > a {
    display: block;
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
}

.itscm-product-card .itscm-img-wrap.has-poster img.itscm-img-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.itscm-img-original-box {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    opacity: 0;
    transition: opacity .3s ease;
}

.itscm-product-card .itscm-img-original-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.itscm-product-card:hover .itscm-img-original-box {
    opacity: 1;
}

.itscm-discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    background: var(--itscm-red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 999px;
    pointer-events: none;
}

.itscm-stock-info {
    margin: 0 0 12px;
    text-align: left;
}

.itscm-stock-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 13px;
    color: var(--itscm-muted);
}

.itscm-stock-row strong {
    color: var(--itscm-text);
}

.itscm-progress {
    height: 5px;
    margin-top: 6px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
}

.itscm-progress span {
    display: block;
    height: 100%;
    background: var(--itscm-red);
    border-radius: 5px;
}

@media (max-width: 767px) {
    .itscm-stock-row { font-size: 11px; flex-wrap: wrap; }
    .itscm-discount-badge { font-size: 11px; padding: 5px 8px; }
}

/* v1.1.1: slow subtle zoom on the hover (original) image */
.itscm-img-original-box {
    transition: opacity .5s ease;
}

.itscm-product-card .itscm-img-original-box img {
    transform: scale(1);
    transition: transform 1.2s cubic-bezier(.2, .6, .2, 1);
    will-change: transform;
}

.itscm-product-card:hover .itscm-img-original-box img {
    transform: scale(1.1);
}

.itscm-product-card .itscm-img-wrap.has-poster img.itscm-img-poster {
    transition: transform 1.2s cubic-bezier(.2, .6, .2, 1);
}

.itscm-product-card:hover .itscm-img-wrap.has-poster img.itscm-img-poster {
    transform: scale(1.04);
}

/* ---------- v1.2: Countdown redesign (dark glass + subtle accent) ---------- */
.itscm-countdown {
    gap: 14px;
    align-items: stretch;
}

.itscm-countdown div {
    position: relative;
    min-width: 84px;
    padding: 14px 10px 10px;
    border-radius: 14px;
    background: linear-gradient(160deg, #23243a 0%, #14151f 100%);
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 8px 22px rgba(20, 21, 31, .28), inset 0 1px 0 rgba(255, 255, 255, .08);
    overflow: hidden;
}

/* thin accent line on top */
.itscm-countdown div::before {
    content: "";
    position: absolute;
    top: 0;
    left: 18%;
    right: 18%;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, #ff6a3d, #e11d2e);
}

/* soft shine sweeping across the box */
.itscm-countdown div::after {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .10), transparent);
    transform: skewX(-20deg);
    animation: itscm-shine 5s ease-in-out infinite;
}

.itscm-countdown div:nth-child(2)::after { animation-delay: .4s; }
.itscm-countdown div:nth-child(3)::after { animation-delay: .8s; }
.itscm-countdown div:nth-child(4)::after { animation-delay: 1.2s; }

.itscm-countdown strong {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 0 14px rgba(255, 106, 61, .35);
}

.itscm-countdown small {
    margin-top: 2px;
    font-size: 10px;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, .6);
}

/* digit change animation (class added by JS) */
.itscm-countdown strong.itscm-tick {
    animation: itscm-tick .45s ease;
}

/* seconds box gently pulses */
.itscm-countdown div:last-child {
    animation: itscm-pulse 1s ease-in-out infinite;
}

/* last hour: seconds box glows red to create urgency */
.itscm-countdown.itscm-urgent div:last-child {
    border-color: rgba(225, 29, 46, .7);
    box-shadow: 0 0 0 0 rgba(225, 29, 46, .6), 0 8px 22px rgba(20, 21, 31, .28);
    animation: itscm-urgent 1s ease-out infinite;
}

@keyframes itscm-tick {
    0%   { transform: translateY(-40%); opacity: 0; }
    60%  { transform: translateY(6%);   opacity: 1; }
    100% { transform: translateY(0);    opacity: 1; }
}

@keyframes itscm-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}

@keyframes itscm-urgent {
    0%   { box-shadow: 0 0 0 0 rgba(225, 29, 46, .55), 0 8px 22px rgba(20, 21, 31, .28); }
    100% { box-shadow: 0 0 0 14px rgba(225, 29, 46, 0), 0 8px 22px rgba(20, 21, 31, .28); }
}

@keyframes itscm-shine {
    0%, 60% { left: -80%; }
    100%    { left: 160%; }
}

/* "Offer Ends In" label: calmer look */
.itscm-countdown-label,
.itscm-details-header h4 {
    color: #14151f;
    background: #f1f2f6;
    letter-spacing: 1.2px;
}

.itscm-countdown-label::before,
.itscm-details-header h4::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: #e11d2e;
    animation: itscm-blink 1.2s ease-in-out infinite;
}

@keyframes itscm-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: .25; }
}

@media (max-width: 767px) {
    .itscm-countdown { gap: 7px; }
    .itscm-countdown div { min-width: 56px; padding: 10px 6px 8px; border-radius: 10px; }
    .itscm-countdown strong { font-size: 20px; }
    .itscm-countdown small { font-size: 8px; letter-spacing: .6px; }
}

@media (prefers-reduced-motion: reduce) {
    .itscm-countdown div,
    .itscm-countdown div::after,
    .itscm-countdown strong.itscm-tick,
    .itscm-countdown-label::before,
    .itscm-details-header h4::before { animation: none !important; }
}
