/* OrdiniMePA – Mockup grafico per template Ready Pro
   Colori coordinati con identità Digital Point */

:root {
    --dp-blue:        #1e40af;   /* blu primario PA */
    --dp-blue-dark:   #1e3a8a;
    --dp-blue-light:  #dbeafe;
    --dp-yellow:      #facc15;   /* giallo accent / MePA */
    --dp-yellow-dark: #ca8a04;
    --dp-green:       #16a34a;   /* disponibile */
    --dp-red:         #dc2626;
    --dp-grey-50:     #f9fafb;
    --dp-grey-100:    #f3f4f6;
    --dp-grey-300:    #d1d5db;
    --dp-grey-600:    #4b5563;
    --dp-grey-900:    #111827;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.10);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--dp-grey-900);
    background: #fff;
    line-height: 1.5;
}

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

img { max-width: 100%; height: auto; display: block; }

/* ───── TOPBAR (sopra header) ───── */
.topbar {
    background: var(--dp-grey-900);
    color: #fff;
    font-size: 0.85rem;
    padding: 6px 0;
}
.topbar .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.topbar a { color: #fff; }
.topbar i { color: var(--dp-yellow); }

/* ───── HEADER / NAV ───── */
.header {
    background: #fff;
    border-bottom: 1px solid var(--dp-grey-100);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--dp-blue);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.logo-mark {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--dp-blue) 0%, var(--dp-blue-dark) 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.logo small {
    display: block;
    font-size: 0.7rem;
    color: var(--dp-grey-600);
    font-weight: 500;
}

.nav-search {
    flex: 1;
    max-width: 600px;
    position: relative;
}
.nav-search input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--dp-grey-100);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color .15s;
}
.nav-search input:focus {
    border-color: var(--dp-blue);
    outline: none;
}
.nav-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dp-grey-600);
}

.btn-quote {
    background: var(--dp-yellow);
    color: var(--dp-grey-900);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s;
    text-decoration: none;
}
.btn-quote:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.btn-quote .badge {
    background: var(--dp-grey-900);
    color: var(--dp-yellow);
    border-radius: 50%;
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
}

/* ───── NAV SECONDARIA (categorie) ───── */
.subnav {
    background: var(--dp-blue);
    color: #fff;
}
.subnav-inner {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.subnav a {
    color: #fff;
    padding: 14px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    text-decoration: none;
}
.subnav a:hover, .subnav a.active {
    background: var(--dp-blue-dark);
    border-bottom-color: var(--dp-yellow);
}

/* ───── CONTAINER ───── */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ───── HERO ───── */
.hero {
    background: linear-gradient(135deg, var(--dp-blue) 0%, var(--dp-blue-dark) 100%);
    color: #fff;
    padding: 60px 0 80px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    bottom: -50px; right: -50px;
    width: 400px; height: 400px;
    background: var(--dp-yellow);
    opacity: 0.08;
    border-radius: 50%;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    position: relative;
    z-index: 1;
}
.hero h1 {
    font-size: 3rem;
    line-height: 1.1;
    font-weight: 800;
    margin: 0 0 20px;
    letter-spacing: -0.02em;
}
.hero h1 span {
    color: var(--dp-yellow);
}
.hero p {
    font-size: 1.15rem;
    opacity: 0.95;
    margin: 0 0 30px;
    max-width: 540px;
}
.hero-search {
    background: #fff;
    padding: 6px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    gap: 6px;
    max-width: 560px;
}
.hero-search input {
    flex: 1;
    padding: 14px 18px;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--dp-grey-900);
}
.hero-search input:focus { outline: none; }
.hero-search button {
    background: var(--dp-blue);
    color: #fff;
    border: none;
    padding: 14px 26px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
}
.hero-search button:hover { background: var(--dp-blue-dark); }

