/* ==========================================================================
   ADD TO CART POPUP MODAL
   Shown after AJAX add-to-cart instead of minicart drawer.
   ========================================================================== */

.atc-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.atc-popup {
    background: #FFFFFF;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: atcSlideIn 0.25s ease;
}

@keyframes atcSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- HEADER --- */
.atc-popup__header {
    background: #2F4858;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.atc-popup__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 500;
}

.atc-popup__header-left svg {
    flex-shrink: 0;
}

.atc-popup__close {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.atc-popup__close:hover {
    opacity: 1;
}

/* --- Added to Cart Label --- */
.atc-popup__label {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 20px 24px 0;
}

/* --- PRODUCT ROW --- */
.atc-popup__product {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    margin: 12px 24px 0;
}

.atc-popup__product-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.atc-popup__product-info {
    flex: 1;
    min-width: 0;
}

.atc-popup__product-name {
    font-weight: 600;
    font-size: 15px;
    color: #1A1A1A;
    margin-bottom: 6px;
    line-height: 1.3;
}

.atc-popup__product-price {
    font-size: 18px;
    font-weight: 700;
    color: #5B8C2A;
}

/* --- ACTION BUTTONS --- */
.atc-popup__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 24px;
}

.atc-popup__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.1s;
    box-sizing: border-box;
}

.atc-popup__btn:active {
    transform: scale(0.98);
}

.atc-popup__btn svg {
    flex-shrink: 0;
}

.atc-popup__btn--secondary {
    background: #FFFFFF;
    color: #1A1A1A;
    border: 2px solid #E0E0E0;
}

.atc-popup__btn--secondary:hover {
    background: #F5F5F5;
    border-color: #CCCCCC;
    color: #1A1A1A;
}

.atc-popup__btn--primary {
    background: #5B8C2A;
    color: #FFFFFF;
    border: 2px solid #5B8C2A;
}

.atc-popup__btn--primary:hover {
    background: #4A7322;
    border-color: #4A7322;
    color: #FFFFFF;
}

/* --- FREQUENTLY BOUGHT TOGETHER --- */
.atc-popup__fbt {
    padding: 0 24px 24px;
}

.atc-popup__fbt .hp-section__title {
    font-size: 22px;
    font-weight: 700;
    color: #000;
    padding: 0 15px 15px 15px;
    border-bottom: 1px solid #dcdcdc;
    margin: 0 0 20px;
    letter-spacing: 1px;
    text-transform: none;
    display: inline-block;
}

.atc-popup__fbt-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.atc-popup__fbt-grid .hp-product-card {
    flex: 1;
}

.atc-popup__fbt-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}

/* --- FBT PRODUCT CARDS --- */
.atc-fbt-card {
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow 0.2s;
}

.atc-fbt-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.atc-fbt-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #5B8C2A;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    z-index: 1;
}

.atc-fbt-card__img-link {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FAFAFA;
    aspect-ratio: 1;
    padding: 12px;
}

.atc-fbt-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.atc-fbt-card__category,
.atc-fbt-card__name,
.atc-fbt-card__rating,
.atc-fbt-card__price-row,
.atc-fbt-card__btn {
    margin-left: 12px;
    margin-right: 12px;
}

.atc-fbt-card__category {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
}

.atc-fbt-card__name {
    font-size: 13px;
    font-weight: 600;
    color: #1A1A1A;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.atc-fbt-card__name:hover {
    color: #5B8C2A;
}

.atc-fbt-card__rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.atc-fbt-card__stars {
    display: flex;
    gap: 1px;
    color: #F5A623;
}

.atc-fbt-card__stars svg {
    width: 14px;
    height: 14px;
}

.atc-fbt-card__reviews {
    color: #999;
    font-size: 12px;
}

.atc-fbt-card__price-row {
    margin-bottom: 10px;
}

.atc-fbt-card__price {
    font-size: 16px;
    font-weight: 700;
    color: #3D6B1A;
}

.atc-fbt-card__price-label {
    font-size: 11px;
    font-weight: 400;
    color: #999;
    margin-left: 2px;
}

.atc-fbt-card__old-price {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    margin-left: 6px;
}

.atc-fbt-card__btn {
    background: #5B8C2A;
    color: #FFFFFF;
    border: none;
    border-radius: 6px;
    padding: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    width: auto;
    margin-top: auto;
    margin-bottom: 12px;
    transition: background 0.15s;
}

.atc-fbt-card__btn:hover {
    background: #4A7322;
}

/* --- MOBILE --- */
@media (max-width: 768px) {
    .atc-popup-overlay {
        padding: 20px 12px;
    }

    .atc-popup__actions {
        grid-template-columns: 1fr;
    }

    .atc-popup__fbt-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .atc-popup__product-name {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .atc-popup-overlay {
        padding: 10px 8px;
    }

    .atc-popup__product {
        gap: 12px;
        padding: 12px;
        margin: 12px 16px 0;
    }

    .atc-popup__product-img {
        width: 60px;
        height: 60px;
    }

    .atc-popup__actions {
        padding: 16px;
    }

    .atc-popup__fbt {
        padding: 0 16px 16px;
    }

    .atc-popup__fbt-grid {
        grid-template-columns: 1fr 1fr;
    }
}
