﻿/* ECOVILLE Product Catalog Detail — responsive-first */
@import url('tokens.css');

:root {
    --section-y: clamp(3.5rem, 8vw, 5.5rem);
    --max: min(100% - 2rem, 80rem);
    --narrow: min(100% - 2rem, 47.5rem);
    --text-sub: #555;
    --soft: #fafafa;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body.ep-page {
    background: #fff;
    color: #000;
    line-height: 1.75;
    font-size: var(--font-body);
    padding-top: var(--header-h);
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; width: 100%; height: auto; max-width: 100%; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--container-pad); }
.container-narrow { max-width: var(--narrow); margin: 0 auto; padding: 0 var(--container-pad); }

/* Header — same as homepage */
header {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: var(--header-h);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.header-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--container-pad);
    max-width: 87.5rem;
    margin: 0 auto;
}
.logo-img { height: clamp(2.75rem, 8vw, 3.875rem); width: auto; object-fit: contain; }
.nav-links { display: flex; gap: clamp(1.5rem, 4vw, 3.125rem); }
.nav-links a {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    font-weight: 600;
    text-transform: uppercase;
    color: #333;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}
.nav-links a:hover { color: #000; }
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}
.mobile-menu-toggle span {
    display: block;
    width: 28px;
    height: 2px;
    background: #000;
}

.ep-section { padding: var(--section-y) 0; }
.ep-section--soft { background: var(--soft); }

.ep-hero-category {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.625rem;
}

.ep-eyebrow-ko {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #666;
}

.ep-eyebrow-en {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #aaa;
}

.ep-heading {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
}

.ep-heading-ko {
    font-size: var(--font-h2);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #000;
}

.ep-heading-en {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #999;
}

.ep-text {
    font-size: var(--font-lead);
    color: var(--text-sub);
    line-height: 1.85;
    max-width: 36rem;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Hero — mobile-first height */
.ep-hero {
    margin-top: calc(-1 * var(--header-h));
    padding-top: var(--header-h);
}

.ep-hero-media {
    height: clamp(12rem, 40vh, 22rem);
    overflow: hidden;
    background: #f0f0f0;
}

.ep-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.04);
    transition: transform 1.2s var(--ease);
}

.ep-hero:hover .ep-hero-media img { transform: scale(1.07); }

.ep-hero-caption {
    padding: clamp(1.25rem, 4vw, 2.25rem) var(--container-pad) 0.5rem;
    max-width: var(--max);
    margin: 0 auto;
}

.ep-hero-title {
    font-size: var(--font-h1);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 0.75rem;
}

.ep-hero-intro {
    font-size: var(--font-lead);
    color: var(--text-sub);
    max-width: 32rem;
    line-height: 1.7;
}

/* Overview — mobile 1 col, tablet+ 2 col */
.ep-overview {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}

.ep-overview-photo {
    border-radius: 0.75rem;
    overflow: hidden;
    background: #eee;
}

.ep-overview-photo img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.7s var(--ease);
}

.ep-overview-photo:hover img { transform: scale(1.03); }

.ep-bullets {
    margin-top: 1.5rem;
    display: grid;
    gap: 0.625rem;
}

.ep-bullets li {
    font-size: 0.9375rem;
    padding-left: 1rem;
    position: relative;
    color: #222;
}

.ep-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #000;
}

/* Features */
.ep-feature-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem clamp(1rem, 3vw, 2rem);
}

.ep-feature-item {
    font-size: 1rem;
    font-weight: 600;
    padding: 1.125rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    transition: padding-left 0.3s ease;
}

.ep-feature-item:hover { padding-left: 0.375rem; }

/* Gallery — mobile 1 / tablet 2 / desktop 3 */
.ep-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--grid-gap);
}

.ep-gallery-item {
    border-radius: 0.625rem;
    overflow: hidden;
    background: #eee;
}

.ep-gallery-btn {
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
    display: block;
}

.ep-gallery-btn img {
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.ep-gallery-item:hover img { transform: scale(1.05); }

/* Specification table */
.ep-spec-table-wrap {
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ep-spec-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
}

.ep-spec-table th,
.ep-spec-table td {
    padding: clamp(0.75rem, 2vw, 1rem) clamp(0.875rem, 2.5vw, 1.25rem);
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.ep-spec-table tr:last-child th,
.ep-spec-table tr:last-child td { border-bottom: none; }

.ep-spec-table th {
    width: 34%;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    background: #fafafa;
}

.ep-spec-table tbody tr { transition: background 0.25s ease; }
.ep-spec-table tbody tr:hover { background: rgba(0,0,0,0.02); }

/* Contact */
.ep-contact { text-align: center; padding-bottom: calc(var(--section-y) + 1.5rem); }
.ep-contact-inner { max-width: 35rem; margin: 0 auto; }
.ep-contact .ep-text { margin: 0 auto 1.75rem; }

.ep-contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.ep-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    background: #000;
    color: #fff;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid #000;
    transition: transform 0.3s var(--ease), background 0.3s ease, color 0.3s ease;
}

.ep-btn:hover {
    transform: translateY(-2px);
    background: #fff;
    color: #000;
}

/* Lightbox */
.ep-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.ep-lightbox.is-open { opacity: 1; pointer-events: auto; }
.ep-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
}
.ep-lightbox-stage { position: relative; z-index: 1; margin: 0; }
.ep-lightbox-img {
    max-width: min(92vw, 75rem);
    max-height: 85vh;
    object-fit: contain;
}
.ep-lightbox-close {
    position: absolute;
    top: -2.75rem;
    right: 0;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.375rem;
    cursor: pointer;
}
body.ep-lightbox-open { overflow: hidden; }

/* Footer */
footer {
    padding: clamp(2.5rem, 6vw, 3.75rem) 0;
    text-align: center;
    border-top: 1px solid #eee;
    background: #fff;
}
.footer-brand { font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.5px; color: #000; }
.footer-tagline { font-weight: 400; font-size: 0.8125rem; letter-spacing: 0.08em; color: #555; margin: 0.625rem 0 1.5rem; }
.footer-info-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 2.5rem;
    margin-bottom: 1.75rem;
    max-width: 60rem;
    margin-left: auto;
    margin-right: auto;
}
.footer-info-item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #555;
    font-weight: 300;
}
.footer-info-item strong {
    font-weight: 600;
    color: #333;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-copy { color: #999; font-size: 0.8125rem; }

/* Tablet 768–1199 */
@media (min-width: 768px) {
    .ep-overview {
        grid-template-columns: 1.2fr 1fr;
    }

    .ep-feature-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ep-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Laptop / Desktop 1200+ */
@media (min-width: 1200px) {
    .ep-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Mobile ≤767 */
@media (max-width: 767px) {
    .mobile-menu-toggle { display: flex; }
    header nav { display: none; }
    header.menu-open nav {
        display: block;
        position: absolute;
        top: var(--header-h);
        left: 0; right: 0;
        background: rgba(255,255,255,0.98);
        border-bottom: 1px solid rgba(0,0,0,0.08);
        padding: 1.5rem;
    }
    header.menu-open .nav-links { flex-direction: column; gap: 1.125rem; }

    .ep-spec-table th,
    .ep-spec-table td { display: block; width: 100%; }
    .ep-spec-table th { border-bottom: none; padding-bottom: 0.25rem; }

    .ep-contact-actions { flex-direction: column; align-items: stretch; }
    .ep-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .ep-hero-media img { transform: none; }
}
