/* ปก การ์ดสินค้า แถบชวนทัก และ footer ใช้ร่วมกันทั้งหน้าแรกและหน้ารีวิว */

/* ---------- ปก ---------- */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    height: clamp(320px, 58vh, 460px);
    margin: 0 var(--gutter);
    padding: 18px;
    border-radius: 28px;
    background: linear-gradient(140deg, #26262b, #0d0d10);
    color: #fff;
}

.hero-media {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 42% 18%;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity .6s ease, transform 1.4s var(--ease-out);
}

.hero-media.is-shown {
    opacity: 1;
    transform: none;
}

.hero-shade {
    position: absolute;
    inset: 25% 0 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(0, 0, 0, .8), rgba(0, 0, 0, .55) 30%, rgba(0, 0, 0, .22) 62%, rgba(0, 0, 0, .06) 84%, transparent);
}

.hero-copy {
    min-width: 0;
}

.hero-copy p {
    font-family: var(--font-fight);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: .3em;
    text-transform: uppercase;
    opacity: .9;
}

.hero-copy h1 {
    font-family: var(--font-fight);
    font-size: clamp(2.7rem, 12vw, 6.2rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: .03em;
}

.hero-about {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    width: 44px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #111114;
    font-size: 13.5px;
    font-weight: 500;
    transition: transform .45s var(--spring);
}

.hero-about span {
    display: none;
}

.hero-about:active {
    transform: scale(.92);
    transition-duration: .1s;
}

@media (min-width: 640px) {
    .hero {
        padding: 28px;
    }

    .hero-about {
        width: auto;
        padding: 0 18px 0 14px;
    }

    .hero-about span {
        display: inline;
    }
}

@media (min-width: 1024px) {
    .hero {
        height: min(68vh, 640px);
        padding: 40px;
    }
}

@media (min-width: 1440px) {
    .hero {
        max-width: 1408px;
        margin-inline: auto;
    }
}

/* ---------- หัวข้อส่วนต่างๆ ---------- */
.sec-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sec-head h2 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
}

.sec-head small {
    font-size: 13px;
    color: var(--ink-3);
}

.sec-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-2);
}

@media (min-width: 1024px) {
    .sec-head h2 {
        font-size: 24px;
    }
}

/* ---------- การ์ดสินค้า: รูปนำ ราคาเด่นสุดในส่วนข้อความ ชื่อรอง คำรีวิวเบาสุด ---------- */
.catalog {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.card {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: left;
    transition: transform .45s var(--spring), box-shadow .3s ease;
}

.card.is-new {
    animation: card-in .55s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 38ms);
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.97);
    }
}

.card:active {
    transform: scale(.965);
    transition-duration: .1s;
}

.card-media {
    position: relative;
    display: block;
    flex: none;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--surface-2);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .35s ease, transform .6s var(--ease-out);
}

.card-media img.is-loaded {
    opacity: 1;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .68);
    color: #fff;
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}

.tag .icon {
    font-size: 9.5px;
}

.tag--new {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--red);
    font-weight: 600;
}

.card-facts {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    display: flex;
    gap: 4px;
    overflow: hidden;
}

.card-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 12px 12px;
}

.card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.35;
    color: var(--ink-2);
}

.card-quote {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 6px;
    padding-left: 8px;
    border-left: 2px solid var(--line);
    font-family: var(--font-text);
    font-size: 13px;
    line-height: 1.4;
    color: var(--ink-3);
}

.card-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

.card-price {
    min-width: 0;
    line-height: 1.15;
    color: var(--ink);
}

.card-price small {
    display: block;
    font-size: 11px;
    color: var(--ink-3);
}

.card-price b {
    font-size: 19px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
}

:root[data-platform="shopee"] .card-price b {
    color: var(--shopee);
}

.card-go {
    display: grid;
    flex: none;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 11px;
    transition: transform .45s var(--spring), background-color .2s, color .2s;
}

@media (hover: hover) {
    .card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lift);
    }

    .card:hover .card-media img {
        transform: scale(1.05);
    }

    .card:hover .card-go {
        background: var(--accent);
        color: var(--on-accent);
        transform: translateX(2px);
    }
}

@media (min-width: 640px) {
    .catalog {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .catalog {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px;
    }

    .card-text {
        padding: 13px 15px 15px;
    }

    .card-title {
        font-size: 15px;
    }

    .card-price b {
        font-size: 21px;
    }
}

/* โครงการ์ดระหว่างรอข้อมูล */
.card--skeleton {
    pointer-events: none;
    box-shadow: none;
}

.card--skeleton .card-media,
.card--skeleton i {
    position: relative;
    overflow: hidden;
    display: block;
    background: var(--surface-2);
}

.card--skeleton i {
    height: 12px;
    border-radius: 6px;
    margin-top: 8px;
}

.card--skeleton i:first-child {
    margin-top: 0;
}

.card--skeleton i:last-child {
    width: 45%;
}

.card--skeleton .card-media::after,
.card--skeleton i::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, var(--line) 50%, transparent 80%);
    animation: shimmer 1.3s infinite linear;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* ---------- แถบชวนทัก LINE ---------- */
.cta {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 20px;
    border-radius: 24px;
    background: var(--surface-2);
    color: var(--ink);
}

.cta h2 {
    font-size: 21px;
    font-weight: 600;
    line-height: 1.3;
}

.cta p {
    margin-top: 4px;
    font-family: var(--font-text);
    font-size: 15px;
    color: var(--ink-2);
}

.cta-btn {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 14px;
    background: var(--line-green);
    color: #fff;
    font-weight: 600;
    transition: transform .4s var(--spring);
}

.cta-btn:active {
    transform: scale(.96);
    transition-duration: .1s;
}

@media (min-width: 720px) {
    .cta {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 28px 32px;
    }
}

/* ---------- Footer ---------- */
.foot {
    margin-top: 40px;
    padding: 28px var(--gutter) calc(24px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.foot-in {
    display: grid;
    gap: 20px;
    max-width: 1280px;
    margin: 0 auto;
}

.foot-brand b {
    display: block;
    font-size: 18px;
    font-weight: 800;
}

.foot-brand p {
    margin-top: 2px;
    font-family: var(--font-text);
    font-size: 14px;
    color: var(--ink-3);
}

.foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    font-size: 14px;
    color: var(--ink-2);
}

.foot-links a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
}

.foot-social {
    display: flex;
    gap: 8px;
}

.foot-social .icon-btn {
    background: var(--surface-2);
    border: 0;
    font-size: 16px;
}

.foot small {
    display: block;
    font-size: 12px;
    color: var(--ink-3);
}

@media (min-width: 900px) {
    .foot-in {
        grid-template-columns: 1fr auto auto;
        align-items: center;
        gap: 32px;
    }

    .foot small {
        grid-column: 1 / -1;
    }
}

/* ค่อยๆ ขึ้นตามการเลื่อน เฉพาะเบราว์เซอร์ที่รองรับ เบราว์เซอร์อื่นแสดงปกติ */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .reveal {
            animation: rise linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 45%;
        }
    }
}
