/* ============================================
   Add to Cart Confirmation Popup
   Theme-matched (extends checkout.css tokens)
   Theme palette:
     primary: #D10024  (sale / danger / primary CTA)
     dark:    #15161D  (text, dark surfaces)
     body:    #2B2D42  (body text)
     grey:    #8D99AE  (secondary text)
     border:  #E4E7ED  (dividers)
     surface: #FBFBFC  (light bg)
   ============================================ */

.atc-popup {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: atcFadeIn 0.2s ease;
}
.atc-popup[hidden] { display: none !important; }

@keyframes atcFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.atc-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 16, 24, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.atc-popup-panel {
    position: relative;
    background: #fff;
    border-radius: 18px;
    width: 96%;
    max-width: 480px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    animation: atcSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes atcSlideUp {
    from { transform: translateY(24px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* --- Success bar (top) --- */
.atc-popup-success-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}
.atc-popup-success-bar > i.fa-check-circle {
    font-size: 22px;
    flex-shrink: 0;
}
.atc-popup-success-bar > span {
    flex: 1;
    letter-spacing: 0.2px;
}
.atc-popup-close {
    background: rgba(255, 255, 255, 0.18);
    border: 0;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.atc-popup-close:hover,
.atc-popup-close:active {
    background: rgba(255, 255, 255, 0.32);
}

/* --- Product row --- */
.atc-popup-product {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
}

.atc-popup-img {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    background: var(--ck-surface, #FBFBFC);
    border: 1px solid var(--ck-border, #E4E7ED);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.atc-popup-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.atc-popup-info {
    flex: 1;
    min-width: 0;
}
.atc-popup-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ck-dark, #15161D);
    margin: 0 0 6px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.atc-popup-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.atc-popup-qty-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: var(--ck-surface, #FBFBFC);
    border: 1px solid var(--ck-border, #E4E7ED);
    border-radius: 999px;
    font-size: 12px;
    color: var(--ck-grey, #8D99AE);
    font-weight: 500;
}
.atc-popup-qty-badge i {
    font-size: 11px;
    color: var(--ck-primary, #D10024);
}
.atc-popup-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--ck-primary, #D10024);
}

/* --- Divider --- */
.atc-popup-divider {
    height: 1px;
    background: var(--ck-border, #E4E7ED);
    margin: 0 20px;
}

/* --- Cart summary section --- */
.atc-popup-cart {
    padding: 16px 20px;
    background: var(--ck-surface, #FBFBFC);
}
.atc-popup-cart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 14px;
    color: var(--ck-body, #2B2D42);
}
.atc-popup-cart-row.atc-popup-cart-items {
    font-size: 13px;
    color: var(--ck-grey, #8D99AE);
}
.atc-popup-cart-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.atc-popup-cart-label i {
    color: var(--ck-primary, #D10024);
    width: 16px;
    text-align: center;
}
.atc-popup-cart-value {
    font-weight: 700;
    color: var(--ck-dark, #15161D);
    font-size: 15px;
}

/* --- Action buttons (2-column) --- */
.atc-popup-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px 20px 0;
}
.atc-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
    border: 1px solid transparent;
    text-align: center;
    line-height: 1.2;
    min-height: 46px;
    -webkit-tap-highlight-color: transparent;
}
.atc-popup-btn-secondary {
    background: #fff;
    color: var(--ck-dark, #15161D);
    border-color: var(--ck-border, #E4E7ED);
}
.atc-popup-btn-secondary:hover {
    background: var(--ck-surface, #FBFBFC);
    border-color: var(--ck-grey, #8D99AE);
}
.atc-popup-btn-primary {
    background: var(--ck-primary, #D10024);
    color: #fff;
    box-shadow: 0 4px 14px rgba(209, 0, 36, 0.25);
}
.atc-popup-btn-primary:hover {
    background: #b8001f;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(209, 0, 36, 0.35);
}
.atc-popup-btn i.atc-popup-arrow {
    font-size: 12px;
    margin-left: 2px;
    transition: transform 0.18s ease;
}
.atc-popup-btn-primary:hover i.atc-popup-arrow {
    transform: translateX(2px);
}

/* --- Continue shopping link --- */
.atc-popup-continue {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: transparent;
    border: 0;
    color: var(--ck-grey, #8D99AE);
    font-size: 13px;
    font-weight: 500;
    padding: 14px 20px 18px;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.atc-popup-continue:hover,
.atc-popup-continue:active {
    color: var(--ck-primary, #D10024);
}

/* --- Mobile: full-screen --- */
@media (max-width: 640px) {
    .atc-popup { padding: 0; }
    .atc-popup-panel {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .atc-popup-actions {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 14px 16px 0;
    }
    .atc-popup-product { padding: 16px; }
    .atc-popup-cart { padding: 14px 16px; }
    .atc-popup-divider { margin: 0 16px; }
    .atc-popup-success-bar { padding: 12px 16px; font-size: 14px; }
}