.hero-stats {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
}
.hero-stat strong {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--dp-yellow);
}
.hero-stat span {
    font-size: 0.85rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ───── SEZIONI ───── */
section { padding: 60px 0; }
.section-title {
    text-align: center;
    margin-bottom: 40px;
}
.section-title h2 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}
.section-title p {
    color: var(--dp-grey-600);
    font-size: 1.1rem;
    margin: 0;
}

/* ───── COME FUNZIONA ───── */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.step {
    text-align: center;
    padding: 30px 20px;
    background: var(--dp-grey-50);
    border-radius: 14px;
    position: relative;
    transition: transform .2s;
}
.step:hover { transform: translateY(-4px); }
.step-num {
    width: 52px; height: 52px;
    background: var(--dp-blue);
    color: var(--dp-yellow);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 18px;
}
.step h3 {
    font-size: 1.15rem;
    margin: 0 0 8px;
    font-weight: 700;
}
.step p {
    color: var(--dp-grey-600);
    margin: 0;
    font-size: 0.95rem;
}

/* ───── CATEGORIE GRID ───── */
.categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.cat-card {
    background: #fff;
    border: 2px solid var(--dp-grey-100);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    transition: all .2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.cat-card:hover {
    border-color: var(--dp-blue);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.cat-card-icon {
    width: 64px; height: 64px;
    background: var(--dp-blue-light);
    color: var(--dp-blue);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    margin-bottom: 14px;
}
.cat-card h4 {
    font-size: 1rem;
    margin: 0 0 4px;
    font-weight: 600;
}
.cat-card span {
    font-size: 0.85rem;
    color: var(--dp-grey-600);
}

/* ───── CARD PRODOTTO ───── */
.products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}
.product-card {
    background: #fff;
    border: 1px solid var(--dp-grey-100);
    border-radius: 14px;
    overflow: hidden;
    transition: all .2s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}
.product-img {
    aspect-ratio: 4/3;
    background: var(--dp-grey-50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dp-grey-300);
    font-size: 3rem;
    position: relative;
}
.product-card:hover .product-img i { transform: scale(1.05); }
.product-img i { transition: transform .25s; }

.product-mepa-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--dp-yellow);
    color: var(--dp-grey-900);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: var(--shadow-sm);
}

.product-stock {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--dp-green);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
}
.product-stock.low { background: var(--dp-yellow-dark); }
.product-stock.out { background: var(--dp-red); }

