/*
 * Public shop theme (Faza 9). Reference: bticino.com catalogue/product pages, supplied
 * by the client as screenshots. Independent of admin.app.css by design (see
 * src/View/Shop/layout.php) - the shop is a separate public site, not an admin skin.
 */

:root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-text-muted: #6b6b6b;
    --color-border: #e2e2e2;
    --color-border-strong: #d0d0d0;
    --color-accent: #e8600f;
    --color-accent-dark: #c94f09;
    --color-highlight-bg: #f8e3d6;
    --color-highlight-text: #a8420a;
    --color-footer-bg: #242424;
    --color-footer-text: #b8b8b8;
    --color-success-bg: #e6f4ea;
    --color-success-text: #1e7e34;
    --color-error-bg: #fbe7e9;
    --color-error-text: #b02a37;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --container-max: 1280px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    font-size: 15px;
    line-height: 1.5;
}

img { max-width: 100%; }

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

h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: 1.9rem; text-transform: uppercase; }
h2 { font-size: 1.15rem; text-transform: uppercase; letter-spacing: .04em; }
h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); }

.shop-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Breathing room between the nav bar/breadcrumbs and the start of every page's
   content - was sitting flush under the menu, titles looked glued to it. */
.shop-main { padding-top: 1.6rem; }
.shop-breadcrumbs { padding-top: .5rem; }

/* ---------- Header ---------- */
.shop-utility-bar {
    border-bottom: 1px solid var(--color-border);
    font-size: .8rem;
}
.shop-utility-bar .shop-container {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    padding-top: .5rem;
    padding-bottom: .5rem;
}
.shop-utility-bar a { color: var(--color-text-muted); }
.shop-utility-bar a:hover { color: var(--color-accent); text-decoration: none; }

.shop-header {
    border-bottom: 1px solid var(--color-border);
}
.shop-header .shop-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    padding-bottom: 1rem;
    gap: 1.5rem;
}
.shop-logo img { display: block; height: 34px; width: auto; }
.shop-search {
    flex: 1;
    max-width: 420px;
}
.shop-search input {
    width: 100%;
    padding: .55rem .9rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 3px;
    font-family: inherit;
    font-size: .9rem;
}

.shop-nav {
    border-bottom: 1px solid var(--color-border);
}
.shop-nav .shop-container {
    display: flex;
    gap: 2rem;
}
.shop-nav a {
    display: inline-block;
    padding: .85rem 0;
    color: var(--color-text);
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 2px solid transparent;
}
.shop-nav a:hover, .shop-nav a.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    text-decoration: none;
}

.shop-breadcrumbs {
    font-size: .8rem;
    color: var(--color-text-muted);
    padding: .9rem 0;
}
.shop-breadcrumbs a { color: var(--color-text-muted); }
.shop-breadcrumbs a:hover { color: var(--color-accent); }
.shop-breadcrumbs .sep { margin: 0 .4rem; color: var(--color-border-strong); }

/* ---------- Hero (category / home) ---------- */
.shop-hero {
    background: var(--color-highlight-bg);
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 2rem;
    margin-bottom: 2rem;
}
.shop-hero__content {
    flex: 1 1 320px;
    padding: 2.5rem 1.5rem;
}
.shop-hero__content h1 { font-size: 1.6rem; }
.shop-hero__content ul { padding-left: 1.1rem; color: var(--color-text); }
.shop-hero__image { flex: 1 1 320px; overflow: hidden; }
.shop-hero__image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .65rem 1.4rem;
    border: 1px solid transparent;
    border-radius: 3px;
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); }
.btn-outline { background: transparent; border-color: var(--color-text); color: var(--color-text); }
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn-block { width: 100%; }
.btn-sm { padding: .4rem .9rem; font-size: .78rem; }

/* ---------- Forms ---------- */
form.shop-form { max-width: 480px; }
form.shop-form label { display: block; margin: 1rem 0 .3rem; font-size: .82rem; font-weight: 600; }
form.shop-form input,
form.shop-form select,
form.shop-form textarea {
    width: 100%;
    padding: .6rem .8rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 3px;
    font-family: inherit;
    font-size: .9rem;
}
form.shop-form input:focus,
form.shop-form select:focus,
form.shop-form textarea:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; }
form.shop-form button[type="submit"] { margin-top: 1.5rem; }

/* ---------- Flash ---------- */
.shop-flash { padding: .8rem 1.1rem; border-radius: 3px; margin: 1rem 0; font-size: .88rem; }
.shop-flash--success { background: var(--color-success-bg); color: var(--color-success-text); }
.shop-flash--error { background: var(--color-error-bg); color: var(--color-error-text); }
.shop-flash--info { background: var(--color-highlight-bg); color: var(--color-highlight-text); }

/* ---------- Catalog layout ---------- */
.shop-catalog {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2.5rem;
    align-items: start;
}
@media (max-width: 820px) {
    .shop-catalog { grid-template-columns: 1fr; }
}

