:root {
    --green: #0f5a3c;
    --green-dark: #073923;
    --orange: #f28c00;
    --orange-dark: #cf7300;
    --blue: #062b49;
    --blue-soft: #e9f2f8;
    --white: #ffffff;
    --bg: #f6f8f5;
    --text: #17231d;
    --muted: #6d7a73;
    --border: #dfe7e1;
    --danger: #c0392b;
    --success: #1e8e5a;
    --shadow: 0 10px 30px rgba(6, 43, 73, 0.10);
    --radius: 18px;
    --bottom-nav-height: 72px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    padding-bottom: var(--bottom-nav-height);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

.container {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    object-fit: contain;
    background: var(--white);
    box-shadow: var(--shadow);
}

.brand-text {
    min-width: 0;
}

.brand-name {
    display: block;
    font-weight: 900;
    color: var(--green);
    line-height: 1;
    font-size: 1.05rem;
}

.brand-slogan {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.desktop-nav {
    display: none;
    align-items: center;
    gap: 12px;
}

.desktop-nav a {
    font-weight: 800;
    color: var(--blue);
    padding: 10px 12px;
    border-radius: 999px;
}

.desktop-nav a:hover {
    background: var(--blue-soft);
}

.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(242, 140, 0, 0.22), transparent 34%),
        linear-gradient(135deg, var(--green), var(--blue));
    color: var(--white);
    padding: 32px 0 28px;
}

.hero::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -90px;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.84rem;
    font-weight: 800;
}

.hero h1 {
    margin: 18px 0 10px;
    font-size: clamp(2rem, 9vw, 4.2rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
}

.hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.02rem;
    line-height: 1.5;
    max-width: 650px;
}

.hero-actions {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    border: 0;
    cursor: pointer;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 900;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--orange);
    color: var(--white);
    box-shadow: 0 10px 22px rgba(242, 140, 0, 0.25);
}

.btn-primary:hover {
    background: var(--orange-dark);
}

.btn-secondary {
    background: var(--white);
    color: var(--green);
}

.btn-outline {
    background: transparent;
    color: var(--green);
    border: 1px solid var(--border);
}

.btn-whatsapp {
    background: #25d366;
    color: var(--white);
    width: 100%;
}

.section {
    padding: 24px 0;
}

.section-title-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.section-title {
    margin: 0;
    color: var(--blue);
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.section-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.category-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0 12px;
    scrollbar-width: thin;
}

.category-card {
    flex: 0 0 138px;
    min-height: 116px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 8px 18px rgba(6, 43, 73, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.category-card.active,
.category-card:hover {
    border-color: rgba(242, 140, 0, 0.7);
}

.category-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--blue-soft);
    color: var(--green);
    font-size: 1.35rem;
}

.category-name {
    font-weight: 900;
    color: var(--blue);
    font-size: 0.92rem;
    line-height: 1.15;
}

.filters {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.form-control {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 11px 13px;
    background: var(--white);
    color: var(--text);
    outline: none;
}

.form-control:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(242, 140, 0, 0.12);
}

/* Produits */

.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(6, 43, 73, 0.07);
    overflow: hidden;
}

.product-image-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #ffffff;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
    padding: 8px;
}

.product-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    max-width: calc(100% - 24px);
    background: rgba(6, 43, 73, 0.88);
    color: var(--white);
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 0.76rem;
    font-weight: 900;
}

.product-body {
    padding: 14px;
}

.product-category {
    color: var(--orange);
    font-weight: 900;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.product-title {
    margin: 6px 0 8px;
    color: var(--blue);
    font-size: 1.08rem;
    line-height: 1.18;
}

.product-title a {
    color: var(--blue);
}

.product-desc {
    color: var(--muted);
    margin: 0 0 12px;
    line-height: 1.45;
    font-size: 0.92rem;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.product-price {
    font-weight: 950;
    color: var(--green);
    font-size: 1.1rem;
}

.product-location {
    color: var(--muted);
    font-size: 0.84rem;
}

.product-card .btn-primary {
    width: 100%;
}

/* Détail produit */

.product-detail {
    display: grid;
    gap: 18px;
}

.product-detail-image {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.product-detail-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #ffffff;
    padding: 10px;
}

.product-detail-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 18px;
}

.product-detail-card h1 {
    color: var(--blue);
    margin: 8px 0 10px;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.product-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.product-gallery-thumb {
    border: 2px solid var(--border);
    background: #ffffff;
    border-radius: 14px;
    padding: 6px;
    cursor: pointer;
    height: 82px;
    overflow: hidden;
}

.product-gallery-thumb.active,
.product-gallery-thumb:hover {
    border-color: var(--orange);
}

.product-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

.meta-list {
    display: grid;
    gap: 9px;
    margin: 16px 0;
}

.meta-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
}

.meta-item span:first-child {
    color: var(--muted);
}

.meta-item span:last-child {
    font-weight: 900;
    color: var(--blue);
    text-align: right;
}

.empty-state {
    background: var(--white);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 28px 18px;
    text-align: center;
    color: var(--muted);
}

/* Navigation mobile */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    height: var(--bottom-nav-height);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 850;
}

