/**
 * home.css — Diseño tipo Temu para modasnancy
 * Mobile-first, app-native. Cards 2-col, badges, ratings.
 */

/* ── SEARCH BAR ──────────────────────────────────────────────────────────── */
.search-section {
    background: white;
    padding: 0.5rem 1rem;
    position: sticky;
    top: 0;
    z-index: 900;
    border-bottom: 1px solid #f0f0f0;
}
.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.search-input-wrap {
    flex: 1;
    position: relative;
}
.search-input-wrap input {
    width: 100%;
    padding: 0.65rem 2.5rem 0.65rem 1rem;
    border: 1.5px solid #333;
    border-radius: 24px;
    background: white;
    font-size: var(--fs-small);
    transition: border-color 0.2s;
    -webkit-appearance: none;
}
.search-input-wrap input:focus {
    outline: none;
    border-color: var(--primary-color);
}
.search-input-wrap .search-icon {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
.search-camera {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    flex-shrink: 0;
}

/* ── CATEGORY TABS ───────────────────────────────────────────────────────── */
.cat-tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 0 0.75rem;
    background: white;
    border-bottom: 1px solid #f0f0f0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
    flex-shrink: 0;
    padding: 0.65rem 0.9rem;
    font-size: var(--fs-small);
    font-weight: 500;
    color: #666;
    border-bottom: 2.5px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s;
    min-height: 40px;
    display: flex;
    align-items: center;
}
.cat-tab.active {
    color: #000;
    font-weight: 700;
    border-bottom-color: #000;
}

/* ── TRUST BANNER ────────────────────────────────────────────────────────── */
.trust-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f6ffed;
    border-bottom: 1px solid #d9f7be;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.trust-banner::-webkit-scrollbar { display: none; }
.trust-item-inline {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: var(--fs-small);
    color: #52c41a;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.trust-item-inline svg { width: 16px; height: 16px; }
.trust-arrow {
    color: #52c41a;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── CATEGORY CIRCLES ────────────────────────────────────────────────────── */
.cat-circles {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding: 0.75rem 1rem;
    background: white;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid #f5f5f5;
}
.cat-circles::-webkit-scrollbar { display: none; }
.cat-circle {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
    width: 76px;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.cat-circle:active { transform: scale(0.92); }
.cat-circle__img {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(0,0,0,0.04);
    background: linear-gradient(135deg, #f8f8f8, #f0f0f0);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease;
}
.cat-circle:hover .cat-circle__img {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.cat-circle__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cat-circle__icon {
    font-size: 1.6rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}
.cat-circle__label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #444;
    line-height: 1.2;
    max-width: 68px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cat-circle.active .cat-circle__img {
    box-shadow: 0 0 0 2.5px var(--primary-color), 0 4px 12px rgba(0,0,0,0.1);
}
.cat-circle.active .cat-circle__label {
    color: var(--primary-color);
}
.cat-circle--all .cat-circle__img {
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
}
.cat-circle--all .cat-circle__label {
    color: #333;
}
.cat-circle.active .cat-circle__img {
    box-shadow: 0 0 0 2.5px var(--primary-color);
    border-color: var(--primary-color);
}

/* ── PRODUCT GRID TEMU ───────────────────────────────────────────────────── */
.products-temu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f5f5f5;
}
@media (min-width: 480px) { .products-temu { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; padding: 0.75rem; } }
@media (min-width: 768px) { .products-temu { grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 1rem; } }

.product-temu {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}
.product-temu__img-wrap {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8f8f8;
}
.product-temu__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-temu__ad-label {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.55);
    color: white;
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

/* Badges on image */
.product-temu__badge-img {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 3px;
}
.product-temu__badge-img--sale {
    background: linear-gradient(90deg, #ff4d4f, #ff7875);
    color: white;
}
.product-temu__badge-img--flash {
    background: linear-gradient(90deg, #fa8c16, #ffc53d);
    color: white;
}

/* Info */
.product-temu__info { padding: 0.5rem 0.6rem 0.6rem; }
.product-temu__title {
    font-size: var(--fs-small);
    color: #333;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.3rem;
    min-height: 2.4em;
}

/* Rating row */
.product-temu__rating {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}
.product-temu__stars {
    display: flex;
    gap: 1px;
}
.product-temu__stars svg { width: 10px; height: 10px; }
.product-temu__sold {
    font-size: 0.6rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Price row */
.product-temu__price-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}
.product-temu__price {
    font-size: 1rem;
    font-weight: 700;
    color: #000;
}
.product-temu__price-old {
    font-size: var(--fs-tiny);
    color: #999;
    text-decoration: line-through;
}
.product-temu__price-discount {
    font-size: var(--fs-tiny);
    color: #ff4d4f;
    font-weight: 600;
}

/* Urgency */
.product-temu__urgency {
    font-size: 0.6rem;
    color: #fa8c16;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-bottom: 0.3rem;
}
.product-temu__urgency svg { width: 12px; height: 12px; }

/* Cart button */
.product-temu__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.2rem;
}
.product-temu__cart-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid #333;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all 0.15s;
    flex-shrink: 0;
}
.product-temu__cart-btn:hover {
    background: #333;
    color: white;
}
.product-temu__cart-btn:active { transform: scale(0.92); }

/* ── RESPONSIVE DESKTOP ──────────────────────────────────────────────────── */
@media (min-width: 1024px) {
    .search-section { padding: 0.75rem 2rem; }
    .search-bar { max-width: 800px; margin: 0 auto; }
    .cat-tabs { justify-content: center; max-width: 1400px; margin: 0 auto; padding-left: 2rem; padding-right: 2rem; }
    .trust-banner { justify-content: center; max-width: 1400px; margin: 0 auto; padding-left: 2rem; padding-right: 2rem; }
    .cat-circles { justify-content: center; flex-wrap: wrap; gap: 1rem; overflow-x: visible; max-width: 1400px; margin: 0 auto; padding-left: 2rem; padding-right: 2rem; }
    .cat-circle { width: 90px; }
    .cat-circle__img { width: 72px; height: 72px; }
    .cat-circle__label { font-size: 0.7rem; max-width: 80px; }
    .products-temu {
        grid-template-columns: repeat(5, 1fr);
        gap: 1rem;
        padding: 1rem 2rem;
        max-width: 1400px;
        margin: 0 auto;
    }
}
@media (min-width: 1440px) {
    .products-temu { grid-template-columns: repeat(6, 1fr); }
}

/* ── BOTTOM NAV TEMU ─────────────────────────────────────────────────────── */
.bottom-nav-temu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 950;
    background: white;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
    height: calc(56px + env(safe-area-inset-bottom));
}
.bottom-nav-temu__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 2px 0;
    font-size: 0.6rem;
    font-weight: 500;
    color: #999;
    transition: color 0.15s;
    min-height: 44px;
    position: relative;
}
.bottom-nav-temu__item.active { color: #000; }
.bottom-nav-temu__item svg { stroke-width: 1.5; }
.bottom-nav-temu__badge {
    position: absolute;
    top: -2px;
    right: calc(50% - 14px);
    background: #ff4d4f;
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.bottom-nav-temu__tag {
    position: absolute;
    top: -8px;
    right: 2px;
    background: #52c41a;
    color: white;
    font-size: 0.5rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 8px;
    white-space: nowrap;
}
