:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #1a1f1c;
    --muted: #5c6760;
    --line: #e8e8e8;
    --accent: #2d6a4f;
    --accent-hover: #1b4332;
    --shadow: 0 8px 30px rgba(26, 31, 28, 0.08);
    --radius: 12px;
    --font: "DM Sans", system-ui, sans-serif;
    --max: 1200px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.site-header-inner {
    width: min(100%, var(--max));
    margin: 0 auto;
    padding: 0.75rem 1.25rem 0.65rem;
}

.site-header-top {
    display: flex;
    align-items: center;
    gap: 1px;
}

.site-brand {
    flex: 0 0 auto;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.site-brand:hover {
    color: var(--accent);
    text-decoration: none;
}

.site-brand-logo {
    display: block;
    height: 80px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.site-search {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    max-width: 420px;
    margin-left: auto;
    min-width: 0;
}

.site-contact-link {
    flex: 0 0 auto;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    padding: 0.45rem 0.15rem;
}

.site-contact-link:hover,
.site-contact-link.is-current {
    color: var(--accent);
    text-decoration: none;
}

.site-search input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 999px 0 0 999px;
    padding: 0.55rem 1rem;
    font: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: #fff;
}

.site-search input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
}

.site-search button {
    flex: 0 0 auto;
    border: 1px solid var(--accent);
    border-radius: 0 999px 999px 0;
    padding: 0.55rem 1.1rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    cursor: pointer;
}

.site-search button:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.nav-toggle {
    display: none;
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    padding: 0.35rem;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 5px 0;
    background: var(--text);
    border-radius: 1px;
}

.site-nav {
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--line);
}

.nav-root,
.nav-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.15rem 0.35rem;
}

.nav-root {
    justify-content: center;
    gap: 0;
}

.nav-submenu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-width: 180px;
    padding: 0.35rem 0;
}

.nav-item {
    position: relative;
}

.nav-root > .nav-item + .nav-item {
    border-left: 1px solid var(--line);
}

.nav-link {
    display: inline-block;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link:hover {
    background: rgba(45, 106, 79, 0.08);
    color: var(--accent);
    text-decoration: none;
}

.nav-link.is-current {
    background: rgba(45, 106, 79, 0.12);
    color: var(--accent);
}

.nav-item.has-children > .nav-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 60;
}

/* Nested flyout: to the right of the parent item */
.nav-submenu .nav-item.has-children > .nav-submenu {
    top: 0;
    left: 100%;
    margin-left: 0.15rem;
}

.nav-item.has-children:hover > .nav-submenu,
.nav-item.has-children:focus-within > .nav-submenu {
    display: flex;
}

.nav-submenu .nav-link {
    display: block;
    white-space: nowrap;
}

.site-main {
    flex: 1;
    width: min(100%, var(--max));
    margin: 0 auto;
    padding: calc(var(--site-header-height, 7.5rem) + 1.5rem) 1.25rem 2.5rem;
}

.site-footer {
    padding: 1.5rem 1.25rem 2rem;
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.875rem;
}

.site-footer-inner {
    width: min(100%, var(--max));
    margin: 0 auto;
    display: grid;
    gap: 0.85rem;
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: center;
}

.site-footer-nav a,
.site-footer-copy a,
.site-footer-note a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.site-footer-nav a:hover,
.site-footer-copy a:hover,
.site-footer-note a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.site-footer-copy,
.site-footer-note {
    margin: 0;
    text-align: center;
}

.site-footer-note {
    font-size: 0.8rem;
    max-width: 52rem;
    margin-left: auto;
    margin-right: auto;
}

.legal-page {
    max-width: 720px;
}

.legal-prose {
    font-size: 0.98rem;
    line-height: 1.7;
}

.legal-prose h2 {
    margin: 1.75rem 0 0.65rem;
    font-size: 1.15rem;
}

.legal-prose p,
.legal-prose ul {
    margin: 0 0 0.9rem;
}

.legal-prose ul {
    padding-left: 1.25rem;
}