.shop-sidebar h3 { margin-top: 0; margin-bottom: 1rem; }
.shop-sidebar-filters {
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1.25rem;
    /* select2 replaces <select> with its own markup of the same width as the
       original element - without this the manufacturer/family dropdowns can
       render wider than their text and overflow the sidebar box. */
    max-width: 100%;
    overflow: hidden;
}
.shop-sidebar-filters label { display: block; font-size: .8rem; font-weight: 600; margin: 1.1rem 0 .4rem; }
.shop-sidebar-filters label:first-of-type { margin-top: 0; }
.shop-sidebar-filters input[type="text"],
.shop-sidebar-filters select {
    width: 100%;
    max-width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 3px;
    font-family: inherit;
    font-size: .85rem;
}
/* select2 container must also be capped, it doesn't inherit the <select>'s CSS width */
.shop-sidebar-filters .select2-container { max-width: 100%; }

/* Select2 accent overrides, to match the shop palette instead of its default blue */
.select2-container--default .select2-selection--single {
    height: auto !important;
    border: 1px solid var(--color-border-strong) !important;
    border-radius: 3px !important;
    padding: .3rem .2rem;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { font-size: .85rem; color: var(--color-text); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 100% !important; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--color-accent) !important; }
.select2-container--default .select2-results__option[aria-selected="true"] { background: var(--color-highlight-bg); }
.select2-search--dropdown .select2-search__field { border: 1px solid var(--color-border-strong) !important; border-radius: 3px; font-family: inherit; }

.shop-catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: .85rem;
    color: var(--color-text-muted);
}

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

.shop-product-card {
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
}
.shop-product-card a.shop-product-card__link { color: inherit; text-decoration: none; }
.shop-product-card__image {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: .9rem;
}
.shop-product-card__image img { max-height: 100%; }
.shop-product-card__code { font-weight: 700; font-size: .92rem; }
.shop-product-card__family { color: var(--color-text-muted); font-size: .78rem; margin-bottom: .4rem; }
.shop-product-card__title { font-size: .85rem; margin-bottom: .8rem; }
.shop-product-card__price { font-weight: 700; font-size: 1.05rem; }
.shop-product-card__price-vat-note { font-weight: 400; font-size: .72rem; color: var(--color-text-muted); }
.shop-product-card__price-novat { font-size: .78rem; color: var(--color-text-muted); margin-bottom: .3rem; }
.shop-product-card__stock { font-size: .78rem; margin-bottom: .8rem; }
.shop-product-card form { margin-top: auto; }

/* ---------- Product detail ---------- */
.shop-item {
    display: grid;
    grid-template-columns: minmax(0, 420px) 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}
@media (max-width: 760px) {
    .shop-item { grid-template-columns: 1fr; }
}
.shop-item__image {
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shop-item__gallery { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }
.shop-item__gallery img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--color-border); border-radius: 3px; padding: .3rem; }

.shop-tags { display: flex; gap: .5rem; margin-bottom: .8rem; }
.shop-tag {
    display: inline-block;
    padding: .2rem .6rem;
    background: #f2f2f2;
    border-radius: 3px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.shop-item__code { color: var(--color-text-muted); font-size: .85rem; margin-bottom: 1rem; }
.shop-item__price { font-size: 1.5rem; font-weight: 700; margin: 1rem 0 .2rem; }
.shop-item__price-novat { color: var(--color-text-muted); font-size: .85rem; margin-bottom: .6rem; }
.shop-item__stock { font-size: .85rem; font-weight: 600; margin-bottom: 1.2rem; }
.shop-qty-add { display: flex; gap: .8rem; align-items: center; margin-bottom: 1.2rem; }
.shop-qty-add input[type="number"] { width: 70px; padding: .6rem; border: 1px solid var(--color-border-strong); border-radius: 3px; }

.shop-specs-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.shop-specs-table tr:nth-child(odd) { background: #fafafa; }
.shop-specs-table th, .shop-specs-table td { text-align: left; padding: .65rem .9rem; font-size: .85rem; font-weight: 400; }
.shop-specs-table th { color: var(--color-text-muted); width: 45%; font-weight: 600; }

.shop-doc-list { border: 1px solid var(--color-border); border-radius: 4px; }
.shop-doc-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .8rem 1.1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: .88rem;
}
.shop-doc-list a:last-child { border-bottom: none; }
.shop-doc-list a:hover { color: var(--color-accent); text-decoration: none; background: #fafafa; }

/* ---------- Category highlight badge (sidebar) ---------- */
.shop-category-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-highlight-bg);
    color: var(--color-highlight-text);
    padding: .7rem 1rem;
    border-radius: 3px;
    font-weight: 600;
    font-size: .85rem;
}
.shop-category-count {
    background: var(--color-highlight-text);
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
}

