@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Lato:wght@300;400;600;700&display=swap');

:root {
  /* Palette Ristorante Elegante */
  --brand-wine: #8B2635;        /* Rosso vino elegante */
  --brand-gold: #C9A961;        /* Oro caldo e raffinato */
  --brand-cream: #F5E6D3;       /* Crema accogliente */
  --brand-dark: #3D2817;        /* Marrone scuro elegante */
  --brand-light: #FDF8F3;       /* Beige chiaro */
  --text-muted: #6B5B4F;        /* Marrone medio */
  --accent-red: #A52A2A;        /* Rosso corallo per accenti */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--brand-light);
  color: var(--brand-dark);
  line-height: 1.6;
}

.hero {
  min-height: 80vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(139, 38, 53, 0.85), rgba(61, 40, 23, 0.75)),
    url('https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?auto=format&fit=crop&w=1400&q=80') center/cover;
  color: white;
  padding: 4rem 1.5rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2px,
    rgba(201, 169, 97, 0.03) 2px,
    rgba(201, 169, 97, 0.03) 4px
  );
  pointer-events: none;
}

.hero__content {
  max-width: 720px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  margin-bottom: 1rem;
  font-weight: 700;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.125rem;
  line-height: 1.6;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

.hero .eyebrow {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-gold);
  margin-bottom: 0.5rem;
  display: block;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  background: var(--brand-gold);
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: none;
  margin-top: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(201, 169, 97, 0.4);
}

.btn:hover {
  background: var(--brand-wine);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 38, 53, 0.5);
}

.section {
  padding: 4rem 1.5rem;
}

.section h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-family: 'Playfair Display', serif;
  color: var(--brand-wine);
  font-size: clamp(2rem, 3vw, 2.5rem);
  font-weight: 600;
}

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

.card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(61, 40, 23, 0.12);
  border: 1px solid rgba(201, 169, 97, 0.2);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(61, 40, 23, 0.18);
  border-color: var(--brand-gold);
}

.card h3 {
  margin-top: 0;
}

.chatbot-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--brand-gold), #D4B87A);
  color: var(--brand-dark);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(139, 38, 53, 0.3);
  transition: all 0.3s ease;
  font-family: 'Lato', sans-serif;
}

.chatbot-toggle:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 32px rgba(139, 38, 53, 0.4);
  background: linear-gradient(135deg, var(--brand-wine), #A52A2A);
  color: white;
}

.chatbot-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: min(380px, calc(100vw - 2rem));
  height: 600px;
  max-height: 70vh; /* Aumentato al 70% dello schermo */
  border-radius: 20px;
  background: white;
  box-shadow: 0 20px 60px rgba(61, 40, 23, 0.3), 0 0 0 1px rgba(201, 169, 97, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 10;
  border: 2px solid var(--brand-gold);
  overflow: hidden;
}

.chatbot-widget.is-hidden {
  display: none;
}

.chatbot-widget__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--brand-wine), #6B1F2A);
  color: white;
  flex-shrink: 0;
  border-bottom: 2px solid var(--brand-gold);
  position: relative;
}

.chatbot-widget__header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand-gold), transparent);
}

