﻿/* ===========================================
   QuickMastro - Modern Order Form CSS
   Responsive & Professional Design
   =========================================== */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    
    /* Grays */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Spacing */
    --container-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Transitions */
    --transition: all 0.3s ease;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* === LOADING OVERLAY === */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--spacing-md);
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === HEADER === */
.header {
    background: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
}

.logo-img {
    height: 50px; /* prende tutta l'altezza della navbar */
    width: auto; /* mantiene le proporzioni */
    display: block;
}

 
/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--gray-800);
    transition: var(--transition);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Navigation */
.nav {
    display: flex;
    gap: var(--spacing-lg);
}

.nav a {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
    /* Nasconde tutti i dropdown */
    .nav .dropdown-menu {
        display: none;
        position: absolute;
        background: white;
        padding: 8px 0;
        min-width: 220px;
        border-radius: 6px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.15);
        z-index: 9999;
        list-style: none; /*  Rimuove i cerchi */
        padding-left: 0; 
        margin: 0;
    }

    /* Mostra menu solo quando il mouse passa sopra */
    .nav .dropdown:hover > .dropdown-menu {
        display: block;
    }
    .nav .dropdown-menu li {
        list-style-type: none !important;
    }
    /* Le voci dentro il menu */
    .nav .dropdown-menu li a {
        display: block;
        padding: 8px 15px;
    }
/* === MAIN CONTENT === */
.main-content {
    padding: var(--spacing-xl) 0;
    min-height: calc(100vh - 400px);
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.page-header h2 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
}

.page-header .subtitle {
    font-size: var(--font-size-lg);
    color: var(--gray-600);
}

/* === FORM SECTIONS === */
.form-section {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--gray-200);
}

.section-header i {
    font-size: var(--font-size-xl);
    color: var(--primary-color);
}

.section-header h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-900);
}

/* === PRODUCT CARDS === */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom:  var(--spacing-sm);
    height:fit-content;
}

.product-card {
    position: relative;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    overflow: hidden;
    height: 220px;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.product-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

    .product-card input[type="radio"]:checked + label {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        color: white;
        border-color: var(--primary-color);
    }

.product-card input[type="radio"]:checked + label .product-icon,
.product-card input[type="radio"]:checked + label h4,
.product-card input[type="radio"]:checked + label .product-price,
.product-card input[type="radio"]:checked + label .product-features li {
    color: white;
}

.product-card label {
    display: block;
    padding: 4px
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.product-icon {
    font-size: 3rem;
    color: #3b6f9b;
    margin-bottom: var(--spacing-sm);
}

.product-card h4 {
    font-size: var(--font-size-lg);
    line-height:1;
    font-weight: 700;
    margin-bottom: 1px;
    color: var(--gray-900);
    padding-top: 18px;
}

.product-price {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: #3b6f9b;
    margin-bottom: 0px;
}

.product-price span {
    font-size: var(--font-size-sm);
    font-weight: 400;
}

.product-features {
    list-style: none;
    text-align: left;
    padding: 0 0 0;
    border-top: 1px solid var(--gray-200);
}

.product-features li {
    padding: 0 0;
    color: var(--gray-700);
    font-size: var(--font-size-sm);
}

.product-features i {
    color: var(--secondary-color);
    margin-right: 0.1rem;
}




/* Badge */
.badge {
    position: absolute;
    top: -5px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    padding: 0.05rem 0.40rem;
    border-radius: 8px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    z-index: 1;
}

.product-card.popular .badge {
    background: var(--secondary-color);
}

.product-card.premium .badge {
    background:  #ef4444;
}

/* === ORDER SUMMARY === */
.order-summary {
    background-color: #3b6f9b;
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    color: white;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    margin: 0 auto;
}

.summary-content h3 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-sm);
}

