/* ============================================================
   Mobile App PWA Pro - WooCommerce styles
============================================================ */

/* Mini Cart Drawer */
.mapp-mini-cart-overlay {
    position: fixed; inset: 0; z-index: 99996;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    opacity: 0; transition: opacity .3s;
}
.mapp-mini-cart-overlay.is-open { opacity: 1; }

.mapp-mini-cart {
    position: fixed; top: 0; bottom: 0;
    z-index: 99997;
    width: min(420px, 85vw);
    background: var(--mapp-bg);
    color: var(--mapp-text);
    display: flex; flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,.3);
    transition: transform .35s cubic-bezier(.25,.46,.45,.94);
    padding-top: var(--mapp-safe-top);
    padding-bottom: var(--mapp-safe-bottom);
}
html[dir="rtl"] .mapp-mini-cart { right: 0; transform: translateX(100%); }
html[dir="ltr"] .mapp-mini-cart { left: 0; transform: translateX(-100%); }
html[dir="rtl"] .mapp-mini-cart.is-open,
html[dir="ltr"] .mapp-mini-cart.is-open { transform: translateX(0); }

.mapp-mini-cart-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--mapp-border);
}
.mapp-mini-cart-header h3 { margin: 0; font-size: 18px; }
.mapp-mini-cart-close {
    background: var(--mapp-card); border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    color: var(--mapp-text);
    font-size: 22px; cursor: pointer;
}
.mapp-mini-cart-body { flex: 1; overflow-y: auto; padding: 16px; }
.mapp-mini-cart-footer { padding: 16px; border-top: 1px solid var(--mapp-border); background: var(--mapp-card); }

.mapp-mini-cart-items { list-style: none; padding: 0; margin: 0; }
.mapp-mini-cart-item {
    display: flex; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--mapp-border);
    position: relative;
}
.mapp-mini-cart-item img {
    width: 64px; height: 64px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--mapp-card);
}
.mapp-mini-cart-item-info { flex: 1; }
.mapp-mini-cart-item-info strong { display: block; font-size: 14px; margin-bottom: 6px; }
.mapp-mini-cart-qty { display: inline-flex; align-items: center; gap: 8px; background: var(--mapp-card); border-radius: 10px; padding: 4px 8px; margin-bottom: 6px; }
.mapp-mini-cart-qty button { background: none; border: none; color: var(--mapp-text); width: 24px; height: 24px; font-size: 16px; cursor: pointer; border-radius: 6px; }
.mapp-mini-cart-qty button:hover { background: var(--mapp-border); }
.mapp-mini-cart-qty span { min-width: 20px; text-align: center; font-weight: 600; }
.mapp-mini-cart-price { font-weight: 600; color: var(--mapp-theme); }
.mapp-mini-cart-remove {
    position: absolute; top: 12px; right: 0;
    background: none; border: none;
    color: var(--mapp-text-dim);
    font-size: 22px; cursor: pointer;
}
html[dir="rtl"] .mapp-mini-cart-remove { right: auto; left: 0; }

.mapp-mini-cart-empty { text-align: center; padding: 40px 20px; }
.mapp-empty-icon { font-size: 64px; margin-bottom: 16px; opacity: .5; }

.mapp-mini-cart-subtotal { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 16px; }
.mapp-mini-cart-subtotal strong { color: var(--mapp-theme); font-size: 18px; }
.mapp-mini-cart-actions { display: flex; gap: 8px; }
.mapp-mini-cart-actions .mapp-btn { flex: 1; }

