/**
 * GA Promo — Gift Selector Modal Styles
 *
 * @package GA_Promo
 */

/* ── Modal overlay ──────────────────────────── */
.ga-promo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ga-promo-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

body.ga-promo-modal-open {
    overflow: hidden;
}

/* ── Dialog ──────────────────────────────────── */
.ga-promo-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 10px;
    max-width: 860px;
    width: 92%;
    max-height: 82vh;
    overflow-y: auto;
    padding: 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

.ga-promo-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.ga-promo-modal__close:hover {
    background: #f0f0f0;
    color: #333;
}

.ga-promo-modal__step {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #CC2027;
    background: rgba(204, 32, 39, 0.08);
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 4px;
}

.ga-promo-modal__title {
    margin: 0 0 2px;
    font-size: 18px;
    font-weight: 700;
    color: #231F20;
}

.ga-promo-modal__subtitle {
    margin: 0 0 12px;
    color: #888;
    font-size: 13px;
}

/* ── Product grid ────────────────────────────── */
.ga-promo-modal__products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-height: 58vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px;
}

/* List layout */
.ga-promo-modal__products--list {
    grid-template-columns: 1fr;
}

.ga-promo-modal__products--list .ga-promo-gift-card {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.ga-promo-modal__products--list .ga-promo-gift-card__image {
    flex: 0 0 72px;
    margin-bottom: 0;
}

.ga-promo-modal__products--list .ga-promo-gift-card__info {
    flex: 1;
}

.ga-promo-modal__products--list .ga-promo-gift-card__select {
    flex: 0 0 auto;
    width: auto;
    margin-top: 0;
}

/* ── Gift card ───────────────────────────────── */
.ga-promo-gift-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    position: relative;
}

.ga-promo-gift-card:hover {
    border-color: #CC2027;
    box-shadow: 0 4px 14px rgba(204, 32, 39, 0.1);
    transform: translateY(-2px);
}

/* ── Card image ─────────────────────────────── */
.ga-promo-gift-card__image {
    margin-bottom: 6px;
    text-align: center;
    background: #f7f7f7;
    border-radius: 6px;
    padding: 6px;
    position: relative;
}

.ga-promo-gift-card__image img {
    max-width: 100%;
    max-height: 110px;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    mix-blend-mode: multiply;
}

/* Info icon */
.ga-promo-gift-card__detail-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    color: #888;
    font-size: 13px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    font-family: Georgia, serif;
    font-style: italic;
}

.ga-promo-gift-card:hover .ga-promo-gift-card__detail-btn {
    opacity: 1;
}

.ga-promo-gift-card__detail-btn:hover {
    background: #CC2027;
    border-color: #CC2027;
    color: #fff;
}

