/**
 * AdvancedWoo — UX Enhancements CSS (v1.7.0)
 *
 * Styles for: trust badges, shipping info, star ratings, mobile sticky cart,
 * quick view modal, image hover swap, low stock badge, recently viewed,
 * image zoom, back-to-results link, price-per-unit.
 */

/* ═══════════ TRUST BADGES ═══════════ */
.awoo-trust-bar {
    display: flex; gap: 0; margin-top: 24px; padding: 0;
    border: 1px solid #e8e8e8; border-radius: 8px; overflow: hidden;
    background: #fafafa;
}
.awoo-trust-item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 6px; padding: 14px 8px; text-align: center;
    border-right: 1px solid #e8e8e8; font-size: 11px; color: #555; line-height: 1.3;
}
.awoo-trust-item:last-child { border-right: none; }
.awoo-trust-icon { width: 28px; height: 28px; color: #43a047; }
.awoo-trust-icon svg { width: 100%; height: 100%; }

/* ═══════════ SHIPPING INFO ═══════════ */
.awoo-shipping-info {
    margin-top: 20px; padding: 16px; border-radius: 8px;
    background: #f0f7f0; border: 1px solid #c8e6c9;
}
.awoo-shipping-row {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: #2e7d32; padding: 4px 0;
}
.awoo-shipping-row svg { flex-shrink: 0; width: 16px; height: 16px; }

/* ═══════════ STAR RATINGS ═══════════ */
.awoo-stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.awoo-stars svg { width: 14px; height: 14px; }
.awoo-stars-filled { color: #f59e0b; }
.awoo-stars-empty { color: #d1d5db; }
.awoo-rating-count { font-size: 12px; color: #888; margin-left: 4px; }
/* Product page stars */
.awoo-product-page .awoo-stars svg { width: 18px; height: 18px; }
.awoo-product-page .awoo-rating-count { font-size: 14px; }
.awoo-product-page .awoo-rating-row { margin-bottom: 12px; }
/* Grid card stars */
.awoo-card .awoo-rating-row { margin: 4px 0; }

/* ═══════════ MOBILE STICKY ADD-TO-CART ═══════════ */
.awoo-sticky-cart {
    position: fixed; bottom: -80px; left: 0; right: 0; z-index: 1000;
    background: #fff; border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0,0,0,.1);
    transition: bottom .3s ease; padding: 10px 16px;
}
.awoo-sticky-cart.awoo-sticky-show { bottom: 0; }
.awoo-sticky-inner {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 600px; margin: 0 auto; gap: 12px;
}
.awoo-sticky-info { flex: 1; min-width: 0; }
.awoo-sticky-name { display: block; font-size: 13px; font-weight: 600; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.awoo-sticky-price { font-size: 15px; font-weight: 700; color: #e53935; }
.awoo-sticky-btn {
    display: flex; align-items: center; gap: 6px;
    background: #43a047; color: #fff; border: none; border-radius: 6px;
    padding: 10px 20px; font-size: 14px; font-weight: 600;
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.awoo-sticky-btn:hover { background: #388e3c; }
@media (min-width: 960px) { .awoo-sticky-cart { display: none !important; } }

/* ═══════════ QUICK VIEW ═══════════ */
.awoo-quick-view-btn {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(255,255,255,.95); border: none; border-radius: 50%;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; transition: opacity .2s; z-index: 4;
    box-shadow: 0 2px 8px rgba(0,0,0,.15); color: #333;
}
.awoo-card-media:hover .awoo-quick-view-btn { opacity: 1; }
.awoo-quick-view-btn:hover { background: #fff; }
.awoo-quick-view-btn.awoo-loading { pointer-events: none; opacity: .6; }
.awoo-quick-view-btn svg { width: 20px; height: 20px; }
/* Quick view modal button */
#awoo-qv-modal .awoo-add-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: #43a047; color: #fff; border: none; border-radius: 6px;
    height: 44px; padding: 0 20px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: background .2s; width: 100%;
}
#awoo-qv-modal .awoo-add-btn:hover { background: #388e3c; }
#awoo-qv-modal .uk-button-default {
    height: 44px; display: flex; align-items: center; justify-content: center;
    border-radius: 6px; font-size: 14px;
}
/* Fix WC price in modal — ensure del/ins display properly */
#awoo-qv-modal del { color: #999; font-weight: 400; font-size: 16px; }
#awoo-qv-modal ins { text-decoration: none; font-weight: 700; }

/* ═══════════ IMAGE HOVER SWAP ═══════════ */
.awoo-card-media { position: relative; }
.awoo-hover-img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0; transition: opacity .35s ease; z-index: 1;
}
.awoo-card:hover .awoo-hover-img { opacity: 1; }

/* ═══════════ LOW STOCK BADGE ═══════════ */
.awoo-low-stock-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: #fff3e0; color: #e65100; font-size: 11px; font-weight: 600;
    padding: 3px 8px; border-radius: 4px; margin-top: 4px;
}
.awoo-low-stock-badge svg { width: 12px; height: 12px; }
/* Product page version */
.awoo-product-page .awoo-low-stock-badge {
    font-size: 13px; padding: 5px 12px; margin-top: 8px;
}

/* ═══════════ QTY BOX (horizontal layout) ═══════════ */
.awoo-product-page .awoo-qty-box {
    display: inline-flex; align-items: center;
    border: 1px solid #e0e0e0; border-radius: 6px; overflow: hidden; height: 44px;
}
.awoo-product-page .awoo-qty-input {
    width: 52px; text-align: center; border: none; font-size: 16px;
    padding: 0; height: 44px; -moz-appearance: textfield; background: #fff;
}
.awoo-product-page .awoo-qty-input::-webkit-inner-spin-button,
.awoo-product-page .awoo-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.awoo-product-page .awoo-qty-down,
.awoo-product-page .awoo-qty-up {
    width: 36px; height: 44px; border: none; background: #f5f5f5;
    cursor: pointer; font-size: 18px; line-height: 1; padding: 0; color: #555;
    transition: background .15s;
}
.awoo-product-page .awoo-qty-down:hover,
.awoo-product-page .awoo-qty-up:hover { background: #e8e8e8; }
.awoo-product-page .awoo-qty-down { border-right: 1px solid #e0e0e0; }
.awoo-product-page .awoo-qty-up { border-left: 1px solid #e0e0e0; }

/* ═══════════ IMAGE ZOOM ON HOVER ═══════════ */
.awoo-gallery-main img { transition: transform .15s ease; cursor: zoom-in; }
.awoo-gallery-main { overflow: hidden; }

/* ═══════════ RECENTLY VIEWED ═══════════ */
.awoo-recently-viewed { margin-top: 50px; padding-top: 30px; border-top: 1px solid #eee; }
.awoo-rv-title { font-size: 18px; font-weight: 600; margin: 0 0 16px; color: #333; }
.awoo-rv-scroll {
    display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px;
    -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory;
}
.awoo-rv-card {
    flex: 0 0 140px; scroll-snap-align: start; text-decoration: none; color: inherit;
    border: 1px solid #eee; border-radius: 8px; overflow: hidden; transition: box-shadow .2s;
}
.awoo-rv-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.1); }
.awoo-rv-img { width: 140px; height: 140px; background: #f9f9f9; }
.awoo-rv-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.awoo-rv-name { font-size: 12px; padding: 8px 8px 2px; line-height: 1.3; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.awoo-rv-price { font-size: 13px; font-weight: 600; color: #e53935; padding: 2px 8px 8px; }

/* ═══════════ BACK TO RESULTS ═══════════ */
.awoo-back-link {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 13px; color: #1565c0; text-decoration: none; margin-bottom: 12px;
}
.awoo-back-link:hover { text-decoration: underline; }
.awoo-back-link svg { width: 14px; height: 14px; }

/* ═══════════ PRICE PER UNIT ═══════════ */
.awoo-per-unit { font-size: 11px; color: #888; font-weight: 400; margin-left: 4px; }
.awoo-card .awoo-per-unit { display: block; margin-left: 0; margin-top: 2px; }

/* ═══════════ RELATED PRODUCTS ═══════════ */
.awoo-related-section { margin-top: 50px; padding-top: 30px; border-top: 1px solid #eee; }
.awoo-related-title { font-size: 18px; font-weight: 600; margin: 0 0 20px; color: #333; }
.awoo-related-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.awoo-related-card {
    border: 1px solid #eee; border-radius: 8px; overflow: hidden;
    text-decoration: none; color: inherit; transition: box-shadow .2s;
}
.awoo-related-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.1); }
.awoo-related-card img { width: 100%; height: auto; display: block; }
.awoo-related-card-body { padding: 12px; }
.awoo-related-card-title { font-size: 13px; font-weight: 500; line-height: 1.3; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.awoo-related-card-price { font-size: 14px; font-weight: 600; color: #e53935; }

/* ═══════════ AJAX ADD SUCCESS ═══════════ */
.awoo-btn-success {
    background: #43a047 !important; color: #fff !important;
    pointer-events: none;
}
.awoo-spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
    border-radius: 50%; animation: awoo-spin .6s linear infinite;
}
@keyframes awoo-spin { to { transform: rotate(360deg); } }
