/* =========================================
   Stili Centralizzati dei Componenti
   Include: Card, Tipografia, Moduli, ecc.
   ========================================= */

:root {
    --card-bg: #ffffff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --card-border: #214ecd;
    --input-border: #ddd;
    --input-focus: var(--primary-color, #0757a9);
    --text-primary: #333;
    --text-secondary: #666;
    --btn-font-weight: 700;
    --btn-transition: all 0.3s ease;
}

/* Brand helpers */
.brand-f1000 {
    font-weight: 800;
}

.brand-plus {
    font-weight: 400 !important;
}

.brand-interactive {
    font-weight: 800;
}

.brand-sl {
    font-weight: 400 !important;
}

/* =========================================
   1. CARD (Sistema Unificato di Card)
   ========================================= */
.card {
    border-radius: 0;
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: background-color 0.3s ease, box-shadow 200ms ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    background-color: #f9fafb;
    box-shadow: var(--card-shadow), 0 0 0 1px var(--card-border, #214ecd);
}

.card:focus-visible {
    outline: none;
    box-shadow: var(--card-shadow), 0 0 0 2px rgba(24, 99, 255, 0.35);
}

.card-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title,
.card h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-color, #0757a9);
    font-size: 2rem;
    font-weight: 700;
}

.card-text,
.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.card-bordered {
    border: 1px solid #eee;
    box-shadow: none;
}

.card-service {
    text-align: center;
    padding: 2rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-service:hover {
    background-color: #f9fafb;
}

.card-icon {
    width: 200px;
    height: 200px;
    margin-bottom: 1.5rem;
    color: var(--primary-color, #0757a9);
    transition: transform 0.3s ease;
}

.card-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.card-service:hover .card-icon {
    transform: scale(1.1);
}

.card-overlay {
    height: 350px;
    position: relative;
    background: #0b2b85;
    color: #fff;
    display: block;
    text-decoration: none;
    overflow: hidden;
    box-shadow: none !important;
    border: none !important;
}

.card-overlay:hover {
    box-shadow: none !important;
    transform: none !important;
}

.card-overlay-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
    opacity: 1;
}

.card-overlay:hover .card-overlay-img {
    transform: scale(1.1);
    opacity: 0.8;
}

.card-overlay-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    z-index: 2;
    transition: background 0.4s ease;
}

.card-overlay:hover .card-overlay-content {
    background: linear-gradient(to top, rgba(11, 43, 133, 0.9), transparent);
}

.card-overlay h3 {
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.card-overlay p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.card-overlay:hover p {
    max-height: 200px;
    opacity: 1;
    margin-top: 1rem;
}

.card-press {
    background: #fff;
    border-radius: 0;
}

.card-press .card-image {
    height: 240px;
    transition: transform 0.5s ease;
}

.card-press:hover .card-image {
    transform: scale(1.05);
}

.card-press .card-content {
    padding: 24px;
}

.card-press h3 {
    font-size: 1.5rem;
    color: var(--blue-1, #0757a9);
}

/* =========================================
   2. TIPOGRAFIA
   ========================================= */
.section-title-global {
    font-size: 2.5rem;
    color: var(--primary-color, #0757a9);
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 300;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 800px;
    margin: -1rem auto 3rem auto;
    line-height: 1.6;
}

.section-title {
    font-size: 2rem;
    color: var(--primary-color, #0757a9);
    margin-bottom: 1rem;
    font-weight: 700 !important;
}

/* =========================================
   3. FORM
   ========================================= */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-field {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--input-border);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(7, 87, 169, 0.1);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* =========================================
   4. UTILITIES
   ========================================= */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

/* =========================================
   5. BOTTONI
   ========================================= */
.btn,
.btn-hero-cta {
    display: inline-block;
    padding: 12px 28px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: var(--btn-font-weight);
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--btn-transition);
    letter-spacing: 0.5px;
    box-shadow: none;
    position: relative;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background-color: var(--primary-color, #0757a9);
    color: var(--white-color, #fff);
    border-color: var(--primary-color, #0757a9);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #044080;
    border-color: #044080;
    color: #fff;
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color, #0757a9);
    border-color: var(--primary-color, #0757a9);
}

.btn-outline:hover,
.btn-outline:focus {
    background-color: var(--primary-color, #0757a9);
    color: #fff;
}

.btn-hero,
.btn-hero-cta {
    background-color: transparent;
    color: #fff;
    border-color: #fff;
}

.btn-hero:hover,
.btn-hero:focus,
.btn-hero-cta:hover,
.btn-hero-cta:focus {
    background-color: #fff;
    color: var(--primary-color, #0757a9);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* =========================================
   5b. SQUARE CORNERS (Cards + Buttons)
   ========================================= */
:where(
    .card,
    .card-base,
    .card-service,
    .card-press,
    .prod-card,
    .product-card,
    .feature-card,
    .phase-card,
    .openclose-card,
    .cadcam-cta,
    .carousel-container,
    .video-wrapper,
    .menu-card,
    [class*="card"]
) {
    border-radius: 0 !important;
}

:where(
    .btn,
    .btn-hero-cta,
    .hero-cta,
    .btn-submit,
    a.btn,
    [class*="btn"],
    button,
    input[type="button"],
    input[type="submit"],
    input[type="reset"],
    .carousel-btn,
    .carousel-dot
) {
    border-radius: 0 !important;
}

/* =========================================
   6. CARD LAYOUT (Griglie)
   ========================================= */
.cards-section {
    padding: 4rem 2rem;
    max-width: var(--container, 1536px);
    margin: 0 auto;
}

.cards-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.cards-grid-5 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.section-title-cards {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #061647;
    font-weight: 700;
}

/* =========================================
   7. BACK BUTTON
   ========================================= */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: inherit;
    text-decoration: none;
    margin-bottom: 2rem;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    z-index: 30;
    position: relative;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.back-btn:hover {
    opacity: 1;
}

.back-btn::before {
    content: "←";
    font-size: 1.2em;
    transition: transform 0.2s;
}

.back-btn:hover::before {
    transform: translateX(-4px);
}

.back-btn.dark {
    color: var(--blue-1);
}

.back-btn.light {
    color: #fff;
}

.back-nav-wrapper {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 10;
}

.hero .back-nav-wrapper,
.marpe-hero .back-nav-wrapper,
.cat-banner .back-nav-wrapper {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--container, 1536px);
    padding: 0 20px;
    z-index: 50;
    margin-bottom: 0;
    pointer-events: none;
}

.hero .back-nav-wrapper a,
.marpe-hero .back-nav-wrapper a,
.cat-banner .back-nav-wrapper a {
    pointer-events: auto;
}

/* =========================================
   8. BREADCRUMB
   ========================================= */
.breadcrumb-nav {
    display: block;
    pointer-events: auto;
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
}

.breadcrumb-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
}

.breadcrumb-list li a:hover {
    color: var(--blue-1);
    text-decoration: underline;
}

.breadcrumb-list li:not(:last-child)::after {
    content: "\203A";
    margin-left: 10px;
    font-size: 1.4rem;
    line-height: 0.8;
    color: #999;
    font-weight: 400;
}

.breadcrumb-list li:last-child {
    font-weight: 700;
    color: #111;
    cursor: default;
}

/* =========================================
   9. BADGES
   ========================================= */
.card-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 10;
}

.badge {
    display: inline-block;
    padding: 2.5px 8px;
    border-radius: 16px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    background-color: rgba(33, 78, 205, 0.85);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
    text-decoration: none;
}

.badge-sector {
    background-color: rgba(11, 43, 133, 0.7);
}

.badge-level {
    background-color: rgba(108, 117, 125, 0.7);
}

.badge-presence {
    background-color: rgba(173, 181, 189, 0.7);
    color: #333;
}