.product-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.product-brand {
    font-size: 0.75rem;
    color: var(--dp-grey-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.product-name {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 10px;
    min-height: 44px;
}
.product-mepa-code {
    background: var(--dp-blue-light);
    color: var(--dp-blue-dark);
    padding: 6px 10px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 12px;
    word-break: break-all;
}
.product-mepa-code strong { color: var(--dp-blue); }
.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dp-grey-900);
    margin: 0 0 4px;
}
.product-price small {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dp-grey-600);
    margin-left: 4px;
}
.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: auto;
}
.product-actions .btn {
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all .15s;
}
.btn-mepa {
    background: var(--dp-blue);
    color: #fff;
}
.btn-mepa:hover { background: var(--dp-blue-dark); color: #fff; text-decoration: none; }
.btn-quote-sm {
    background: var(--dp-grey-100);
    color: var(--dp-grey-900);
}
.btn-quote-sm:hover { background: var(--dp-yellow); color: var(--dp-grey-900); text-decoration: none; }

/* ───── PERCHÉ NOI ───── */
.why-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.why-item {
    text-align: center;
    padding: 30px 20px;
}
.why-item i {
    font-size: 2.5rem;
    color: var(--dp-blue);
    margin-bottom: 14px;
}
.why-item h4 {
    font-size: 1.1rem;
    margin: 0 0 8px;
}
.why-item p {
    color: var(--dp-grey-600);
    font-size: 0.92rem;
    margin: 0;
}

/* ───── CTA ───── */
.cta {
    background: linear-gradient(135deg, var(--dp-yellow) 0%, var(--dp-yellow-dark) 100%);
    text-align: center;
    padding: 70px 20px;
}
.cta h2 {
    font-size: 2.4rem;
    margin: 0 0 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.cta p {
    font-size: 1.15rem;
    margin: 0 0 30px;
    color: var(--dp-grey-900);
}
.cta .btn-quote {
    background: var(--dp-grey-900);
    color: #fff;
    padding: 16px 32px;
    font-size: 1.05rem;
    border-radius: 12px;
}
.cta .btn-quote:hover { background: var(--dp-blue); }

/* ───── FOOTER ───── */
.footer {
    background: var(--dp-grey-900);
    color: var(--dp-grey-300);
    padding: 60px 0 20px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer h5 {
    color: #fff;
    font-size: 1rem;
    margin: 0 0 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; font-size: 0.9rem; }
.footer a { color: var(--dp-grey-300); }
.footer a:hover { color: var(--dp-yellow); }

.footer-brand { margin-bottom: 16px; }
.footer-brand .logo { color: #fff; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--dp-grey-600);
}

/* ───── PAGINA CATALOGO ───── */
.catalog {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    padding: 30px 0;
}
.filters {
    background: var(--dp-grey-50);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 100px;
}
.filters h4 { margin: 0 0 14px; font-size: 1rem; }
.filters .filter-group { margin-bottom: 24px; }
.filters label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.92rem;
    cursor: pointer;
}
.filters label:hover { color: var(--dp-blue); }
.filters .badge-count {
    margin-left: auto;
    color: var(--dp-grey-600);
    font-size: 0.78rem;
}
.filters input[type="range"] {
    width: 100%;
    accent-color: var(--dp-blue);
}

.catalog-results h2 { margin: 0 0 6px; font-size: 1.5rem; }
.catalog-results .count { color: var(--dp-grey-600); font-size: 0.9rem; margin-bottom: 20px; }
.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    align-items: center;
    gap: 16px;
}
.catalog-toolbar select {
    padding: 8px 12px;
    border: 1px solid var(--dp-grey-300);
    border-radius: 8px;
    font-size: 0.9rem;
}

/* ───── BREADCRUMB ───── */
.breadcrumb {
    padding: 16px 0;
    font-size: 0.85rem;
    color: var(--dp-grey-600);
}
.breadcrumb a { color: var(--dp-grey-600); }
.breadcrumb .sep { margin: 0 8px; color: var(--dp-grey-300); }

/* ───── PAGINA PRODOTTO ───── */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    padding: 30px 0 60px;
}
.product-gallery {
    background: var(--dp-grey-50);
    border-radius: 14px;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dp-grey-300);
    font-size: 8rem;
}
.product-info h1 {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 800;
    margin: 8px 0 16px;
}
.product-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--dp-grey-600);
}
.product-meta span {
    display: inline-flex; align-items: center; gap: 6px;
}
.product-meta i { color: var(--dp-blue); }

.mepa-box {
    background: var(--dp-blue-light);
    border: 2px solid var(--dp-blue);
    border-radius: 12px;
    padding: 18px;
    margin: 20px 0;
}
.mepa-box .label {
    font-size: 0.75rem;
    color: var(--dp-blue-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 4px;
}
.mepa-box .code {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 1.1rem;
    color: var(--dp-blue-dark);
    font-weight: 700;
}

.price-box {
    background: var(--dp-grey-50);
    padding: 24px;
    border-radius: 12px;
    margin: 24px 0;
}
.price-box .price-large {
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--dp-grey-900);
    line-height: 1;
}
.price-box small {
    color: var(--dp-grey-600);
    font-size: 0.95rem;
    display: block;
    margin-top: 4px;
}
.price-box .stock {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(22, 163, 74, .12);
    color: var(--dp-green);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
}

