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

:root {
    --bg: #e2cfa5;
    --text: #004aad;
    --blue: #004aad;
    --font: 'EB Garamond', Georgia, serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    min-height: 100vh;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3' fill='%23004aad'/%3E%3C%2Fsvg%3E") 8 8, auto;
}

a, button {
    cursor: inherit;
}

h1, h2, h3 {
    font-family: var(--font);
    font-weight: 400;
}

/* Centered container */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 48px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 0;
}

.logo {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-decoration: none;
    color: var(--text);
}

nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

nav a {
    text-decoration: none;
    color: var(--text);
    font-size: 20px;
    letter-spacing: 0.03em;
    transition: opacity 0.2s ease;
}

nav a:hover {
    opacity: 0.55;
}

/* Products page header color */
body.page-products .logo,
body.page-products nav a {
    color: var(--blue);
}

/* Product Grid */
main {
    padding: 0 0 72px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.product-item {
    aspect-ratio: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 11%;
    text-decoration: none;
}

.product-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.35s ease;
}

.product-item:hover img {
    transform: scale(1.05);
}

/* ── Individual product page ───────────────────── */
.page-table {
    border: 2px solid var(--blue);
    border-bottom: none;
    margin-bottom: 60px;
    padding: 0;
}

.page-row {
    display: flex;
    border-bottom: 2px solid var(--blue);
}

.page-row:last-child {
    border-bottom: none;
}

.page-cell {
    flex: 1;
    border-right: 2px solid var(--blue);
}

.page-cell:last-child {
    border-right: none;
}

/* Image cell */
.cell-image {
    flex: 0 0 40%;
    overflow: hidden;
    aspect-ratio: 4 / 5;
}

.cell-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Specs cell */
.cell-specs {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 44px;
    gap: 16px;
}

.spec-table {
    border: 2px solid var(--blue);
}

