/* ============================================================
   BARBERSHOP WEBAPP - MAIN STYLESHEET
   Mobile First | Responsive | Modern Design
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #1a1a2e;
    --primary-light: #16213e;
    --accent: #c9a84c;
    --accent-hover: #b8953e;
    --success: #28a745;
    --warning: #f0ad4e;
    --danger: #dc3545;
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg: #fff;
    --bg-light: #f8f9fa;
    --bg-dark: #1a1a2e;
    --border: #e0e0e0;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --transition: 0.3s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

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

/* ---------- Container ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.container-sm { max-width: 700px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; color: var(--primary); }
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    line-height: 1.4;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #c82333; }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #218838; }

.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #e09d3d; }

.btn-accent { background: var(--bg-light); color: var(--accent); border-color: var(--primary); }
.btn-accent:hover { background: var(--primary-light); color: var(--accent); }

.btn-lg { padding: 0.9rem 2.2rem; font-size: 1.1rem; }
.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; }

/* ---------- Navbar ---------- */
.navbar {
    background: var(--bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 0;
}
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.navbar-brand {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.navbar-brand:hover { color: var(--accent); }

.brand-icon { font-size: 1.3em; }

.navbar-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.navbar-menu {
    list-style: none;
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: 1rem;
    gap: 0.5rem;
}
.navbar-menu.open { display: flex; }
.navbar-menu li a {
    display: block;
    padding: 0.5rem 0;
    color: var(--text);
    font-weight: 500;
}
.navbar-menu li a:hover { color: var(--accent); }
.navbar-greeting { font-weight: 500; color: var(--text-light); font-size: 0.9rem; padding: 0.5rem 0; display: block; }

/* ---------- Sections ---------- */
.section { padding: 4rem 0; }
.section-dark { background: var(--bg-dark); color: #fff; }
.section-dark h2 { color: #fff; }
.section-dark .section-title::after { background: var(--accent); }
.section-light { background: var(--bg-light); }

/* ---------- Hero Slider (Swiper) ---------- */
.hero-slider { background: var(--primary); }
.hero-slider .swiper { width: 100%; min-height: 80vh; }

.hero-slide {
    min-height: 80vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    position: relative;
}
.hero-slide-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1;
}
.hero-slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 2rem 1rem;
    width: 100%;
}
.hero-slide-content h1 { color: #fff; font-size: 2.5rem; margin-bottom: 1rem; }
.hero-slide-content p { font-size: 1.15rem; color: rgba(255,255,255,0.85); max-width: 500px; margin: 0 auto 2rem; }

/* Swiper custom colors */
.hero-slider .swiper-button-prev,
.hero-slider .swiper-button-next {
    color: #fff;
    background: rgba(255,255,255,0.15);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    backdrop-filter: blur(4px);
    transition: background var(--transition);
}
.hero-slider .swiper-button-prev:hover,
.hero-slider .swiper-button-next:hover { background: rgba(255,255,255,0.3); }
.hero-slider .swiper-button-prev::after,
.hero-slider .swiper-button-next::after { font-size: 1.2rem; }

.hero-slider .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.5);
    opacity: 1;
}
.hero-slider .swiper-pagination-bullet-active { background: var(--accent); }

@media (min-width: 600px) {
    .hero-slide-content h1 { font-size: 3.2rem; }
}
@media (min-width: 992px) {
    .hero-slide-content h1 { font-size: 3.8rem; }
}

/* ---------- Service Card Image ---------- */
.service-card-img {
    width: 100%;
    height: 180px;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    margin: -2rem -1.5rem 1rem;
    width: calc(100% + 3rem);
}
.service-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-header {
    background: var(--bg-dark);
    color: #fff;
    padding: 3rem 0 2rem;
    text-align: center;
}
.page-header h1 { color: #fff; margin-bottom: 0.5rem; }
.page-header p { color: rgba(255,255,255,0.7); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    overflow: hidden;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="rgba(201,168,76,0.1)"/></svg>') repeat;
    background-size: 30px;
    opacity: 0.5;
}
.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
    padding: 2rem 1rem;
}
.hero-content h1 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 1rem;
}
.hero-content p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.8);
    max-width: 500px;
    margin: 0 auto 2rem;
}

/* ---------- Services Grid ---------- */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.service-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.service-card-icon { font-size: 2rem; margin-bottom: 1rem; color: var(--accent); }
.service-card h3 { margin-bottom: 0.5rem; }
.service-card p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 1rem; }
.service-card-meta { display: flex; justify-content: center; gap: 1.5rem; font-weight: 600; }
.service-duration { color: var(--text-muted); }
.service-price { color: var(--accent); font-size: 1.1rem; }

/* ---------- Services List (Servizi page) ---------- */
.category-title {
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}
.services-list { display: flex; flex-direction: column; gap: 1rem; }
.service-list-item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.service-info h3 { margin-bottom: 0.25rem; }
.service-info p { color: var(--text-light); font-size: 0.9rem; }
.service-list-img { width: 120px; height: 80px; flex-shrink: 0; border-radius: var(--radius); overflow: hidden; }
.service-list-img img { width: 100%; height: 100%; object-fit: cover; }

.service-duration-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.6rem;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.service-price-action { display: flex; align-items: center; gap: 1rem; }
.service-price-action .price { font-size: 1.3rem; font-weight: 700; color: var(--accent); }