.summary-row {
    font-size: var(--font-size-xl);
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.summary-row.total {
    border-bottom: none;
    padding-top: var(--spacing-sm);
    font-size: var(--font-size-xl);
    font-weight: 500;
}

/* === FORM ELEMENTS === */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.form-row.extras-section {
    background: var(--gray-50);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group.flex-3 {
    grid-column: span 3;
}

.form-group.flex-1 {
    grid-column: span 1;
}

.form-group label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-control {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control:invalid:not(:placeholder-shown) {
    border-color: var(--danger-color);
}

.form-group small {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Checkbox Groups */
.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-label strong {
    color: var(--secondary-color);
}

/* Hidden */
.hidden {
    display: none !important;
}

/* === LEGAL BOXES === */
.legal-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
   /* gap: var(--spacing-sm);*/
}

.legal-box {
    background: var(--gray-50);
    line-height: 1.4;
    /*    padding: var(--spacing-sm);
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-200);*/
    padding: 10px;
    margin: 10px;
}

    .legal-box h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-lg);
    color: var(--gray-900);
}

 
 

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 5px;
    transition: var(--transition);
}

.btn-link:hover {
    color: var(--primary-dark);
}

.legal-box .checkbox-label {
    margin-top: 5px;
}

/* === FORM ACTIONS === */
.form-actions {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.info-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    color: var(--gray-600);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
}

.info-text i {
    color: var(--primary-color);
    font-size: var(--font-size-lg);
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 1rem 3rem;
    /* background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);*/
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-lg);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    background-color: #10b981;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-submit:active {
    transform: translateY(0);
}

/* === FOOTER === */
.footer {
    background: var(--gray-900);
    color: white;
    padding: var(--spacing-md) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-section h4 {
    font-size: var(--font-size-lg);
    margin-bottom: 0.5rem;
}

.footer-section p {
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}

.footer-section a {
    display: block;
    color: var(--gray-400);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--gray-700);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.footer-bottom p {
    color: var(--gray-400);
}

.footer-links {
    display: flex;
    gap: var(--spacing-md);
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .summary-content h3 {
        font-size: 1.0rem;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 10px;
        margin-bottom: var(--spacing-sm);
      height:fit-content;
    }
    .product-card {
        position: relative;
        border: 2px solid var(--gray-200);
        border-radius: var(--radius-lg);
        transition: var(--transition);
        overflow: hidden;
        height: 280px;
    }
}

@media (max-width: 768px) {
    .summary-content h3 {
        font-size: 1.0rem;
    }
    .product-card {
        position: relative;
        border: 2px solid var(--gray-200);
        border-radius: var(--radius-lg);
        transition: var(--transition);
        overflow: hidden;
        height: 280px;
    }
    .products-grid {
        grid-template-columns: 1fr;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 10px;
        margin-bottom: var(--spacing-sm);
        height: fit-content;
    }
    :root {
        --container-width: 100%;
        --spacing-xl: 2rem;
        --spacing-lg: 1.5rem;
    }
    .logo img {
        width: 75% !important;
        height: auto;
    }
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: var(--spacing-md);
        box-shadow: var(--shadow-lg);
        display: none;
    }
    
    .nav.active {
        display: flex;
    }
    
    .nav a {
        padding: var(--spacing-sm) 0;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .page-header h2 {
        font-size: var(--font-size-2xl);
    }
    
 
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-group.flex-3,
    .form-group.flex-1 {
        grid-column: span 1;
    }
    
    .legal-boxes {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .btn-submit {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .summary-content h3 {
        font-size:1.0rem;
    }
    .products-grid {
        grid-template-columns: 1fr;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 10px;
        margin-bottom: var(--spacing-sm);
        height: fit-content;
    }
    .product-card {
        position: relative;
        border: 2px solid var(--gray-200);
        border-radius: var(--radius-lg);
        transition: var(--transition);
        overflow: hidden;
        height: 280px;
    }


    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .form-section {
        padding: var(--spacing-md);
    }
    
    .product-card label {
        padding: var(--spacing-md);
    }
    
    .btn-submit {
        padding: 0.875rem 1.5rem;
        font-size: var(--font-size-base);
    }
}

/* === PRINT STYLES === */
@media print {
    .header,
    .footer,
    .form-actions,
    .mobile-menu-toggle {
        display: none;
    }
    
    .form-section {
        box-shadow: none;
        break-inside: avoid;
    }
}
