/* =========================
   HOME PAGE (LIGHT + ATTRACTIVE)
   Scope: body[data-page="home"] to avoid breaking other pages
========================= */

body[data-page="home"] {
    --h-text: #0b0f17;
    --h-line: rgba(15, 23, 42, 0.12);
    --h-soft: rgba(15, 23, 42, 0.06);

    --h-yellow: #fcd200;
    --h-yellow2: #ffea61;
    --h-green: #22c55e;

    --h-radius: 18px;
    --h-shadow: 0 10px 22px rgba(2, 6, 23, 0.08);
    --h-shadow2: 0 18px 40px rgba(2, 6, 23, 0.10);
}

/* ================= TOP STICKY BANNER ================= */
body[data-page="home"] .vionex-top-banner {
    position: sticky;
    top: 64px;
    z-index: 998;
    width: 100%;
    background: linear-gradient(90deg, var(--h-yellow2), var(--h-green));
    color: #111;
    font-size: 14px;
}

body[data-page="home"] .vionex-top-banner .banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
}

body[data-page="home"] .vionex-top-banner .banner-text {
    font-weight: 700;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
}

body[data-page="home"] .vionex-top-banner .banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

body[data-page="home"] .vionex-top-banner .banner-btn {
    background: #111;
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    text-decoration: none;
    font-weight: 800;
    white-space: nowrap;
}

body[data-page="home"] .vionex-top-banner .banner-btn.outline {
    background: transparent;
    border: 1px solid #111;
    color: #111;
}

@media (max-width: 768px) {
    body[data-page="home"] .vionex-top-banner {
        top: 56px;
    }

    body[data-page="home"] .vionex-top-banner .banner-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    body[data-page="home"] .vionex-top-banner .banner-actions {
        width: 100%;
    }

    body[data-page="home"] .vionex-top-banner .banner-btn {
        flex: 1;
        text-align: center;
    }
}

/* ================= SEARCH BAR ================= */
body[data-page="home"] .search-wrap {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--h-soft);
    padding: 10px 12px;
}

body[data-page="home"] .search-form {
    display: flex;
    gap: 10px;
    max-width: 1180px;
    margin: 0 auto;
}

body[data-page="home"] .search-form input {
    flex: 1;
    padding: 12px 14px;
    border-radius: 999px;
    border: 1px solid var(--h-line);
    font-size: 14px;
    outline: none;
    background: #fff;
}

body[data-page="home"] .search-form input:focus {
    border-color: rgba(252, 210, 0, 0.7);
    box-shadow: 0 0 0 4px rgba(252, 210, 0, 0.18);
}

body[data-page="home"] .search-form button {
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid rgba(252, 210, 0, 0.6);
    background: linear-gradient(135deg, var(--h-yellow2), var(--h-yellow));
    font-weight: 900;
    cursor: pointer;
}

/* ================= TITLE ================= */
body[data-page="home"] .home-title {
    width: min(1180px, calc(100% - 32px));
    margin: 14px auto 10px;
    font-size: clamp(16px, 2.2vw, 22px);
    font-weight: 900;
    letter-spacing: -0.01em;
    color: var(--h-text);
}

/* ================= PRODUCTS GRID ================= */
body[data-page="home"] .products {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 28px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

body[data-page="home"] .product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

body[data-page="home"] .product {
    position: relative;
    background: #fff;
    border: 1px solid var(--h-line);
    border-radius: var(--h-radius);
    overflow: hidden;
    box-shadow: var(--h-shadow);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

body[data-page="home"] .product::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--h-yellow2), var(--h-yellow));
    z-index: 1;
}

body[data-page="home"] .product-media {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(15, 23, 42, 0.04);
    display: grid;
    place-items: center;
    overflow: hidden;
}

body[data-page="home"] .product-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    background: #fff;
}

body[data-page="home"] .product-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    color: #9ca3af;
}

body[data-page="home"] .product-body {
    padding: 10px 12px 14px;
    display: grid;
    gap: 8px;
}

body[data-page="home"] .product-name {
    margin: 0;
    font-size: 12.6px;
    font-weight: 900;
    color: rgba(11, 15, 23, 0.92);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 34px;
}

body[data-page="home"] .product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

body[data-page="home"] .price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12.2px;
    font-weight: 900;
    color: var(--h-text);
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(252, 210, 0, 0.35);
    background: rgba(252, 210, 0, 0.14);
}

@media (hover: hover) {
    body[data-page="home"] .product-link:hover .product {
        transform: translateY(-2px);
        border-color: rgba(252, 210, 0, 0.55);
        box-shadow: var(--h-shadow2);
    }
}

