@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600&family=Inter:wght@300;400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f7f5f2;
    color: #1a1a18;
    min-height: 100vh;
}

/* ─── Header ─────────────────────────────────────────── */
header {
    background: #fff;
    border-bottom: 1px solid #e8e3db;
    padding: 1.1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.brand-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #1a1a18;
    text-transform: uppercase;
}

.brand-tagline {
    font-size: 0.75rem;
    color: #9a9690;
    letter-spacing: 0.04em;
    font-weight: 400;
}

.header-badge {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7a7570;
    background: #f0ece6;
    border: 1px solid #e0dbd2;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
}

/* ─── Main layout ─────────────────────────────────────── */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.app-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

/* ─── Camera Section ──────────────────────────────────── */
.camera-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #e8e3db;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #ddd8cf;
}

#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    display: none;
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleX(-1);
    pointer-events: none;
}

.camera-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0ece6;
}

.placeholder-content {
    text-align: center;
    color: #b0aa9f;
}

.placeholder-content svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.placeholder-content p {
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    font-weight: 400;
}

/* ─── Measurements overlay (inside video) ────────────── */
.measurements-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.6rem 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.45), transparent);
    display: none;
}

.measurement-grid {
    display: flex;
    gap: 1.2rem;
}

.measurement-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.measurement-label {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
}

.measurement-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
}

/* ─── Camera controls ─────────────────────────────────── */
/* The camera controls live in the header rather than under the video: below the fold they
   had to be scrolled to, which is the first thing a visitor needs. Same reason the brand
   pages moved theirs up. */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-actions .btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.8rem;
}

.btn {
    padding: 0.65rem 1.6rem;
    border: none;
    border-radius: 2px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-primary {
    background: #1a1a18;
    color: #f7f5f2;
}

.btn-primary:hover:not(:disabled) {
    background: #2d2d2b;
}

.btn-secondary {
    background: transparent;
    color: #6b6860;
    border: 1px solid #d0cbc2;
}

.btn-secondary:hover:not(:disabled) {
    border-color: #a09890;
    color: #1a1a18;
}

/* ─── Products Section ────────────────────────────────── */
.products-section {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.products-section h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: #1a1a18;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #e0dbd2;
}

.product-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-card {
    background: #fff;
    border: 1px solid #e8e3db;
    border-radius: 3px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.product-card:hover {
    border-color: #b0aa9f;
    background: #faf8f5;
}

.product-card.selected {
    border-color: #1a1a18;
    background: #faf8f5;
}

.product-card.selected .product-name {
    color: #1a1a18;
}

.product-thumb {
    width: 72px;
    height: 40px;
    border-radius: 2px;
    background: #f0ece6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-weight: 500;
    font-size: 0.85rem;
    color: #2d2d2b;
    letter-spacing: 0.01em;
}

.product-specs {
    font-size: 0.72rem;
    color: #9a9690;
    margin-top: 0.2rem;
    letter-spacing: 0.03em;
}

.product-type-badge {
    font-size: 0.6rem;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    background: #f0ece6;
    color: #9a9690;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    border: 1px solid #e0dbd2;
}

/* ─── Recommendation Panel — hidden ──────────────────── */
.recommendation-panel {
    display: none !important;
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 800px) {
    header {
        padding: 1rem 1.2rem;
    }

    .app-container {
        grid-template-columns: 1fr;
    }

    .product-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .product-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