/* ── Card name ──────────────────────────────── */
.ga-promo-gift-card__name {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 3px;
    color: #231F20;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Card price — override WooCommerce defaults ── */
.ga-promo-gift-card__price {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
}

.ga-promo-gift-card__price del,
.ga-promo-gift-card__price del span,
.ga-promo-gift-card__price del .woocommerce-Price-amount,
.ga-promo-gift-card__price del .woocommerce-Price-currencySymbol,
.ga-promo-gift-card__price del bdi {
    color: #b0b0b0 !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    text-decoration: line-through;
}

.ga-promo-gift-card__price ins,
.ga-promo-gift-card__price ins span,
.ga-promo-gift-card__price ins .woocommerce-Price-amount,
.ga-promo-gift-card__price ins bdi {
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    color: #CC2027 !important;
}

.ga-promo-gift-card__price del {
    margin-right: 5px;
}

/* FREE badge — extra specificity to beat ins color override */
ins.ga-promo-free-label,
.ga-promo-gift-card__price ins.ga-promo-free-label,
.ga-promo-detail__price ins.ga-promo-free-label,
.ga-promo-free-label,
.ga-promo-free-badge {
    display: inline-block;
    background: #CC2027 !important;
    color: #fff !important;
    padding: 2px 8px !important;
    border-radius: 3px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

/* ── Select button (high specificity for WC Blocks) ── */
.ga-promo-modal .ga-promo-gift-card__select,
button.ga-promo-gift-card__select,
.ga-promo-gift-card__select {
    margin-top: auto;
    width: 100% !important;
    text-align: center !important;
    background: #231F20 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background 0.15s;
    line-height: 1.3 !important;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.ga-promo-modal .ga-promo-gift-card__select:hover,
button.ga-promo-gift-card__select:hover,
.ga-promo-gift-card__select:hover {
    background: #CC2027 !important;
    color: #fff !important;
}

.ga-promo-gift-card__select:disabled {
    background: #ccc !important;
    cursor: not-allowed;
}

/* ── Mini PDP detail view ───────────────────── */
.ga-promo-detail-view {
    display: none;
    animation: gaPromoFadeIn 0.2s ease;
    flex-direction: column;
}

.ga-promo-detail-view.is-active {
    display: flex;
    min-height: 0;
}

@keyframes gaPromoFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ga-promo-detail__back {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    padding: 0 0 8px;
    font-weight: 500;
    transition: color 0.15s;
    flex-shrink: 0;
}

.ga-promo-detail__back:hover {
    color: #CC2027;
}

.ga-promo-detail__body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.ga-promo-detail__content {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 20px;
    align-items: start;
}

/* Docked footer CTA */
.ga-promo-detail__footer {
    flex-shrink: 0;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    margin-top: 8px;
    background: #fff;
}

/* ── Detail image ───────────────────────────── */
.ga-promo-detail__image {
    text-align: center;
}

.ga-promo-detail__main-img {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 6px;
}

.ga-promo-detail__main-img img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

/* Gallery thumbnails */
.ga-promo-detail__thumbs {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.ga-promo-detail__thumb {
    width: 36px;
    height: 36px;
    min-width: 36px;
    object-fit: contain;
    border: 2px solid #e8e8e8;
    border-radius: 3px;
    cursor: pointer;
    padding: 1px;
    background: #fafafa;
    transition: border-color 0.15s;
}

.ga-promo-detail__thumb:hover {
    border-color: #999;
}

.ga-promo-detail__thumb.is-active {
    border-color: #CC2027;
}

/* ── Detail info ────────────────────────────── */
.ga-promo-detail__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ga-promo-detail__name {
    font-size: 20px;
    font-weight: 700;
    color: #231F20;
    margin: 0;
    line-height: 1.2;
}

.ga-promo-detail__price {
    font-size: 14px;
    margin: 2px 0 0;
}

.ga-promo-detail__price del,
.ga-promo-detail__price del span,
.ga-promo-detail__price del .woocommerce-Price-amount,
.ga-promo-detail__price del .woocommerce-Price-currencySymbol,
.ga-promo-detail__price del bdi {
    color: #b0b0b0 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    text-decoration: line-through;
}

.ga-promo-detail__price ins,
.ga-promo-detail__price ins span,
.ga-promo-detail__price ins .woocommerce-Price-amount,
.ga-promo-detail__price ins .woocommerce-Price-currencySymbol,
.ga-promo-detail__price ins bdi,
.ga-promo-detail__price .ga-promo-free-label {
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    color: #CC2027 !important;
}

.ga-promo-detail__price .ga-promo-free-label {
    background: #CC2027 !important;
    color: #fff !important;
    padding: 3px 10px !important;
    border-radius: 3px !important;
    font-size: 12px !important;
}

/* Mount application pills */
.ga-promo-mount-apps {
    margin: 8px 0 4px;
}

.ga-promo-mount-apps__label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
    margin: 0 0 5px;
}

.ga-promo-mount-apps__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ga-promo-mount-pill {
    display: inline-block;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #444;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 9px;
    border-radius: 20px;
    line-height: 1.4;
    white-space: nowrap;
}

/* Description section */
.ga-promo-detail__desc-wrap {
    margin-top: 10px;
}

.ga-promo-detail__desc-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #aaa;
    margin: 0 0 4px;
}

.ga-promo-detail__desc {
    font-size: 13px;
    color: #555;
    line-height: 1.55;
}

.ga-promo-detail__desc p {
    margin: 0 0 4px;
}

.ga-promo-detail__desc.ga-promo-desc-collapsed {
    max-height: 2.6em;
    overflow: hidden;
    position: relative;
}

.ga-promo-detail__desc.ga-promo-desc-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1.3em;
    background: linear-gradient(transparent, #fff);
}

.ga-promo-desc-toggle {
    background: none;
    border: none;
    color: #CC2027;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 0;
    transition: color 0.15s;
}

.ga-promo-desc-toggle:hover {
    color: #900000;
}

.ga-promo-detail__meta {
    font-size: 11px;
    color: #aaa;
    margin-top: 6px;
}

.ga-promo-detail__meta span {
    display: inline-block;
    margin-right: 10px;
}

/* ── Detail CTA ─────────────────────────────── */
.ga-promo-detail__footer .ga-promo-detail__cta,
button.ga-promo-detail__cta,
.ga-promo-detail__cta {
    background: #231F20 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background 0.15s;
    width: 100% !important;
    text-align: center !important;
    display: block;
    box-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.3 !important;
}

.ga-promo-detail__cta:hover {
    background: #CC2027 !important;
    color: #fff !important;
}

.ga-promo-detail__cta:disabled {
    background: #ccc !important;
    cursor: not-allowed;
}

/* ── Variation selectors ─────────────────────── */
.ga-promo-variation-field {
    margin-bottom: 6px;
}

.ga-promo-variation-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 3px;
    color: #666;
}

.ga-promo-variation-select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.ga-promo-variation-select.ga-promo-error {
    border-color: #CC2027;
}

/* ── WC Blocks overrides ────────────────────── */
.ga-promo-modal h2,
.ga-promo-modal h3,
.ga-promo-modal p,
.ga-promo-modal button {
    font-family: inherit;
}

.ga-promo-modal .ga-promo-gift-card__name {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #231F20 !important;
    margin: 0 0 3px !important;
}

.ga-promo-modal .ga-promo-modal__title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #231F20 !important;
}