.chatbot-widget__close {
  border: none;
  background: transparent;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.chatbot-widget__messages {
  position: relative;
  padding: 1rem 1.5rem;
  padding-right: 1rem;
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(to bottom, #FFFBF7, var(--brand-cream));
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Freccia SU sempre visibile */
.chatbot-messages-scroll-indicator-up {
  position: sticky;
  top: -1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 30px;
  background: linear-gradient(135deg, var(--brand-gold), #D4B87A);
  color: var(--brand-dark);
  border-radius: 0 0 15px 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(139, 38, 53, 0.3);
  z-index: 100;
  margin-bottom: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.chatbot-messages-scroll-indicator-up.visible {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

/* Freccia GIÙ sempre visibile */
.chatbot-messages-scroll-indicator-down {
  position: sticky;
  bottom: -1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 30px;
  background: linear-gradient(135deg, var(--brand-gold), #D4B87A);
  color: var(--brand-dark);
  border-radius: 15px 15px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(139, 38, 53, 0.3);
  z-index: 100;
  margin-top: 0.5rem;
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

/* Scrollbar SEMPRE VISIBILE anche su Safari/macOS */
.chatbot-widget__messages::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 16px;
}

.chatbot-widget__messages::-webkit-scrollbar-track {
  background-color: var(--brand-cream);
  border-radius: 8px;
  margin: 4px 0;
}

.chatbot-widget__messages::-webkit-scrollbar-thumb {
  background-color: var(--brand-gold);
  border-radius: 8px;
  border: 3px solid var(--brand-cream);
  min-height: 50px;
}

.chatbot-widget__messages::-webkit-scrollbar-thumb:hover {
  background-color: var(--brand-wine);
}

.chatbot-widget__messages::-webkit-scrollbar-thumb:active {
  background-color: var(--brand-dark);
}

/* Firefox scrollbar */
.chatbot-widget__messages {
  scrollbar-width: auto;
  scrollbar-color: var(--brand-gold) var(--brand-cream);
}

/* Forza Safari a mostrare SEMPRE la scrollbar */
.chatbot-widget__messages::-webkit-scrollbar-thumb:vertical {
  background-color: #64748b;
}

.chatbot-widget__messages::-webkit-scrollbar-corner {
  background-color: #e2e8f0;
}

/* Pulsante scroll to top - SEMPRE VISIBILE con animazione pulse per Safari */
.chatbot-scroll-top {
  position: sticky;
  bottom: 0.5rem;
  left: calc(100% - 3rem);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-gold), #D4B87A);
  color: var(--brand-dark);
  border: 3px solid white;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: bold;
  box-shadow: 0 6px 20px rgba(139, 38, 53, 0.4);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  margin-top: auto;
  margin-bottom: -3.5rem;
  flex-shrink: 0;
}

.chatbot-scroll-top:hover {
  transform: scale(1.15);
  background: linear-gradient(135deg, var(--brand-wine), #A52A2A);
  color: white;
  box-shadow: 0 8px 24px rgba(139, 38, 53, 0.6);
}

.chatbot-scroll-top.is-visible {
  display: flex;
  opacity: 0.95;
  pointer-events: auto;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.message {
  padding: 0.75rem 1rem;
  margin-right: 0.5rem;
  border-radius: 16px;
  max-width: 85%;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.message.assistant {
  background: white;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border-left: 3px solid var(--brand-gold);
  box-shadow: 0 2px 8px rgba(61, 40, 23, 0.1);
}

.message.user {
  background: linear-gradient(135deg, var(--brand-gold), #D4B87A);
  color: var(--brand-dark);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(201, 169, 97, 0.3);
}

.chatbot-widget__form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem 1.25rem;
  background: white;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}

.chatbot-widget__form input {
  flex: 1;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
}

.chatbot-widget__form button {
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, var(--brand-wine), #6B1F2A);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatbot-widget__form button:hover {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-wine));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 38, 53, 0.4);
}

/* Quick Actions Buttons */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin: 0.5rem 0;
}

.quick-action-btn {
  background: white;
  border: 2px solid var(--brand-gold);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-dark);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 2px 6px rgba(201, 169, 97, 0.2);
}

.quick-action-btn:hover {
  background: linear-gradient(135deg, var(--brand-gold), #D4B87A);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 169, 97, 0.4);
  border-color: var(--brand-wine);
}

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

.quick-actions.hidden {
  display: none;
}

/* Pulsante Prenotazione */
.reservation-btn {
  background: linear-gradient(135deg, var(--brand-gold), #D4B87A);
  color: var(--brand-dark);
  border: none;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
  width: 100%;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(201, 169, 97, 0.4);
}

.reservation-btn:hover {
  background: linear-gradient(135deg, var(--brand-wine), #A52A2A);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 38, 53, 0.5);
}

/* Form Prenotazione */
.reservation-form {
  background: linear-gradient(to bottom, white, var(--brand-cream));
  border-radius: 12px;
  padding: 1rem;
  margin-top: 0.5rem;
  border: 2px solid var(--brand-gold);
  box-shadow: 0 4px 16px rgba(61, 40, 23, 0.15);
}

.reservation-form h3 {
  margin: 0 0 1rem 0;
  color: var(--brand-dark);
  font-size: 1.1rem;
}

.reservation-form input,
.reservation-form textarea {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}

.reservation-form input:focus,
.reservation-form textarea:focus {
  outline: none;
  border-color: var(--brand-gold);
}

.submit-reservation-btn {
  background: linear-gradient(135deg, var(--brand-gold), #D4B87A);
  color: var(--brand-dark);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(201, 169, 97, 0.3);
}

.submit-reservation-btn:hover {
  background: linear-gradient(135deg, var(--brand-wine), #A52A2A);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 38, 53, 0.4);
}

.cancel-reservation-btn {
  background: transparent;
  color: var(--brand-dark);
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  cursor: pointer;
  width: 100%;
}