.cta-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}
.btn-large {
    padding: 16px 20px;
    font-size: 1rem;
    border-radius: 10px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all .15s;
}
.btn-large.btn-mepa { background: var(--dp-blue); color: #fff; }
.btn-large.btn-mepa:hover { background: var(--dp-blue-dark); transform: translateY(-1px); }
.btn-large.btn-quote { background: var(--dp-yellow); color: var(--dp-grey-900); }
.btn-large.btn-quote:hover { background: var(--dp-yellow-dark); transform: translateY(-1px); }

.tabs {
    border-bottom: 2px solid var(--dp-grey-100);
    display: flex;
    gap: 4px;
    margin-top: 20px;
}
.tabs button {
    background: none;
    border: none;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--dp-grey-600);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.tabs button.active { color: var(--dp-blue); border-bottom-color: var(--dp-blue); }
.tab-content { padding: 24px 0; }
.tab-content table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tab-content td { padding: 10px 12px; border-bottom: 1px solid var(--dp-grey-100); }
.tab-content td:first-child { color: var(--dp-grey-600); width: 40%; }

/* ───── PAGINA PREVENTIVO ───── */
.quote-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 40px;
    padding: 30px 0;
}
.quote-form {
    background: #fff;
    border: 1px solid var(--dp-grey-100);
    border-radius: 14px;
    padding: 28px;
}
.quote-form h2 { margin: 0 0 6px; font-size: 1.4rem; }
.quote-form p.lead { color: var(--dp-grey-600); margin: 0 0 24px; font-size: 0.95rem; }
.quote-form .row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.quote-form .field { display: flex; flex-direction: column; }
.quote-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dp-grey-900);
    margin-bottom: 6px;
}
.quote-form label .req { color: var(--dp-red); }
.quote-form input, .quote-form textarea, .quote-form select {
    padding: 11px 14px;
    border: 1px solid var(--dp-grey-300);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}
.quote-form input:focus, .quote-form textarea:focus, .quote-form select:focus {
    outline: none;
    border-color: var(--dp-blue);
    box-shadow: 0 0 0 3px var(--dp-blue-light);
}
.quote-form .submit {
    margin-top: 20px;
    padding: 14px 28px;
    background: var(--dp-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}
.quote-form .submit:hover { background: var(--dp-blue-dark); }

.quote-cart {
    background: var(--dp-grey-50);
    border-radius: 14px;
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 100px;
}
.quote-cart h3 { margin: 0 0 16px; font-size: 1.15rem; }
.cart-item {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--dp-grey-100);
    align-items: center;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
    width: 50px; height: 50px;
    background: #fff;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: var(--dp-grey-300);
    font-size: 1.4rem;
}
.cart-item-name { font-size: 0.85rem; line-height: 1.3; font-weight: 500; }
.cart-item-mepa { font-size: 0.7rem; color: var(--dp-blue); font-family: monospace; }
.cart-item-qty { display: flex; align-items: center; gap: 6px; }
.cart-item-qty button {
    width: 24px; height: 24px;
    background: #fff;
    border: 1px solid var(--dp-grey-300);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--dp-grey-600);
}
.cart-item-qty input { width: 36px; text-align: center; padding: 4px; border: 1px solid var(--dp-grey-300); border-radius: 4px; }

.cart-total {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px solid var(--dp-grey-100);
}
.cart-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}
.cart-total-row.grand {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--dp-grey-900);
    margin-top: 12px;
}

/* ───── RESPONSIVE ───── */
@media (max-width: 900px) {
    .hero h1 { font-size: 2.2rem; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-img { display: none; }
    .steps, .why-grid, .footer-grid { grid-template-columns: 1fr 1fr; }
    .categories, .products { grid-template-columns: 1fr 1fr; }
    .catalog, .product-detail, .quote-grid { grid-template-columns: 1fr; }
    .filters { position: static; }
}
@media (max-width: 600px) {
    .steps, .why-grid, .footer-grid, .categories, .products { grid-template-columns: 1fr; }
    .nav-search { width: 100%; max-width: none; }
    .product-actions { grid-template-columns: 1fr; }
    .cta-buttons { grid-template-columns: 1fr; }
}