.ga-promo-modal .ga-promo-modal__subtitle {
    font-size: 13px !important;
    color: #888 !important;
}

/* ── Cart badges ─────────────────────────────── */
.ga-promo-item-badge {
    display: inline-block;
    background: #CC2027;
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 6px;
}

/* ── Promo qualification banner ─────────────── */
.ga-promo-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #1a1a1a;
}

/* Pending: red accent, clickable */
.ga-promo-banner--pending {
    background: #fef8f8;
    border: 1px solid #f0d0d1;
    border-left: 4px solid #CC2027;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.ga-promo-banner--pending:hover {
    background: #fdf0f0;
    box-shadow: 0 2px 8px rgba(204, 32, 39, 0.08);
}

/* Applied/fulfilled: green accent with pill badges */
.ga-promo-banner--applied {
    background: #f0faf0;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #46b450;
    flex-wrap: wrap;
}

.ga-promo-banner__label {
    font-weight: 600;
    color: #2d6a2e;
}

.ga-promo-banner__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ga-promo-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #c3e6cb;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #2d6a2e;
    white-space: nowrap;
}

.ga-promo-pill--pending {
    border-color: #f0d0d1;
    color: #CC2027;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.ga-promo-pill--pending:hover {
    background: #fdf0f0;
    box-shadow: 0 1px 4px rgba(204, 32, 39, 0.12);
}

.ga-promo-banner--applied .ga-promo-banner__icon {
    color: #46b450;
    font-weight: 700;
}

.ga-promo-banner--applied .ga-promo-banner__text strong {
    color: #2d6a2e;
}

.ga-promo-banner__icon {
    font-size: 18px;
    flex-shrink: 0;
}

.ga-promo-banner__text strong {
    color: #CC2027;
}

/* ── Cart promo label under item name ────────── */
.ga-promo-item-reason {
    display: inline-block;
    color: #CC2027;
    font-size: 12px;
    font-weight: 500;
    font-style: normal;
    margin-top: 2px;
}

/* ── Cart savings row ────────────────────────── */
tr.ga-promo-savings th,
tr.ga-promo-savings td {
    color: #CC2027;
    font-weight: 600;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
    .ga-promo-modal__dialog {
        padding: 20px;
        max-width: 95%;
    }

    .ga-promo-modal__products {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .ga-promo-gift-card__image img {
        max-height: 90px;
    }

    .ga-promo-gift-card__detail-btn {
        opacity: 1;
    }

    .ga-promo-detail__content {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .ga-promo-detail__main-img img {
        max-height: 160px;
    }
}

@media (max-width: 480px) {
    .ga-promo-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 12px;
        font-size: 13px;
    }

    .ga-promo-banner__pills {
        width: 100%;
    }

    .ga-promo-pill {
        font-size: 12px;
        padding: 3px 10px;
        white-space: normal;
        word-break: break-word;
    }

    .ga-promo-modal {
        align-items: flex-end;
    }

    .ga-promo-modal__dialog {
        padding: 16px;
        max-height: 88vh;
        border-radius: 14px 14px 0 0;
        width: 100%;
        max-width: 100%;
    }

    .ga-promo-modal__title {
        font-size: 16px !important;
    }

    .ga-promo-modal__products {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .ga-promo-gift-card {
        padding: 8px;
    }

    .ga-promo-gift-card__image {
        padding: 4px;
        margin-bottom: 4px;
    }

    .ga-promo-gift-card__image img {
        max-height: 75px;
    }

    .ga-promo-gift-card__name {
        font-size: 11px;
    }

    .ga-promo-gift-card__price {
        margin-bottom: 5px;
    }

    .ga-promo-gift-card__select {
        font-size: 11px !important;
        padding: 6px 8px !important;
    }
}