.spec-row {
    display: block;
    padding: 13px 16px;
    font-size: 16px;
    font-family: var(--font);
    color: var(--text);
    border-bottom: 2px solid var(--blue);
    text-decoration: none;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-split {
    display: flex;
    padding: 0;
}

.spec-label {
    padding: 13px 16px;
    border-right: 2px solid var(--blue);
    flex: 0 0 55%;
}

.spec-value {
    padding: 13px 16px;
    flex: 1;
}

.product-name {
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.02em;
    margin: 0;
}

.spec-inquire {
    background: var(--blue);
    color: white;
    text-align: center;
    letter-spacing: 0.04em;
    font-size: 17px;
    transition: opacity 0.2s ease;
}

.spec-inquire:hover {
    opacity: 0.85;
}

/* Description row */
.row-description {
    flex-direction: column;
    padding: 20px 24px;
}

.desc-heading {
    font-size: 17px;
    font-weight: 400;
    margin-bottom: 10px;
}

.desc-text {
    font-size: 18px;
    line-height: 1.65;
    color: var(--text);
}

/* Detail photos row */
.row-photos.page-row {
    overflow: hidden;
    border-bottom: 2px solid var(--blue);
}

.cell-photo {
    height: 380px;
    overflow: hidden;
}

.cell-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.row-photos .page-cell:first-child {
    flex: 2;
}

.row-photos .page-cell:last-child img {
    object-position: center;
}

/* ── Footer ─────────────────────────────────────── */
footer {
    border-top: 1px solid var(--blue);
    padding: 28px 0 48px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 48px;
}

.footer-signup p {
    font-size: 15px;
    font-family: var(--font);
    color: var(--text);
    margin-bottom: 12px;
}

.footer-signup-form {
    display: flex;
    border: 1px solid var(--blue);
}

.footer-signup-input {
    flex: 1;
    width: 220px;
    padding: 8px 12px;
    font-size: 15px;
    font-family: var(--font);
    color: var(--text);
    background: transparent;
    border: none;
    outline: none;
}

.footer-signup-btn {
    padding: 8px 16px;
    background: var(--blue);
    color: white;
    font-family: var(--font);
    font-size: 15px;
    letter-spacing: 0.04em;
    border: none;
    transition: opacity 0.2s ease;
}

.footer-signup-btn:hover {
    opacity: 0.85;
}

.footer-signup-confirmation {
    display: none;
    margin-top: 10px;
    font-size: 15px;
    font-family: var(--font);
    font-style: italic;
    color: var(--text);
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.footer-links a {
    font-size: 15px;
    font-family: var(--font);
    color: var(--text);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-links a:hover {
    opacity: 0.55;
}

/* ── About page ────────────────────────────────── */
.about-wrap {
    padding: 0 0 72px;
    max-width: 600px;
}

.about-text {
    font-size: 19px;
    font-family: var(--font);
    color: var(--text);
    line-height: 1.75;
}

/* ── Contact page ──────────────────────────────── */
.contact-wrap {
    padding: 0 0 72px;
}

.contact-intro {
    font-size: 18px;
    font-family: var(--font);
    color: var(--text);
    margin-bottom: 24px;
    max-width: 600px;
    line-height: 1.65;
}

.contact-intro a {
    color: var(--text);
}

.contact-form {
    border: 2px solid var(--blue);
    max-width: 600px;
}

.contact-row {
    display: flex;
    border-bottom: 2px solid var(--blue);
}

.contact-label {
    flex: 0 0 140px;
    padding: 13px 16px;
    font-size: 16px;
    font-family: var(--font);
    font-style: italic;
    color: var(--text);
    border-right: 2px solid var(--blue);
}

.contact-input {
    flex: 1;
    padding: 13px 16px;
    font-size: 16px;
    font-family: var(--font);
    color: var(--text);
    background: transparent;
    border: none;
    outline: none;
    resize: none;
}

.contact-row--message {
    align-items: stretch;
}

.contact-textarea {
    min-height: 160px;
}

.contact-submit {
    display: block;
    width: 100%;
    padding: 13px 16px;
    background: var(--blue);
    color: white;
    font-family: var(--font);
    font-size: 17px;
    letter-spacing: 0.04em;
    border: none;
    text-align: center;
    transition: opacity 0.2s ease;
}

.contact-submit:hover {
    opacity: 0.85;
}

.contact-confirmation {
    display: none;
    margin-top: 16px;
    font-size: 16px;
    font-family: var(--font);
    color: var(--text);
    font-style: italic;
}

/* ── Products page ─────────────────────────────── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 2px solid var(--blue);
    border-left: 2px solid var(--blue);
}

.category-card {
    aspect-ratio: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 20px 16px 12px;
    border-right: 2px solid var(--blue);
    border-bottom: 2px solid var(--blue);
    text-decoration: none;
    color: var(--blue);
}

.category-card--empty {
    cursor: inherit;
}

.category-card:nth-child(2) .card-image img {
    transform: rotate(-1.5deg);
}

.category-card:nth-child(2):hover .card-image img {
    transform: rotate(-1.5deg) scale(1.04);
}

.category-card:nth-child(3) .card-image img {
    transform: rotate(-1.5deg);
}

.category-card:nth-child(3):hover .card-image img {
    transform: rotate(-1.5deg) scale(1.04);
}

.card-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.card-image img {
    max-width: 78%;
    max-height: 78%;
    object-fit: contain;
    transition: transform 0.35s ease;
}

.category-card:not(.category-card--empty):hover .card-image img {
    transform: scale(1.04);
}

.card-label {
    font-size: 17px;
    font-family: var(--font);
    margin-top: 10px;
    flex-shrink: 0;
}

/* ── Mobile ─────────────────────────────────────── */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    /* Header: stack logo above nav */
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 20px 0;
    }

    nav {
        gap: 20px;
    }

    nav a {
        font-size: 17px;
    }

    /* Footer: stack vertically */
    footer {
        flex-direction: column;
        gap: 28px;
    }

    .footer-links {
        align-items: flex-start;
    }

    /* Products grid: 2 columns */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-label {
        font-size: 14px;
    }

    /* Product page: stack all rows vertically */
    .page-row {
        flex-direction: column;
    }

    .page-cell {
        border-right: none;
        border-bottom: 2px solid var(--blue);
    }

    .page-cell:last-child {
        border-bottom: none;
    }

    /* Image cell: full width */
    .cell-image {
        flex: none;
        width: 100%;
        aspect-ratio: 4 / 5;
    }

    /* Specs cell: tighter padding */
    .cell-specs {
        padding: 20px 20px;
    }

    /* Detail photo row: stack photos, reset flex override */
    .row-photos.page-row {
        flex-direction: column;
    }

    .row-photos .page-cell:first-child {
        flex: none;
    }

    .cell-photo {
        height: 260px;
        width: 100%;
    }

    /* Contact form: stack label above input */
    .contact-row {
        flex-direction: column;
    }

    .contact-label {
        flex: none;
        border-right: none;
        border-bottom: 2px solid var(--blue);
        padding: 10px 16px;
    }

    .footer-signup-input {
        width: 160px;
    }
}