/* ---------- Generic tables (account, cart) ---------- */
table.shop-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .88rem; }
table.shop-table th, table.shop-table td { text-align: left; padding: .7rem .5rem; border-bottom: 1px solid var(--color-border); }
table.shop-table th { color: var(--color-text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- Footer ---------- */
.shop-footer {
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    margin-top: 3rem;
    padding-top: 3rem;
}
.shop-footer .shop-container { padding-bottom: 2rem; }
.shop-footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #3a3a3a;
}
.shop-footer-columns h4 {
    color: #fff;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 1rem;
}
.shop-footer-columns ul { list-style: none; padding: 0; margin: 0; }
.shop-footer-columns li { margin-bottom: .55rem; }
.shop-footer-columns a { color: var(--color-footer-text); font-size: .85rem; }
.shop-footer-columns a:hover { color: #fff; }
.shop-footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 0;
    font-size: .75rem;
    color: #8a8a8a;
}
.shop-footer-legal a { color: #8a8a8a; }
.shop-footer-legal a:hover { color: #fff; }

/* ---------- Legal pages ---------- */
.shop-legal-page { max-width: 760px; margin: 0 auto; }
.shop-legal-page h2 { font-size: 1rem; margin-top: 1.8rem; }
.shop-legal-page p { color: var(--color-text); }

/* ---------- Cookie banner ---------- */
.shop-cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 50;
    max-width: 520px;
    margin: 0 auto;
    background: var(--color-footer-bg);
    color: #fff;
    padding: 1rem 1.2rem;
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    align-items: center;
    justify-content: space-between;
    font-size: .82rem;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.shop-cookie-banner a { color: #fff; text-decoration: underline; }
.shop-cookie-banner[hidden] { display: none; }

/* ---------- Homepage: hero carousel ---------- */
.shop-hero-carousel {
    position: relative;
    margin-bottom: 3rem;
    min-height: 380px;
    overflow: hidden;
}
.shop-hero-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .6s ease;
}
.shop-hero-slide.active { position: relative; opacity: 1; visibility: visible; }
.shop-hero-slide__content {
    max-width: 640px;
    padding: 3.5rem 5vw;
}
.shop-hero-slide__eyebrow {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: .8rem;
    opacity: .85;
}
.shop-hero-slide__content h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin-bottom: .8rem; }
.shop-hero-slide__content p { font-size: 1rem; max-width: 480px; margin-bottom: 1.6rem; opacity: .92; }
.shop-hero-slide--brand { background: linear-gradient(120deg, var(--color-accent), var(--color-accent-dark)); color: #fff; }
.shop-hero-slide--brand .btn-primary { background: #fff; border-color: #fff; color: var(--color-accent-dark); }
.shop-hero-slide--brand .btn-primary:hover { background: #f2f2f2; border-color: #f2f2f2; }
.shop-hero-slide--dark { background: linear-gradient(120deg, #2b2b2b, var(--color-footer-bg)); color: #fff; }
.shop-hero-slide--light { background: linear-gradient(120deg, var(--color-highlight-bg), #fdf6f0); color: var(--color-text); }
.shop-hero-slide--light .shop-hero-slide__eyebrow { color: var(--color-highlight-text); }

.shop-hero-carousel__dots {
    position: absolute;
    left: 5vw;
    bottom: 1.4rem;
    display: flex;
    gap: .5rem;
    z-index: 2;
    padding: .4rem .55rem;
    border-radius: 20px;
    background: rgba(0, 0, 0, .28);
}
.shop-hero-carousel__dots button {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid #fff;
    background: transparent;
    padding: 0;
    cursor: pointer;
    opacity: .65;
}
.shop-hero-carousel__dots button.active { opacity: 1; background: #fff; }

/* ---------- Homepage: sections ---------- */
.shop-section { margin-bottom: 3.5rem; }
.shop-section__title { margin-bottom: 1.4rem; }

.shop-welcome {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 3rem;
    align-items: start;
}
@media (max-width: 760px) { .shop-welcome { grid-template-columns: 1fr; gap: 1.5rem; } }
.shop-welcome__text p { color: var(--color-text); margin-bottom: 1rem; }
.shop-welcome__points { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.2rem; }
.shop-welcome__points li { display: flex; flex-direction: column; gap: .2rem; padding-left: 1rem; border-left: 3px solid var(--color-accent); }
.shop-welcome__points strong { font-size: .92rem; }
.shop-welcome__points span { font-size: .85rem; color: var(--color-text-muted); }

.shop-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}
.shop-category-card {
    display: flex;
    align-items: center;
    gap: .8rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1rem 1.1rem;
    color: var(--color-text);
}
.shop-category-card:hover { border-color: var(--color-accent); text-decoration: none; }
.shop-category-card:hover .shop-category-card__title { color: var(--color-accent); }
.shop-category-card__mark {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-highlight-bg);
    color: var(--color-highlight-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .95rem;
}
.shop-category-card__title { font-size: .88rem; font-weight: 600; }

/* ---------- Pagination ---------- */
.shop-pagination { margin-top: 2rem; }
.shop-pagination a {
    display: inline-block;
    padding: .35rem .75rem;
    border: 1px solid var(--color-border-strong);
    border-radius: 3px;
    margin-right: .3rem;
    color: var(--color-text);
    font-size: .85rem;
}
.shop-pagination a:hover { border-color: var(--color-accent); color: var(--color-accent); text-decoration: none; }
.shop-pagination a.active { background: var(--color-text); border-color: var(--color-text); color: #fff; }