/* Quick View */
.mapp-quickview-overlay {
    position: fixed; inset: 0; z-index: 99998;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0; transition: opacity .3s;
}
.mapp-quickview-overlay.is-open { opacity: 1; }
.mapp-quickview-modal {
    background: var(--mapp-bg);
    color: var(--mapp-text);
    border-radius: 20px;
    width: 100%; max-width: 500px;
    max-height: 90vh; overflow-y: auto;
    position: relative;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
    animation: mappQVin .35s cubic-bezier(.34,1.56,.64,1);
}
@keyframes mappQVin { from{opacity:0;transform:scale(.9)} to{opacity:1;transform:scale(1)} }
.mapp-quickview-close {
    position: absolute; top: 12px; right: 12px;
    background: var(--mapp-card); border: none;
    width: 36px; height: 36px; border-radius: 50%;
    color: var(--mapp-text); font-size: 20px; cursor: pointer; z-index: 2;
}
html[dir="rtl"] .mapp-quickview-close { right: auto; left: 12px; }
.mapp-quickview-inner { display: flex; flex-direction: column; gap: 16px; }
.mapp-quickview-image { border-radius: 14px; overflow: hidden; aspect-ratio: 16/12; background: var(--mapp-card); }
.mapp-quickview-image img { width: 100%; height: 100%; object-fit: cover; }
.mapp-quickview-details h2 { font-size: 20px; margin: 0 0 8px; }
.mapp-quickview-price { color: var(--mapp-theme); font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.mapp-quickview-desc { font-size: 14px; opacity: .8; margin-bottom: 16px; line-height: 1.6; }
.mapp-quickview-actions { display: flex; gap: 8px; }
.mapp-quickview-actions .mapp-btn { flex: 1; }

/* Sticky Add to Cart */
.mapp-sticky-atc {
    position: fixed;
    bottom: calc(var(--mapp-nav-h) + var(--mapp-safe-bottom) + 10px);
    left: 12px; right: 12px;
    z-index: 9987;
    background: var(--mapp-card);
    backdrop-filter: blur(var(--mapp-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--mapp-blur)) saturate(180%);
    border: 1px solid var(--mapp-border);
    border-radius: 18px;
    padding: 10px 12px;
    box-shadow: var(--mapp-shadow);
    transform: translateY(150%);
    transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.mapp-sticky-atc.is-visible { transform: translateY(0); }
.mapp-sticky-atc-inner { display: flex; align-items: center; gap: 12px; }
.mapp-sticky-atc-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.mapp-sticky-atc-info img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.mapp-sticky-atc-info strong { display: block; font-size: 13px; color: var(--mapp-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mapp-sticky-atc-info span { font-size: 12px; color: var(--mapp-theme); font-weight: 600; }
.mapp-sticky-atc-btn {
    background: var(--mapp-theme); color: #fff;
    border: none; border-radius: 12px;
    padding: 10px 14px;
    display: flex; align-items: center; gap: 6px;
    font-weight: 600; font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--mapp-theme) 40%, transparent);
}
.mapp-sticky-atc-btn svg { width: 18px; height: 18px; }

/* WhatsApp FAB */
.mapp-chat-fab {
    position: fixed;
    bottom: calc(var(--mapp-nav-h) + var(--mapp-safe-bottom) + 16px);
    width: 56px; height: 56px;
    background: #25d366; color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 20px rgba(37,211,102,.4);
    z-index: 9986;
    text-decoration: none;
    animation: mappChatPulse 2s infinite;
}
.mapp-chat-fab.bottom-left { left: 16px; }
.mapp-chat-fab.bottom-right { right: 16px; }
.mapp-chat-fab svg { width: 28px; height: 28px; }
@keyframes mappChatPulse {
    0%,100% { box-shadow: 0 6px 20px rgba(37,211,102,.4); }
    50% { box-shadow: 0 6px 25px rgba(37,211,102,.7); }
}

/* ============================================================
   Badge pulse animation when items added
============================================================ */
@keyframes mappBadgePulse {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.5); }
    60%  { transform: scale(.95); }
    100% { transform: scale(1); }
}
.mapp-nav-badge.is-pulse,
.mapp-header-badge.is-pulse {
    animation: mappBadgePulse .65s cubic-bezier(.34,1.56,.64,1);
}

/* Visual feedback on the add-to-cart button itself */
[data-mapp-atc].is-loading,
a.add_to_cart_button.is-loading,
button.add_to_cart_button.is-loading {
    opacity: .6;
    pointer-events: none;
    position: relative;
}
[data-mapp-atc].is-added,
a.add_to_cart_button.is-added,
button.add_to_cart_button.is-added {
    background-color: #22c55e !important;
    color: #fff !important;
    transition: background-color .25s;
}
[data-mapp-atc].is-added::after,
a.add_to_cart_button.is-added::after,
button.add_to_cart_button.is-added::after {
    content: '✓';
    font-weight: 800;
    margin: 0 4px;
}