/* ---------- Orari Table ---------- */
.orari-table-wrapper { max-width: 500px; margin: 0 auto; }
.orari-table { width: 100%; border-collapse: collapse; }
.orari-table tr { border-bottom: 1px solid var(--border); }
.orari-table tr.chiuso { opacity: 0.5; }
.orari-table td { padding: 0.8rem 0.5rem; }
.orari-table .giorno { font-weight: 600; }
.orari-table small { display: block; color: var(--text-muted); font-size: 0.8rem; }

/* ---------- Map ---------- */
.map-wrapper { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }

/* ---------- Reviews ---------- */
.reviews-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.review-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
}
.review-stars { color: var(--accent); font-size: 1.2rem; margin-bottom: 0.5rem; }
.review-card p { font-style: italic; color: var(--text); margin-bottom: 0.5rem; }
.review-author { color: var(--text-muted); font-size: 0.9rem; font-weight: 600; }

/* ---------- Booking Steps ---------- */
.booking-steps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.booking-steps .step {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
}
.booking-steps .step.active { background: var(--accent); color: #fff; }
.booking-steps .step.done { background: var(--success); color: #fff; }

/* ---------- Service Select (Step 1) ---------- */
.service-select-list { display: flex; flex-direction: column; gap: 0.75rem; }
.service-select-item {
    display: block;
    cursor: pointer;
}
.service-select-item input[type="radio"] { display: none; }
.service-select-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}
.service-select-item input:checked + .service-select-content {
    border-color: var(--accent);
    background: rgba(201,168,76,0.05);
    box-shadow: 0 0 0 1px var(--accent);
}
.service-select-info strong { display: block; font-size: 1.05rem; }
.service-select-info span { color: var(--text-light); font-size: 0.9rem; }
.service-select-meta { display: flex; gap: 1rem; font-weight: 600; }
.service-select-meta strong { color: var(--accent); }

/* ---------- Selected Service Badge ---------- */
.selected-service-badge {
    background: var(--bg-light);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ---------- Calendar ---------- */
.calendar-wrapper { margin-bottom: 2rem; }
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.05rem;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.calendar-grid .cal-header {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
}
.calendar-grid .cal-day {
    padding: 0.7rem 0.25rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition);
    border: 2px solid transparent;
    font-size: 0.95rem;
}
.calendar-grid .cal-day:hover:not(.disabled) { background: rgba(201,168,76,0.1); }
.calendar-grid .cal-day.disabled { color: var(--text-muted); opacity: 0.4; cursor: not-allowed; }
.calendar-grid .cal-day.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.calendar-grid .cal-day.today { border-color: var(--accent); }
.calendar-grid .cal-empty { padding: 0.7rem; }

/* ---------- Slots Grid ---------- */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.slot-btn {
    padding: 0.7rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font);
    transition: all var(--transition);
    text-align: center;
}
.slot-btn:hover { border-color: var(--accent); background: rgba(201,168,76,0.05); }
.slot-btn.selected { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Spinner ---------- */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Booking Summary ---------- */
.booking-summary {
    background: var(--bg-light);
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
    border: 1px solid var(--border);
}
.booking-summary p { margin-bottom: 0.25rem; }

/* ---------- Success Page ---------- */
.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}
.success-details {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.success-details p { margin-bottom: 0.5rem; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.35rem; font-size: 0.9rem; }

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: border-color var(--transition);
    background: var(--bg);
    color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--accent); }
.form-control-sm { padding: 0.4rem 0.6rem; font-size: 0.85rem; }

textarea.form-control { resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }

.form-row { display: flex; flex-direction: column; gap: 0; }
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}
.checkbox-label input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* ---------- Alerts ---------- */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}
.alert-error { background: #fde8e8; color: var(--danger); border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* ---------- Footer ---------- */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.7);
    padding: 3rem 0 1.5rem;
}
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.footer-col h4 { color: #fff; margin-bottom: 1rem; font-size: 1.1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-col ul li a { color: rgba(255,255,255,0.6); }
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
}

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table thead th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table tbody td { padding: 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: var(--bg-light); }
.table-responsive { overflow-x: auto; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-prenotato { background: #cce5ff; color: #004085; }
.badge-completato { background: #d4edda; color: #155724; }
.badge-annullato { background: #f8d7da; color: #721c24; }

/* ---------- Inline Forms ---------- */
.inline-form { display: inline; }
.actions { white-space: nowrap; }
.actions form, .actions a { margin-right: 0.25rem; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet (>= 600px) */
@media (min-width: 600px) {
    h1 { font-size: 2.5rem; }
    .hero-content h1 { font-size: 3.2rem; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .reviews-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { flex-direction: row; gap: 1rem; }
    .form-row .form-group { flex: 1; }
    .service-list-item { flex-direction: row; justify-content: space-between; align-items: center; }
    .slots-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Desktop (>= 992px) */
@media (min-width: 992px) {
    .navbar-toggle { display: none; }
    .navbar-menu {
        display: flex !important;
        width: auto;
        flex-direction: row;
        padding-top: 0;
        gap: 0.25rem;
        align-items: center;
    }
    .navbar-menu li a { padding: 0.5rem 1rem; }

    .hero-content h1 { font-size: 3.8rem; }
    .services-grid { grid-template-columns: repeat(3, 1fr); }
    .reviews-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
    .slots-grid { grid-template-columns: repeat(5, 1fr); }
}

/* Large desktop (>= 1200px) */
@media (min-width: 1200px) {
    .container { padding: 0 2rem; }
}
