/* TitanCart Essentials - storefront styles.
 * Currently: the Sticky Add to Cart bar. (Low-stock badge is inline-styled in
 * PHP so it never depends on this stylesheet.) */

.tce-sticky-bar {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 9990;
    background: #ffffff;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.10);
    border-top: 1px solid #e5e5e5;
    padding: 10px 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
}

.tce-sticky-bar--bottom {
    bottom: 0;
    transform: translateY(100%);
}

.tce-sticky-bar--top {
    top: 0;
    border-top: none;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
    transform: translateY(-100%);
}

.tce-sticky-bar--visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.tce-sticky-bar__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.tce-sticky-bar__thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex: none;
    border: 1px solid #e5e5e5;
    background: #f5f5f5;
}

.tce-sticky-bar__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.tce-sticky-bar__title {
    font-size: 14px;
    font-weight: 600;
    color: #0a0a0a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tce-sticky-bar__price {
    font-size: 14px;
    font-weight: 700;
    color: #171717;
    margin-top: 2px;
}

.tce-sticky-bar__btn {
    flex: none;
    appearance: none;
    border: none;
    cursor: pointer;
    background: #171717;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 11px 22px;
    border-radius: 8px;
    transition: background .15s ease, opacity .15s ease;
}

.tce-sticky-bar__btn:hover {
    background: #2563eb;
}

.tce-sticky-bar__btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
    background: #737373;
}

@media (max-width: 600px) {
    .tce-sticky-bar__title {
        font-size: 13px;
        max-width: 42vw;
    }
    .tce-sticky-bar__btn {
        padding: 10px 16px;
    }
}

/* ── Live Activity Notifications ─────────────────────────────────────────── */

.tce-activity {
    position: fixed;
    bottom: 20px;
    z-index: 9985;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 340px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: auto;
}

.tce-activity--left  { left: 20px; }
.tce-activity--right { right: 20px; }

.tce-activity--in {
    opacity: 1;
    transform: translateY(0);
}

.tce-activity__thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    flex: none;
    border: 1px solid #e5e5e5;
    background: #f5f5f5;
}

.tce-activity__body {
    min-width: 0;
    flex: 1 1 auto;
}

.tce-activity__msg {
    font-size: 13px;
    line-height: 1.4;
    color: #0a0a0a;
}

.tce-activity__time {
    font-size: 11px;
    color: #737373;
    margin-top: 3px;
}

.tce-activity__close {
    flex: none;
    appearance: none;
    border: none;
    background: transparent;
    color: #a3a3a3;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    align-self: flex-start;
}

.tce-activity__close:hover { color: #0a0a0a; }

@media (max-width: 600px) {
    .tce-activity {
        left: 12px;
        right: 12px;
        max-width: none;
        bottom: 12px;
    }
}

/* ── Buy Now button (S316) ───────────────────────────────────────────────── */
/* Two looks, both matching existing PDP buttons so the colors track each theme:
 *   - solid   -> no recolor: inherits .tc-pdp__add-btn (the Add to Cart "buy"
 *                button), matching it in every theme (incl. Prism's per-preset
 *                gradient).
 *   - outline -> mirrors the wishlist / compare buttons using the SAME theme tokens
 *                (--tc-border / --tc-text), which every theme defines, so it matches
 *                those buttons exactly. (Earlier --tc-accent failed because Prism
 *                does not define it.) */
.tce-buy-now-btn.tce-buy-now-btn--outline {
    background: #fff !important;
    color: var(--tc-text, #0a0a0a) !important;
    border: 2px solid var(--tc-border, #e5e5e5) !important;
    box-shadow: none !important;
}
.tce-buy-now-btn.tce-buy-now-btn--outline:hover {
    border-color: var(--tc-accent, #2563eb) !important;
    color: var(--tc-accent, #2563eb) !important;
}
.tce-buy-now-btn svg { flex-shrink: 0; }

/* ── Free Shipping Progress Bar (S321) ─────────────────────────────────── */
/* Colors (background / text / fill) are set inline by JS from the feature
 * settings; this stylesheet only handles layout per placement. */
.tce-fsbar {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.3;
    border-radius: 8px;
}
.tce-fsbar__text {
    font-weight: 600;
    margin-bottom: 7px;
    text-align: center;
}
.tce-fsbar__track {
    height: 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
}
.tce-fsbar__fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.35s ease;
}

/* Drawer: square corners, sits above the subtotal row in the footer. */
.tce-fsbar--drawer {
    border-radius: 0;
    margin: 0 0 12px;
}

/* Cart page: top of the order-summary card. */
.tce-fsbar--cart {
    margin: 0 0 16px;
}

/* Site-wide. */
.tce-fsbar--sitewide {
    border-radius: 0;
    padding: 8px 16px;
}
.tce-fsbar--sitewide .tce-fsbar__text {
    margin-bottom: 5px;
}
.tce-fsbar--sitewide-top {
    position: relative;
    z-index: 9990;
}
.tce-fsbar--sitewide-bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9990;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
}

/* Qualified: hide the (full) track and center the success message. */
.tce-fsbar--done .tce-fsbar__track {
    display: none;
}
.tce-fsbar--done .tce-fsbar__text {
    margin-bottom: 0;
}
