/* Fits the approved homepage design (home.css) into the Velocity layout and onto Bagisto's own markup. */

/* The design's sections run edge to edge. Velocity puts the home content in a container that
   leaves room on the left for the always-open category list; here the list opens on hover only. */
body:has(.mc-home) .home-container { padding-left: 0; padding-right: 0; }
.home-container > .full-content-wrapper > .mc-home {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}
body { overflow-x: hidden; }

.mc-home h1, .mc-home h2, .mc-home h3 { font-family: var(--font-ui); }
.mc-home a:hover { text-decoration: none; }

/* The filters and "Vezi mai multe" are links here (each state has its own address), styled as the design's buttons. */
.mc-home .filters a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.mc-home .filters a.active, .mc-home .filters a.active:hover { color: #fff; }
.mc-home #more { display: flex; align-items: center; justify-content: center; width: max-content; max-width: 100%; text-decoration: none; }

/* One price: Bagisto's own price HTML (getPriceHtml), shown as the design's price line. A sale
   keeps its sale price; the crossed-out former price and the "sale" sticker stay on the product page. */
.mc-home .card-price > span,
.mc-home .card-price > .special-price { color: #25332b; font: 600 1.75rem/1.3 var(--font-ui); }
.mc-home .card-price > .regular-price,
.mc-home .card-price > .sticker { display: none; }

.mc-home .product-name a { color: inherit; }
.mc-home .card-product-link, .mc-home .card-product-link:hover, .mc-home .custom-service__cta, .mc-home .custom-service__cta:hover { color: #fff; text-decoration: none; }

.mc-home .ai-entry input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

/* Velocity keeps the category sidebar open on the homepage only, where it would cover the design.
   Here it behaves as on every other page: it opens while "Cumpără după categorie" or the list itself is under the pointer. */
body:has(.mc-home) #sidebar-level-0:not(.mc-open) { display: none !important; }

/* Velocity rules that reach into the design: product names get a fixed height, paragraphs in
   the home content lose their bottom margin, and links and form fields take the theme font. */
.mc-home .shop-product .product-name { height: auto !important; }
.mc-home .shop-product .product-dimensions { margin-bottom: .75rem !important; }
.mc-home .custom-service__label { margin-bottom: 1rem !important; }
.mc-home .custom-service__intro { margin-bottom: 1rem !important; }
.mc-home .custom-service__request { margin-bottom: 1.5rem !important; }
.mc-home * { font-family: inherit; }

/* The whole category card opens its products, not only the green line. */
.mc-home .journey-categories article { position: relative; cursor: pointer; }
.mc-home .journey-categories article a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.mc-home .journey-categories article:focus-within { border-color: #88ad56; }

/* While another filter, sort or page of products loads (mc-home/catalog.js). */
.mc-home #colectii .products, .mc-home #colectii #more { transition: opacity .15s ease; }
.mc-home #colectii.mc-loading .products, .mc-home #colectii.mc-loading #more { opacity: .45; }
@media (prefers-reduced-motion: reduce) { .mc-home #colectii .products { transition: none; } }

/* The homepage search with the old search's functions: a category of the shop and the camera
   (search by image) inside the approved search field. */
.mc-home .ai-hero .ai-entry.mc-search {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 12px 8px 8px;
    border: 3px solid transparent;
    border-radius: 26px;
    background: linear-gradient(#fff, #fff) padding-box, linear-gradient(110deg, #218f56, #b7d53c, #65b872) border-box;
    box-shadow: 0 8px 28px #35502c12;
}
.mc-home .ai-hero .ai-entry.mc-search #ai-query {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 56px;
    height: 56px;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
}
.mc-home .ai-hero .ai-entry.mc-search:focus-within { box-shadow: 0 0 0 3px #104e3e33, 0 8px 28px #35502c12; }
.mc-home .ai-hero .ai-entry.mc-search .ai-send { position: static; transform: none; flex: 0 0 auto; }
.mc-search__category {
    flex: 0 0 auto;
    max-width: 220px;
    height: 56px;
    padding: 0 34px 0 16px;
    border: 0;
    border-right: 1px solid #dce3d6;
    border-radius: 18px 0 0 18px;
    background: #f6f8f3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23287340' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 18px no-repeat;
    color: #25332b;
    font: 500 16px/1.4 var(--font-ui);
    text-overflow: ellipsis;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}
.mc-search__camera { flex: 0 0 auto; display: grid; place-items: center; width: 48px; height: 48px; margin: 0; border-radius: 14px; color: #287340; cursor: pointer; }
.mc-search__camera:hover { background: #f1f6ec; }
.mc-search__camera svg { width: 26px; height: 26px; }
@media (max-width: 740px) {
    .mc-home .ai-hero .ai-entry.mc-search { flex-wrap: wrap; padding: 8px; border-radius: 20px; }
    .mc-search__category { order: -1; flex: 1 1 100%; max-width: none; height: 46px; border-right: 0; border-radius: 14px; }
    .mc-home .ai-hero .ai-entry.mc-search #ai-query { height: 52px; min-height: 52px; padding: 0 8px; }
}
@media (max-width: 740px) {
    .mc-home .ai-hero .ai-entry.mc-search #ai-query { flex: 1 1 0; }
}

/* WebP images in <picture>: the <img> stays the layout item, as in the design. */
.mc-home .journey-categories picture,
.mc-home .custom-service__collage picture { display: contents; }

/* Homepage catalog: photos fill their square; 5 cards to a row on desktop (20 = 4 rows) */
.mc-home .shop-product > .product-image { aspect-ratio: 1 / 1; padding: 0 !important; background: #f5f7f1; }
.mc-home .shop-product > .product-image > img { width: 100% !important; height: 100% !important; max-height: none !important; object-fit: cover; mix-blend-mode: normal; }
@media (min-width: 1200px) { .mc-home .catalog .products { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; } }

/* "Ce ambalaj cauți?" (22.11.2026): five low cards, one per business type of the category menu.
   Square photo, one title, the whole card a button that opens the menu on its group. */
.mc-home .category-start > h2 { margin: 0 0 28px; }
.mc-home .journey-groups { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.mc-home .journey-groups li { min-width: 0; }
.mc-home .journey-group { display: flex; align-items: center; gap: 12px; width: 100%; height: 100%; min-height: 0; padding: 14px; border: 1px solid #d9e3dc; border-radius: 14px; background: #fff; color: #1d3a2f; font-family: var(--font-ui); text-align: left; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.mc-home .journey-group:hover { border-color: #88ad56; box-shadow: 0 6px 18px rgba(29, 58, 47, .08); }
.mc-home .journey-group:focus-visible { outline: 3px solid #88ad56; outline-offset: 2px; }
.mc-home .journey-group picture { display: contents; }
.mc-home .journey-group img { flex: 0 0 auto; width: clamp(56px, 29%, 100px); height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; mix-blend-mode: normal; }
.mc-home .journey-group__title { flex: 1 1 auto; min-width: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; word-break: normal; overflow-wrap: normal; hyphens: manual; }
.mc-home .journey-group__arrow { flex: 0 0 auto; color: #247959; font-size: 1.75rem; line-height: 1; }
@media (max-width: 1150px) { .mc-home .journey-groups { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 740px) {
    .mc-home .category-start > h2 { margin-bottom: 18px; }
    .mc-home .journey-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .mc-home .journey-group { gap: 10px; padding: 10px; border-radius: 12px; }
    .mc-home .journey-group img { width: 56px; border-radius: 6px; }
    .mc-home .journey-group__arrow { display: none; }
    .mc-home .journey-group__title { font-size: .9375rem; }
}

/* "Produse pentru comanda ta", most ordered (22.11.2026): up to 20 a tab, five to a row like the catalog. */
.mc-home .catalog .catalog-all { display: flex; width: max-content; max-width: 100%; margin: 28px 0 0 auto; }
@media (max-width: 740px) {
    .mc-home .catalog .products.products--top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .mc-home .catalog .filters[aria-label="Cele mai comandate produse"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .mc-home #colectii .filters[aria-label="Cele mai comandate produse"] a { justify-content: center; text-align: center; min-height: 44px; padding: 8px 6px; font-size: .9375rem !important; line-height: 1.2; }
}

/* Products grid on tablets and small laptops (22.11.2026, Delian's choice): the same columns as the
   category pages, 4 from 993 px and 3 from 741 px, instead of the design's 2 large cards. */
@media (min-width: 993px) and (max-width: 1199px) { body .mc-home .catalog .products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 741px) and (max-width: 992px) { body .mc-home .catalog .products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }

/* Search: the note when the typed size does not exist (catalog.blade.php, McSearch::$missingSizes) */
.mc-home .catalog .catalog-note { margin: 14px 0 0; padding: 12px 16px; border-left: 3px solid #287340; border-radius: 0 10px 10px 0; background: #f1f6ec; color: #35453a; font-size: 1rem; line-height: 1.55; max-width: 62ch; }
.mc-home .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
