:root {
    --primary: #6366f1;
    --primary-rgb: 99, 102, 241;
    --primary-hover: #4f46e5;
    --secondary: #0ea5e9;
    --bg-main: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-glass: rgba(0, 0, 0, 0.08);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

.text-gradient {
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Glassmorphism utility */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 1rem;
}

/* Hero Section */
.hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding-top: 4rem;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 2rem;
}

/* Grid layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

/* Cards */
.card {
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.card .icon {
    width: 3rem;
    height: 3rem;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* Buttons */
button,
.btn {
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.highlight-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 2rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(0);
}

.highlight-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.6);
}

.highlight-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 1rem 2.5rem;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(0);
    transition: all 0.3s ease;
    text-decoration: none;
}

.secondary-btn:hover {
    background: rgba(var(--primary-rgb), 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.secondary-btn:active {
    transform: translateY(0);
}

.filter-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    padding: 0.75rem 1.5rem;
    border-radius: 1.5rem;
    color: var(--text-muted);
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

/* Navigation & Header */
header {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Common Footer */
footer {
    margin-top: 8rem;
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-glass);
}

footer a {
    color: inherit;
    text-decoration: underline;
}

/* Device Cards within Grid */
.device-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
}

.device-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f8fafc;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.device-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.device-card p {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.device-card .badge {
    align-self: flex-start;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }

    .hero h1 {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header nav {
        height: auto;
        padding: 1rem 0;
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1.5rem;
        width: 100%;
        justify-content: center;
    }

    .nav-links a {
        font-size: 0.9rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    footer {
        margin-top: 4rem;
        padding: 3rem 1rem;
    }

    /* Susume Section Responsive */
    #susume article {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1.5rem !important;
    }

    #susume .icon {
        margin: 0 auto 1.5rem;
    }
}

/* Lightbox / Image Zoom */
.zoomable-img {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.zoomable-img:hover {
    transform: scale(1.01);
}

#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: zoom-out;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

#lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 0.5rem;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#lightbox-overlay.active img {
    transform: scale(1);
}

/* Cart & Quote Features */
.cart-floating-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 4rem;
    height: 4rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(var(--primary-rgb), 0.4);
    z-index: 1001;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-floating-btn:hover {
    transform: scale(1.1) translateY(-5px);
    background: var(--primary-hover);
}

.cart-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.price-container {
    background: rgba(0, 0, 0, 0.03);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.price-value {
    font-weight: 700;
    color: var(--text-main);
}

.cart-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: auto;
}

.cart-add-btn {
    padding: 0.75rem;
    font-size: 0.85rem;
    border-radius: 0.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.cart-add-btn:hover {
    background: var(--primary);
    color: white;
}

.cart-add-btn.rental {
    background: var(--secondary);
    border-color: var(--secondary);
    color: white;
}

.cart-add-btn.rental:hover {
    filter: brightness(1.1);
}
/* ============================================================ */
/* Catalog / Quote (見積カタログ)                                */
/* ============================================================ */
.catalog-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    align-items: start;
}

.catalog-search {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.catalog-search input[type="search"] {
    flex: 1;
    min-width: 220px;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--border-glass);
    border-radius: 1.5rem;
    font-size: 1rem;
    font-family: var(--font-body);
    outline: none;
    background: #fff;
}

.catalog-search input[type="search"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.facets {
    position: sticky;
    top: 90px;
    padding: 1.25rem;
}

.facet-group { margin-bottom: 1.5rem; }
.facet-group h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}
.facet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
}
.facet-item:hover { background: rgba(var(--primary-rgb), 0.08); }
.facet-item.active { background: var(--primary); color: #fff; }
.facet-item .count { font-size: 0.78rem; color: var(--text-muted); }
.facet-item.active .count { color: rgba(255,255,255,0.85); }

.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 0;
}