.legal-contact {
    padding: 0.85rem 1rem;
    background: #fafafa;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 80;
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.cookie-banner p {
    margin: 0;
    flex: 1 1 240px;
    font-size: 0.9rem;
    color: var(--text);
}

.cookie-banner[hidden] {
    display: none !important;
}

.page-section {
    width: 100%;
}

.page-head {
    margin-bottom: 1.25rem;
}

.page-head h1 {
    margin: 0 0 0.35rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -0.02em;
}

.page-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.muted {
    color: var(--muted);
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    font-size: 0.875rem;
    color: var(--muted);
}

.breadcrumbs li:not(:last-child)::after {
    content: "/";
    margin-left: 0.35rem;
    color: var(--line);
}

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

.product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(26, 31, 28, 0.1);
}

.product-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.product-card-link:hover {
    text-decoration: none;
}

.product-card-image {
    aspect-ratio: 1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.35rem;
}

.product-card-placeholder {
    color: var(--muted);
    font-size: 0.85rem;
}

.product-card-title {
    margin: 0;
    padding: 0.85rem 0.9rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
}

.pagination-link,
.pagination-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.65rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.pagination-link {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
}

.pagination-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.pagination-current {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.contact-page {
    max-width: 640px;
}

.contact-form {
    display: grid;
    gap: 1rem;
}

.form-field {
    display: grid;
    gap: 0.35rem;
}

.form-field label {
    font-weight: 600;
    font-size: 0.92rem;
}

.form-field input,
.form-field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font: inherit;
    color: var(--text);
    background: #fff;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-actions {
    margin-top: 0.25rem;
}

.btn-primary {
    display: inline-block;
    border: 0;
    border-radius: 999px;
    padding: 0.7rem 1.35rem;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.form-alert {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
}

.form-alert ul {
    margin: 0;
    padding-left: 1.1rem;
}

.form-alert-success {
    background: rgba(45, 106, 79, 0.1);
    color: var(--accent-hover);
}

.form-alert-error {
    background: rgba(193, 18, 31, 0.08);
    color: #9b0f19;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.product-gallery-main {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

.product-gallery-placeholder {
    color: var(--muted);
}

.product-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.product-gallery-thumbs a {
    width: 64px;
    height: 64px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
}

.product-gallery-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-detail-info h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    line-height: 1.25;
}

.product-detail-info .product-gtin {
    margin: 0 0 1rem;
}

.product-detail-content {
    width: 100%;
    max-width: 100%;
}

.product-offers,
.product-description {
    font-size: 0.98rem;
    line-height: 1.65;
    white-space: normal;
}

.product-offers {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.product-offers .view-offers a {
    display: inline-block;
    padding: 0.45rem 1rem;
    background: #c1121f;
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.2;
    white-space: nowrap;
}

.product-offers .view-offers a:hover {
    background: #9b0f19;
    color: #fff;
}

.product-offers:last-child,
.product-description:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.product-gtin {
    font-size: 0.875rem;
    color: var(--muted);
}

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

@media (max-width: 768px) {
    .site-header-top {
        flex-wrap: wrap;
    }

    .site-brand {
        order: 1;
    }

    .nav-toggle {
        display: block;
        order: 2;
        margin-left: auto;
    }

    .site-search {
        order: 3;
        flex: 1 1 calc(100% - 5.5rem);
        max-width: none;
        margin-left: 0;
    }

    .site-contact-link {
        order: 4;
    }

    .site-nav {
        display: none;
        width: 100%;
        margin-top: 0.75rem;
        padding-top: 0.65rem;
    }

    .site-nav.is-open {
        display: block;
    }

    .nav-root {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .nav-root > .nav-item + .nav-item {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .nav-item.has-children > .nav-submenu {
        position: static;
        box-shadow: none;
        border: 0;
        border-left: 2px solid var(--line);
        margin-left: 0.75rem;
        padding-left: 0.25rem;
    }

    /* Pe mobil: submeniurile sunt vizibile când hamburgerul e deschis */
    .site-nav.is-open .nav-item.has-children > .nav-submenu {
        display: flex;
    }
}
