/* =========================================================
   Search Page Styles – aligned with marketplace design
   ========================================================= */

/* Design tokens (mirrors marketplace) */
:root {
    --card-min-width: 210px;
    --accent: #4F7F34;
    --accent-light: #f3f8ed;
    --accent-border: #b8d99a;
    --accent-dark: #5a8a3c;
}

/* ---------- Layout ---------- */
section#content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 7%;
    gap: 28px;
    width: 100%;
    box-sizing: border-box;
}

/* ---------- Breadcrumb ---------- */
nav#ariane {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

nav#ariane a {
    text-decoration: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    color: rgba(0, 0, 0, 0.65);
    font-weight: 600;
    font-size: 13px;
    transition: color 0.2s;
}

nav#ariane a:hover {
    color: var(--accent);
}

nav#ariane .ariane-sep {
    color: rgba(0, 0, 0, 0.35);
    font-size: 16px;
}

nav#ariane .ariane-current {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}

nav#ariane .icon.home-icon {
    background-color: rgba(0, 0, 0, 0.65);
    width: 14px;
    height: 14px;
    -webkit-mask: url('/svg/home_icon.svg') center / contain no-repeat;
    mask: url('/svg/home_icon.svg') center / contain no-repeat;
}

/* ---------- Title ---------- */
#title_container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}

#title_container h1 {
    font-style: normal;
    font-weight: 800;
    font-size: 36px;
    color: var(--accent);
    line-height: 1.2;
    margin: 0;
}

#title_container h1 em {
    font-style: normal;
    color: #1a1a1a;
}

.search_subtitle {
    font-size: 14px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.5);
    margin: 0;
}

/* ---------- In-page search bar ---------- */
#page_searchbar_wrapper {
    width: 100%;
}

#page_searchbar {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 700px;
    height: 52px;
    padding: 0 6px 0 16px;
    gap: 10px;
    border: 2px solid rgba(0, 0, 0, 0.14);
    border-radius: 12px;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#page_searchbar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(79,127,52, 0.15);
    background: #fff;
}

.search-icon-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.search-icon-wrapper .icon.search-icon {
    width: 18px;
    height: 18px;
    background-color: rgba(0, 0, 0, 0.4);
    -webkit-mask: url('/svg/search_icon.svg') center / contain no-repeat;
    mask: url('/svg/search_icon.svg') center / contain no-repeat;
}

#page_searchbar:focus-within .search-icon-wrapper .icon.search-icon {
    background-color: var(--accent);
}

#page_search_input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: #333;
}

#page_search_input::placeholder {
    color: #aaa;
}

#page_search_button {
    flex-shrink: 0;
    height: 40px;
    padding: 0 20px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

#page_search_button:hover {
    background: var(--accent-dark);
}

#page_search_button:active {
    transform: scale(0.97);
}

#page_search_button:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Results area ---------- */
#results_container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

#results_header {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#results_separator {
    width: min(35%, 220px);
    height: 6px;
    background: linear-gradient(90deg, var(--accent), var(--accent-border));
    border-radius: 10px;
}

/* Products grid (same as marketplace) */
.produits {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width), 1fr));
    gap: 24px;
    width: 100%;
}

/* ---------- Product card (identical to marketplace) ---------- */
a.produit {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-radius: 16px;
    text-decoration: none;
    background: #fff;
    border: 1.5px solid #e8e8e8;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    color: inherit;
}

a.produit:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 28px rgba(79,127,52, 0.25);
    border-color: var(--accent);
}

a.produit:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.product_image_wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

img.product_main_image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

a.produit:hover img.product_main_image {
    transform: scale(1.05);
}

.product_content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 14px 6px;
    flex: 1;
}

h3.product_title {
    font-weight: 700;
    font-size: 13px;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

span.product_price {
    font-weight: 700;
    font-size: 17px;
    color: var(--accent);
}

.product_cta {
    padding: 10px 14px;
    background: var(--accent-light);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-dark);
    border-top: 1px solid #e2f0d4;
    transition: background 0.2s, color 0.2s;
}

a.produit:hover .product_cta {
    background: var(--accent);
    color: #fff;
}

/* ---------- Empty state ---------- */
#empty_state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 48px 24px;
    background: #fafafa;
    border: 1.5px dashed var(--accent-border);
    border-radius: 20px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.empty_icon {
    font-size: 56px;
    line-height: 1;
}

.empty_title {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0;
}

.empty_desc {
    font-size: 15px;
    color: rgba(0, 0, 0, 0.6);
    max-width: 480px;
    margin: 0;
    line-height: 1.6;
}

.empty_tips {
    background: var(--accent-light);
    border: 1px solid var(--accent-border);
    border-radius: 12px;
    padding: 16px 24px;
    text-align: left;
    max-width: 480px;
    width: 100%;
    box-sizing: border-box;
}

.empty_tips span {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-dark);
}

.empty_tips ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.empty_tips ul li {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.65);
    margin-bottom: 4px;
}

.empty_categories {
    width: 100%;
    max-width: 600px;
}

.empty_cat_label {
    font-size: 14px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.6);
    margin: 0 0 10px;
}

.cat_pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.cat-pill {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent-light);
    border: 1.5px solid var(--accent-border);
    border-radius: 50px;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.cat-pill:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-marketplace {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 28px;
    background: var(--accent);
    border-radius: 50px;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.btn-marketplace:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

/* =========================================================
   Responsive
   ========================================================= */

/* Tablet: 992px and below */
@media (max-width: 992px) {
    section#content {
        padding: 24px 5%;
    }

    #title_container h1 {
        font-size: 28px;
    }

    #page_searchbar {
        max-width: 100%;
    }

    .produits {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 18px;
    }
}

/* Mobile: 576px and below */
@media (max-width: 576px) {
    section#content {
        padding: 18px 4%;
        gap: 20px;
    }

    #title_container h1 {
        font-size: 22px;
    }

    #page_searchbar {
        height: 48px;
    }

    #page_search_button {
        padding: 0 14px;
        font-size: 13px;
    }

    .produits {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    h3.product_title {
        font-size: 12px;
    }

    span.product_price {
        font-size: 15px;
    }

    .product_cta {
        font-size: 11px;
        padding: 8px 12px;
    }

    .empty_title {
        font-size: 20px;
    }

    .empty_icon {
        font-size: 44px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .produits {
        grid-template-columns: 1fr;
    }
}