.product-card {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.product-card .thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f8fafc;
    border-radius: 0.6rem;
    margin-bottom: 0.9rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-card .thumb img,
.product-card .thumb svg { width: 100%; height: 100%; object-fit: contain; }
.product-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 1rem;
    background: rgba(var(--primary-rgb), 0.12);
    color: var(--primary);
}
.tag.mfr { background: rgba(14, 165, 233, 0.14); color: #0369a1; }
.tag.knx { background: rgba(16, 185, 129, 0.14); color: #047857; }
.product-card h3 { font-size: 1.02rem; margin-bottom: 0.35rem; line-height: 1.35; }
.product-card .model { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.product-card .variant-note { font-size: 0.78rem; color: var(--text-muted); margin-top: auto; }

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.pagination button {
    padding: 0.5rem 0.9rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-glass);
    background: #fff;
    color: var(--text-main);
    font-weight: 600;
}
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: default; }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.product-detail .gallery {
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    border-radius: 1rem;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.product-detail .gallery img,
.product-detail .gallery svg { width: 100%; height: 100%; object-fit: contain; }
.spec-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.spec-table th, .spec-table td {
    text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border-glass);
    font-size: 0.9rem; vertical-align: top;
}
.spec-table th { color: var(--text-muted); width: 35%; font-weight: 600; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.field select, .field input, .field textarea {
    width: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--border-glass);
    border-radius: 0.6rem; font-size: 0.95rem; font-family: var(--font-body); background: #fff;
}
.qty-row { display: flex; gap: 0.75rem; align-items: flex-end; }
.qty-row .field { flex: 1; margin-bottom: 0; }

/* Quote cart table */
.quote-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.quote-table th, .quote-table td {
    padding: 0.75rem 0.6rem; border-bottom: 1px solid var(--border-glass);
    font-size: 0.9rem; text-align: left;
}
.quote-table th { color: var(--text-muted); font-weight: 600; }
.quote-table input[type="number"] { width: 70px; padding: 0.4rem; border: 1px solid var(--border-glass); border-radius: 0.4rem; }
.link-btn { background: none; border: none; color: #ef4444; cursor: pointer; font-size: 0.85rem; text-decoration: underline; }

.toast {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
    background: #1e293b; color: #fff; padding: 0.85rem 1.5rem; border-radius: 2rem;
    box-shadow: var(--shadow-md); z-index: 3000; opacity: 0; transition: opacity 0.3s, transform 0.3s;
    pointer-events: none; font-size: 0.9rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-0.5rem); }

@media (max-width: 900px) {
    .catalog-layout { grid-template-columns: 1fr; }
    .facets { position: static; }
    .product-detail { grid-template-columns: 1fr; }
}

/* Multi-select filter additions */
.facet-list { max-height: 230px; overflow-y: auto; margin: 0 -0.3rem; padding: 0 0.3rem; }
.facet-search {
    width: 100%; padding: 0.4rem 0.6rem; margin-bottom: 0.5rem; font-size: 0.85rem;
    border: 1px solid var(--border-glass); border-radius: 0.4rem; background: #fff;
}
.facet-item .check {
    display: inline-block; width: 14px; height: 14px; border: 1.5px solid var(--border-glass);
    border-radius: 3px; margin-right: 0.5rem; flex-shrink: 0; position: relative; top: 2px;
}
.facet-item.active .check { background: #fff; border-color: #fff; }
.facet-item.active .check::after { content: "✓"; color: var(--primary); font-size: 11px; position: absolute; top: -3px; left: 1px; }
.facet-item .label-wrap { display: flex; align-items: center; flex: 1; }
.facet-clear { font-size: 0.78rem; color: var(--primary); cursor: pointer; background: none; border: none; padding: 0; }

.active-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.chip {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.7rem;
    background: rgba(var(--primary-rgb), 0.1); color: var(--primary); border-radius: 1rem;
    font-size: 0.82rem; font-weight: 600;
}
.chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 0.95rem; line-height: 1; padding: 0; }
.chip.clear-all { background: #f1f5f9; color: var(--text-muted); cursor: pointer; }

/* Product-site landing (products.smartlight.co.jp) */
.home-hero { text-align: center; padding: 4rem 1rem 2rem; }
.home-hero h1 { font-size: 2.8rem; margin-bottom: 1rem; }
.home-hero p { color: var(--text-muted); font-size: 1.15rem; max-width: 720px; margin: 0 auto 2rem; }
.home-search { display: flex; max-width: 600px; margin: 0 auto; gap: 0.5rem; }
.home-search input { flex: 1; padding: 0.9rem 1.2rem; border: 1px solid var(--border-glass); border-radius: 2rem; font-size: 1rem; }
.home-search button { padding: 0.9rem 1.8rem; border-radius: 2rem; }
.proto-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin: 1rem 0 3rem; }
.proto-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; padding: 1.5rem 1rem; text-decoration: none; color: inherit; text-align: center; }
.proto-tile .proto-name { font-family: var(--font-heading); font-weight: 800; font-size: 1.2rem; }
.proto-tile .proto-count { font-size: 0.82rem; color: var(--text-muted); }
.home-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin: 2rem 0; }
.home-feature { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.home-feature .card { cursor: default; }
.home-feature h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
@media (max-width: 768px) { .home-hero h1 { font-size: 2rem; } }
