:root {
    --bg: #f8fafc; /* page background (white-ish) */
    --card: #ffffff; /* card background (white) */
    --text: #0f172a; /* primary text (slate-900) */
    --muted: #475569; /* secondary text (slate-600) */
    --primary: #0076be; /* accent blue (custom) */
}

/* Global responsive safety */
img {
    max-width: 100%;
    height: auto;
    display: block;
}
.hero-title,
.hero-subtitle {
    word-break: break-word;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        "Anuphan",
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        "Noto Sans",
        "Liberation Sans",
        sans-serif;
    background: var(--bg);
    color: var(--text);
    position: relative;
    z-index: 0;
}

/* Decorative background layer: soft blue glows + subtle dot grid */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(700px 500px at 12% 10%, rgba(0, 118, 190, 0.14), transparent 60%),
        radial-gradient(700px 500px at 88% 8%, rgba(0, 118, 190, 0.1), transparent 60%),
        radial-gradient(600px 450px at 50% 120%, rgba(0, 118, 190, 0.08), transparent 60%),
        radial-gradient(rgba(0, 118, 190, 0.08) 1px, transparent 1px);
    background-size:
        auto,
        auto,
        auto,
        22px 22px;
    background-position: center;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 16px 64px;
}

/* Top header bar with brand */
.topbar {
    background: #fff;
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 6px 18px rgba(2, 8, 23, 0.06);
}
.topbar .container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-top: 10px;
    padding-bottom: 10px;
}
.topbar .subtitle {
    font-size: 20px;
    color: #000;
    margin-left: auto;
}
.brand {
    width: 150px;
    height: auto;
    display: block;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

/* Header action buttons grouped */
.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.subtitle {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.5;
}

.hero {
    margin: 15px 0 0;
}
.hero-title {
    font-size: 34px;
    line-height: 1.25;
}
.hero-subtitle {
    margin-top: 10px;
    margin-bottom: 20px;
}
.section-title {
    margin-top: 6px;
    margin-bottom: 20px;
}

/* Hero lists (index page) */
.hero-list {
    margin: 6px 0 14px;
    padding-left: 22px;
    color: var(--muted);
}
.hero-list > li {
    margin: 6px 0;
}
.hero-list ul {
    margin: 6px 0 8px;
    padding-left: 18px;
    list-style: disc;
}
.hero-ol {
    list-style: decimal;
    padding-left: 22px;
    margin-bottom: 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 24px; /* more space between cards */
}

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

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

.card {
    background: var(--card);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    padding: 20px; /* more inner spacing */
    display: flex;
    flex-direction: column;
    gap: 16px; /* more spacing between elements inside card */
    box-shadow: 0 6px 18px rgba(2, 8, 23, 0.06);
    transition:
        transform 0.22s ease,
        box-shadow 0.28s ease,
        border-color 0.22s ease,
        background-color 0.22s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0, 118, 190, 0.2);
    border-color: rgba(0, 118, 190, 0.28);
}

.card:active {
    transform: translateY(-2px);
}

/* Disable hover interactions for sections explicitly marked as no-hover */
.no-hover .card:hover,
.card.no-hover:hover {
    transform: none;
    box-shadow: 0 6px 18px rgba(2, 8, 23, 0.06);
    border-color: rgba(15, 23, 42, 0.08);
}

.name {
    font-size: 18px;
    font-weight: 700;
    margin-top: 15px;
}

.desc {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65; /* improve readability with more leading */
    margin: 0;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.btn {
    appearance: none;
    border: 0;
    background: var(--primary);
    color: #ffffff;
    font-weight: 400;
    padding: 10px 14px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 118, 190, 0.25);
    transition:
        transform 0.06s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
    text-decoration: none; /* remove underline for anchor buttons */
    border-radius: 50px;
}

.btn:hover {
    filter: brightness(1.03);
    box-shadow: 0 10px 24px rgba(0, 118, 190, 0.35);
    text-decoration: none; /* keep no underline on hover */
}

.btn:active {
    transform: translateY(1px) scale(0.995);
}

/* Make entire card clickable links look like plain content */
.card > a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 12px; /* space between thumb, name, and desc */
}

footer {
    margin-top: 28px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
footer a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}
footer a:hover {
    text-decoration: none;
    color: #005b94;
}

/* Product detail page (replaces inline styles) */
.product-detail {
    grid-column: 1 / -1;
    overflow-x: auto;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 16px;
}

.detail-thumb {
    height: 260px;
    display: grid;
    place-items: center;
    font-size: 24px;
}

/* Thumbnail used in compare table header */
.table-thumb {
    height: 110px;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.detail-name {
    font-size: 22px;
}
.detail-desc {
    font-size: 18px;
    margin-top: 6px;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
.spec-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.spec-table tbody tr:last-child td {
    border-bottom: 0;
}
.spec-table td:first-child {
    color: var(--muted);
    font-weight: 600;
    color: #000;
}

/* Utility: negative / unsupported value */
.neg {
    color: #dc2626; /* red-600 */
    font-weight: 700;
}

/* Utility: positive / supported value */
.pos {
    color: #16a34a; /* green-600 */
    font-weight: 700;
}

.w-100 {
    width: 100%;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .container {
        padding: 20px 12px 40px;
    }
    .topbar .container {
        padding-top: 8px;
        padding-bottom: 8px;
        flex-wrap: wrap;
        row-gap: 6px;
    }
    .brand {
        width: 120px;
    }
    .topbar .subtitle {
        font-size: 14px;
        line-height: 1.3;
        max-width: 60%;
        margin-left: auto;
        text-align: right;
    }
    .hero-title {
        font-size: 28px;
    }
    .hero-subtitle {
        font-size: 14px;
    }
    .grid {
        gap: 16px;
    }
    .hero-list {
        padding-left: 18px;
    }
    .actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    .card {
        padding: 16px;
    }
    .spec-table td {
        padding: 8px 6px;
    }
    .spec-table {
        font-size: 14px;
    }
    footer {
        font-size: 12px;
    }
    .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 400px) {
    .brand {
        width: 100px;
    }
    .hero-title {
        font-size: 22px;
    }
}

.mb-0 {
    margin-bottom: 0;
}