.bottom-nav a.active,
.bottom-nav a:hover {
    color: var(--green);
}

.bottom-nav .nav-icon {
    font-size: 1.28rem;
}

/* Bannière installation PWA */

.install-banner {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(var(--bottom-nav-height) + 12px);
    z-index: 70;
    background: var(--blue);
    color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    display: none;
    gap: 12px;
    align-items: center;
}

.install-banner.show {
    display: flex;
}

.install-banner-text {
    flex: 1;
    min-width: 0;
}

.install-banner strong {
    display: block;
    line-height: 1.15;
}

.install-banner span {
    display: block;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    margin-top: 3px;
}

.install-close {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
    border: 0;
    border-radius: 999px;
    width: 34px;
    height: 34px;
    cursor: pointer;
}

.footer {
    padding: 26px 0 34px;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Admin */

.admin-layout {
    min-height: 100vh;
    background: var(--bg);
    padding-bottom: 30px;
}

.admin-topbar {
    background: var(--blue);
    color: var(--white);
    padding: 16px 0;
}

.admin-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-title {
    margin: 0;
    font-size: 1.1rem;
}

.admin-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0;
}

.admin-nav a {
    flex: 0 0 auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 900;
    color: var(--blue);
}

.admin-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-top: 16px;
}

.admin-grid {
    display: grid;
    gap: 14px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: var(--blue);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-thumb {
    width: 58px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
    background: #ffffff;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-group label {
    display: block;
    font-weight: 900;
    color: var(--blue);
    margin-bottom: 7px;
}

.form-help {
    color: var(--muted);
    font-size: 0.84rem;
    margin-top: 6px;
}

.flash {
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 800;
    margin: 14px 0;
}

.flash.success {
    background: rgba(30, 142, 90, 0.12);
    color: var(--success);
    border: 1px solid rgba(30, 142, 90, 0.25);
}

.flash.error {
    background: rgba(192, 57, 43, 0.12);
    color: var(--danger);
    border: 1px solid rgba(192, 57, 43, 0.25);
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
    background:
        radial-gradient(circle at top left, rgba(242, 140, 0, 0.2), transparent 32%),
        linear-gradient(135deg, var(--green), var(--blue));
}

.login-card {
    width: min(440px, 100%);
    background: var(--white);
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.login-card h1 {
    margin: 8px 0 6px;
    color: var(--blue);
}

.login-card p {
    margin: 0 0 18px;
    color: var(--muted);
}

/* Responsive */

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters {
        grid-template-columns: 1.3fr 1fr auto;
        align-items: center;
    }

    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-group.full {
        grid-column: 1 / -1;
    }
}

@media (min-width: 900px) {
    body {
        padding-bottom: 0;
    }

    .desktop-nav {
        display: flex;
    }

    .bottom-nav {
        display: none;
    }

    .hero {
        padding: 64px 0 58px;
    }

    .section {
        padding: 34px 0;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .product-detail {
        grid-template-columns: 1fr 0.9fr;
        align-items: start;
    }

    .install-banner {
        left: auto;
        right: 24px;
        width: 380px;
        bottom: 24px;
    }

    .admin-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Correction finale carte produit : image + infos visibles */

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(6, 43, 73, 0.07);
    overflow: hidden;
    min-height: auto;
}

.product-image-wrap {
    display: block;
    position: relative;
    width: 100%;
    height: 230px;
    aspect-ratio: auto;
    background: #ffffff;
    overflow: hidden;
    flex: 0 0 auto;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
    padding: 10px;
}

.product-body {
    display: block;
    padding: 14px;
    background: #ffffff;
    flex: 1;
}

.product-category {
    display: block;
    color: var(--orange);
    font-weight: 900;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.product-title {
    display: block;
    margin: 0 0 8px;
    color: var(--blue);
    font-size: 1.08rem;
    line-height: 1.18;
    font-weight: 900;
}

.product-title a {
    color: var(--blue);
}

.product-desc {
    display: block;
    color: var(--muted);
    margin: 0 0 12px;
    line-height: 1.45;
    font-size: 0.92rem;
}

.product-footer {
    display: block;
    margin-bottom: 12px;
}

.product-price {
    display: block;
    font-weight: 950;
    color: var(--green);
    font-size: 1.18rem;
}

.product-location {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    margin-top: 3px;
}

.product-card .btn-primary {
    width: 100%;
    margin-top: 4px;
}

@media (max-width: 639px) {
    .product-image-wrap {
        height: 220px;
    }
}

@media (min-width: 900px) {
    .product-image-wrap {
        height: 240px;
    }
}