/* Site Hub WooCommerce Toolkit - Frontend Styles */

/* ===== Product Badges ===== */
.shwt-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
}
.shwt-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}
.shwt-badge-oos { background: #95a5a6; }
.shwt-badges-single { margin-bottom: 12px; }
.shwt-badges-single .shwt-badges {
    position: static;
    flex-direction: row;
}
li.product { position: relative; }

/* Hide default WC sale flash when our module is active */
.shwt-badges .shwt-badge-sale ~ * .onsale,
li.product:has(.shwt-badge-sale) > .onsale { display: none; }

/* ===== Variation Swatches ===== */
.shwt-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}
.shwt-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    min-width: 36px;
    min-height: 36px;
}
.shwt-swatch:hover { border-color: #999; }
.shwt-swatch.is-selected { border-color: #111; box-shadow: 0 0 0 1px #111; }
.shwt-swatch-color { display: block; width: 28px; height: 28px; border-radius: 2px; }
.shwt-swatch-image { width: 36px; height: 36px; object-fit: cover; border-radius: 2px; }
.shwt-swatch-label { padding: 6px 12px; font-size: 13px; }

/* ===== Quick View Modal ===== */
.shwt-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shwt-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}
.shwt-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 6px;
    padding: 32px;
    z-index: 1;
}
.shwt-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: 0;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}
.shwt-quick-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 640px) {
    .shwt-quick-view { grid-template-columns: 1fr; }
    .shwt-modal-content { padding: 20px; }
}
.shwt-quick-view-image img { width: 100%; height: auto; }

/* ===== Sticky Add to Cart ===== */
.shwt-sticky-atc {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
    padding: 10px 16px;
    transition: transform 0.3s ease;
}
.shwt-sticky-atc-bottom { bottom: 0; }
.shwt-sticky-atc-top { top: 0; box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.shwt-sticky-atc-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}
.shwt-sticky-atc-thumb img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.shwt-sticky-atc-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.shwt-sticky-atc-title { font-weight: 600; font-size: 14px; }
.shwt-sticky-atc-price { font-size: 13px; color: #666; }
.shwt-sticky-atc-price del { opacity: 0.5; margin-right: 4px; }
@media (max-width: 640px) {
    .shwt-sticky-atc-title { font-size: 12px; }
    .shwt-sticky-atc-thumb { display: none; }
}

/* ===== Sales Notification ===== */
.shwt-sales-notification {
    position: fixed;
    z-index: 9998;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 12px 36px 12px 12px;
    max-width: 320px;
    display: flex;
    gap: 10px;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.shwt-sales-notification.is-visible { opacity: 1; transform: translateY(0); }
.shwt-pos-bottom-left  { bottom: 20px; left: 20px; }
.shwt-pos-bottom-right { bottom: 20px; right: 20px; }
.shwt-pos-top-left     { top: 20px; left: 20px; }
.shwt-pos-top-right    { top: 20px; right: 20px; }
.shwt-sales-image img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.shwt-sales-text { font-size: 13px; line-height: 1.4; }
.shwt-sales-customer { display: block; font-weight: 600; }
.shwt-sales-line { display: block; }
.shwt-sales-time { display: block; font-size: 11px; color: #999; margin-top: 2px; }
.shwt-sales-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: 0;
    font-size: 18px;
    cursor: pointer;
    color: #999;
}

/* ===== Side Mini Cart ===== */
.shwt-cart-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    border: 0;
    cursor: pointer;
    z-index: 9990;
    font-size: 24px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.shwt-cart-launcher .shwt-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    padding: 0 4px;
    font-weight: 700;
}
.shwt-side-cart {
    position: fixed;
    inset: 0;
    z-index: 99997;
    visibility: hidden;
    pointer-events: none;
}
.shwt-side-cart.is-open {
    visibility: visible;
    pointer-events: auto;
}
.shwt-side-cart-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.shwt-side-cart.is-open .shwt-side-cart-overlay { opacity: 1; }
.shwt-side-cart-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 100%;
    max-width: 400px;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}
.shwt-side-cart.is-open .shwt-side-cart-panel { transform: translateX(0); }
.shwt-side-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}
.shwt-side-cart-header h3 { margin: 0; font-size: 18px; }
.shwt-side-cart-close {
    background: none;
    border: 0;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}
.shwt-side-cart-body { flex: 1; overflow-y: auto; padding: 20px; }

/* ===== Cart Reserved Timer ===== */
.shwt-cart-timer {
    background: #fff8e1;
    border: 1px solid #f0c674;
    padding: 10px 14px;
    margin: 0 0 16px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.shwt-cart-timer-clock { font-weight: 700; font-family: monospace; font-size: 16px; }
.shwt-cart-timer.is-expiring { background: #fdecea; border-color: #e74c3c; }

/* ===== Multi-Step Checkout ===== */
.shwt-msc-progress {
    display: flex;
    gap: 0;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
    counter-reset: step;
}
.shwt-msc-progress li {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    background: #f4f4f4;
    color: #888;
    font-size: 13px;
    font-weight: 600;
    position: relative;
    counter-increment: step;
}
.shwt-msc-progress li::before {
    content: counter(step);
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    border-radius: 50%;
    background: #ccc;
    color: #fff;
    margin-right: 6px;
}
.shwt-msc-progress li.is-active { background: #111; color: #fff; }
.shwt-msc-progress li.is-active::before { background: #fff; color: #111; }
.shwt-msc-progress li.is-complete::before { background: #27ae60; }
.shwt-msc-step { display: none; }
.shwt-msc-step.is-active { display: block; }
.shwt-msc-nav { margin: 20px 0; display: flex; gap: 10px; justify-content: space-between; }

/* ===== Order Bump ===== */
.shwt-order-bump {
    border: 2px dashed #f39c12;
    border-radius: 6px;
    padding: 16px;
    margin: 20px 0;
    background: #fffbeb;
}
.shwt-order-bump.is-added { border-color: #27ae60; background: #f0faf3; }
.shwt-bump-headline {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
}
.shwt-bump-body {
    display: flex;
    gap: 14px;
    align-items: center;
}
.shwt-bump-image img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; }
.shwt-bump-info { flex: 1; font-size: 14px; }
.shwt-bump-info p { margin: 4px 0 0; color: #666; }
.shwt-bump-cta .button { white-space: nowrap; }
