/* =====================================================
   Pharma EW v4 — Sticky Add to Cart
   ===================================================== */

/* ── Editor wrapper ── */
.pew-sc-editor-wrap .pew-sc-bar {
    position: relative !important;
    bottom: auto !important;
    top: auto !important;
    z-index: auto !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
}

/* ── Base bar ── */
.pew-sc-bar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999999 !important;
    background: #fff;
    transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s ease;
    will-change: transform, opacity;
    box-sizing: border-box;
}
.pew-sc-bar *, .pew-sc-bar *::before, .pew-sc-bar *::after {
    box-sizing: border-box;
}

/* Positions */
.pew-sc-bar.is-bottom { bottom: 0 !important; top: auto !important; border-top: 1px solid #e0e0e0; }
.pew-sc-bar.is-top    { top: 0 !important; bottom: auto !important; border-bottom: 1px solid #e0e0e0; }

/* ── Visibility ── */
.pew-sc-bar.is-hidden { visibility: hidden; pointer-events: none; }

.pew-sc-bar.is-bottom.anim-slide.is-hidden  { transform: translateY(105%); opacity: 0; }
.pew-sc-bar.is-bottom.anim-slide.is-visible { transform: translateY(0);    opacity: 1; visibility: visible; pointer-events: all; }
.pew-sc-bar.is-top.anim-slide.is-hidden     { transform: translateY(-105%); opacity: 0; }
.pew-sc-bar.is-top.anim-slide.is-visible    { transform: translateY(0);    opacity: 1; visibility: visible; pointer-events: all; }
.pew-sc-bar.anim-fade.is-hidden             { opacity: 0; transform: none; }
.pew-sc-bar.anim-fade.is-visible            { opacity: 1; visibility: visible; pointer-events: all; }

/* ── Device visibility ── */
@media (max-width: 768px) { .pew-sc-bar.show-desktop { display: none !important; } }
@media (min-width: 769px) { .pew-sc-bar.show-mobile  { display: none !important; } }

/* ── iPhone safe area ── */
.pew-sc-bar.is-bottom.has-safe { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ── Feature toggles ── */
.pew-sc-bar--no-img   .pew-sc-img   { display: none !important; }
.pew-sc-bar--no-qty   .pew-sc-qty   { display: none !important; }
.pew-sc-bar--no-badge .pew-sc-badge { display: none !important; }

/* ── Inner ── */
.pew-sc-bar .pew-sc-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ── Product section ── */
.pew-sc-bar .pew-sc-product {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 0;
}
.pew-sc-bar .pew-sc-img {
    width: 50px; height: 50px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #eee;
    flex-shrink: 0;
    display: block;
}
.pew-sc-bar .pew-sc-info {
    display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.pew-sc-bar .pew-sc-name {
    font-size: 13px; font-weight: 600; color: #1a1a1a;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 200px; display: block; margin: 0; padding: 0; line-height: 1.3;
}
.pew-sc-bar .pew-sc-price {
    font-size: 15px; font-weight: 700; color: #0a8f6b;
    display: block; margin: 0; padding: 0; line-height: 1.3;
}
.pew-sc-bar .pew-sc-price ins  { text-decoration: none; }
.pew-sc-bar .pew-sc-price del  { font-size: 11px; color: #aaa; font-weight: 400; }
.pew-sc-bar .pew-sc-price .amount { display: inline; }

/* ── Actions ── */
.pew-sc-bar .pew-sc-actions {
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}

/* ── Qty stepper ── */
.pew-sc-bar .pew-sc-qty {
    display: inline-flex; align-items: stretch;
    height: 44px; background: #f5f5f5;
    border: 1px solid #d0d0d0; border-radius: 8px;
    overflow: hidden; flex-shrink: 0;
}
.pew-sc-bar .pew-sc-qty-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 100%;
    background: transparent; border: none; cursor: pointer;
    font-size: 20px; font-weight: 300; color: #333;
    padding: 0; line-height: 1; flex-shrink: 0;
    transition: background .15s; font-family: inherit; user-select: none;
}
.pew-sc-bar .pew-sc-qty-btn:hover  { background: #e5e5e5; }
.pew-sc-bar .pew-sc-qty-btn:active { background: #ddd; }
.pew-sc-bar .pew-sc-qty-num {
    width: 40px; height: 100%; border: none; background: transparent;
    text-align: center; font-size: 14px; font-weight: 700; color: #333;
    padding: 0; outline: none; -moz-appearance: textfield; font-family: inherit; flex-shrink: 0;
}
.pew-sc-bar .pew-sc-qty-num::-webkit-inner-spin-button,
.pew-sc-bar .pew-sc-qty-num::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ── Button ── */
.pew-sc-bar .pew-sc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 46px; min-width: 140px; padding: 0 22px;
    background: #0a8f6b; color: #fff; border: none; border-radius: 10px;
    font-size: 14px; font-weight: 700; cursor: pointer;
    white-space: nowrap; text-decoration: none; font-family: inherit;
    letter-spacing: .2px; transition: background .2s, transform .1s;
    flex-shrink: 0; line-height: 1;
}
.pew-sc-bar .pew-sc-btn:hover  { background: #077a5a; color: #fff; }
.pew-sc-bar .pew-sc-btn:active { transform: scale(.97); }
.pew-sc-bar .pew-sc-btn:disabled { opacity: .65; cursor: not-allowed; pointer-events: none; }
.pew-sc-bar .pew-sc-btn.is-added { background: #28a745; }
.pew-sc-bar .pew-sc-btn svg { flex-shrink: 0; display: block; }

.pew-sc-bar .pew-sc-spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
    border-radius: 50%; animation: pew-spin .55s linear infinite; flex-shrink: 0;
}
@keyframes pew-spin { to { transform: rotate(360deg); } }

/* ── Sale badge ── */
.pew-sc-bar .pew-sc-badge {
    position: absolute; top: -12px; right: 20px;
    background: #e63946; color: #fff;
    font-size: 10px; font-weight: 800;
    padding: 3px 8px; border-radius: 20px;
    text-transform: uppercase; letter-spacing: .5px; line-height: 1.4;
    white-space: nowrap; pointer-events: none;
}

/* ── Mobile compact ── */
@media (max-width: 500px) {
    .pew-sc-bar .pew-sc-name  { max-width: 90px; }
    .pew-sc-bar .pew-sc-qty   { display: none !important; }
}