@media (max-width: 520px) {
    body[data-page="home"] .products {
        width: calc(100% - 16px);
        gap: 10px;
    }

    body[data-page="home"] .product-body {
        padding: 8px 10px 12px;
    }

    body[data-page="home"] .product-name {
        font-size: 12px;
    }

    body[data-page="home"] .price {
        font-size: 11.4px;
        padding: 6px 8px;
    }
}

@media (max-width: 360px) {
    body[data-page="home"] .products {
        gap: 8px;
    }

    body[data-page="home"] .product-media {
        aspect-ratio: 4 / 5;
    }
}

/* ================= CHAT WIDGET (LIGHT) ================= */
body[data-page="home"] #chat-widget {
    position: fixed;
    bottom: 18px;
    left: 18px;
    z-index: 9999;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

body[data-page="home"] #chat-button {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    cursor: pointer;
    user-select: none;

    background: linear-gradient(135deg, var(--h-yellow2), var(--h-yellow));
    color: #111;
    font-size: 24px;
    font-weight: 900;
    border: 1px solid rgba(252, 210, 0, 0.65);
    box-shadow: 0 14px 34px rgba(17, 24, 39, 0.18);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

body[data-page="home"] #chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(17, 24, 39, 0.22);
    filter: brightness(1.02);
}

body[data-page="home"] #chat-box {
    width: 360px;
    height: 520px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 20px;
    border: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: 0 24px 70px rgba(17, 24, 39, 0.22);
    backdrop-filter: blur(12px);
    position: absolute;
    bottom: 72px;
    left: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

body[data-page="home"] .chat-header {
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: #0f172a;
    color: #fff;
}

body[data-page="home"] .chat-header small {
    color: rgba(255, 255, 255, 0.8);
}

body[data-page="home"] .chat-header small::before {
    content: "●";
    color: var(--h-green);
    margin-right: 8px;
    font-size: 10px;
}

body[data-page="home"] #chat-close {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

body[data-page="home"] .chat-body {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: #ffffff;
}

body[data-page="home"] .bot-msg,
body[data-page="home"] .user-msg {
    max-width: 92%;
    padding: 11px 12px;
    border-radius: 16px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.55;
    border: 1px solid rgba(229, 231, 235, 0.9);
    box-shadow: 0 8px 14px rgba(17, 24, 39, 0.06);
}

body[data-page="home"] .bot-msg {
    background: rgba(252, 210, 0, 0.14);
    border-left: 4px solid rgba(252, 210, 0, 0.9);
}

body[data-page="home"] .user-msg {
    margin-left: auto;
    text-align: right;
    background: rgba(37, 99, 235, 0.10);
    border-right: 4px solid rgba(37, 99, 235, 0.55);
}

body[data-page="home"] .options {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body[data-page="home"] .options button {
    flex: 1 1 calc(50% - 10px);
    min-width: 140px;
    border: 1px solid rgba(229, 231, 235, 0.9);
    background: #ffffff;
    color: #111827;
    padding: 10px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
    box-shadow: 0 8px 14px rgba(17, 24, 39, 0.06);
}

body[data-page="home"] .options button:hover {
    transform: translateY(-1px);
    border-color: rgba(252, 210, 0, 0.65);
    box-shadow: 0 12px 18px rgba(17, 24, 39, 0.09);
}

body[data-page="home"] .chat-input {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid rgba(229, 231, 235, 0.95);
    background: rgba(255, 255, 255, 0.96);
}

body[data-page="home"] .chat-input input {
    flex: 1;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(229, 231, 235, 0.95);
    outline: none;
    font-size: 14.5px;
}

body[data-page="home"] .chat-input button {
    width: 46px;
    min-width: 46px;
    height: 46px;
    border: 1px solid rgba(252, 210, 0, 0.65);
    border-radius: 14px;
    cursor: pointer;
    font-weight: 900;
    background: linear-gradient(135deg, var(--h-yellow2), var(--h-yellow));
    color: #111;
}

@media (max-width: 520px) {
    body[data-page="home"] #chat-widget {
        left: 14px;
        right: 14px;
        bottom: 14px;
    }

    body[data-page="home"] #chat-box {
        width: calc(100vw - 28px);
        height: min(72vh, 540px);
        left: 0;
        right: 0;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    body[data-page="home"] #chat-button,
    body[data-page="home"] .product,
    body[data-page="home"] .options button {
        transition: none;
    }
}