/* ============================================================
   Cykeluthyrning Booking Form — style.css
   Responsive layout: sticky sidebar (desktop), fixed bottom bar (mobile)
   ============================================================ */

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  --color-accent:       #2B7A4B;
  --color-accent-dark:  #1e5c38;
  --color-accent-light: #e8f4ed;
  --color-bg:           #faf8f5;
  --color-bg-card:      #ffffff;
  --color-text:         #1a1a1a;
  --color-text-muted:   #6b7280;
  --color-border:       #e5e7eb;
  --color-shadow:       rgba(0, 0, 0, 0.04);

  --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 2.5rem;

  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

/* Hidden attribute must win over display rules */
[hidden] { display: none !important; }

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-stack);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

/* ── Header with green gradient ────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, #2B7A4B 0%, #1e5c38 50%, #174a2e 100%);
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.site-logo {
  max-width: 72px;
  height: auto;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.header-text h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.header-text .intro {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: var(--space-xs);
}

/* ── Language Switcher ──────────────────────────────────────── */
.lang-switcher {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-xl);
  background: var(--color-bg);
}

.lang-btn {
  background: none;
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
}

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

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

/* ── Page Structure ────────────────────────────────────────── */
.page-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
}

/* ── Booking Layout: Desktop Grid ───────────────────────────── */
@media (min-width: 768px) {
  .booking-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--space-xl);
    align-items: start;
  }

  .price-summary {
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }
}

/* ── Booking Layout: Mobile Block ───────────────────────────── */
@media (max-width: 767px) {
  .booking-layout {
    display: block;
  }

  .booking-form {
    padding-bottom: 90px;
  }

  .price-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-bg-card);
    border-top: none;
    padding: var(--space-sm) var(--space-md);
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }
}

/* ── Form Sections (Cards) ──────────────────────────────────── */
.form-section {
  background: var(--color-bg-card);
  border: none;
  border-radius: var(--radius);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: 0 1px 3px var(--color-shadow), 0 4px 12px rgba(0, 0, 0, 0.03);
}

.form-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: none;
  position: relative;
}

.form-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2.5rem;
  height: 3px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* ── Date Section ───────────────────────────────────────────── */
.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 480px) {
  .date-grid {
    grid-template-columns: 1fr;
  }
}

.date-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.date-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.date-field input[type="date"],
.date-field input[type="text"] {
  width: 100%;
  padding: 0.75rem var(--space-md);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-stack);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.date-field input[type="date"]:focus,
.date-field input[type="text"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(43, 122, 75, 0.12);
}

.time-grid {
  margin-top: var(--space-md);
}

.rental-days-display {
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.rental-days-display .days-count {
  font-weight: 700;
  color: var(--color-accent);
}

/* ── Bike Rows ──────────────────────────────────────────────── */
.bike-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.bike-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  gap: var(--space-md);
}

.bike-info {
  flex: 1;
  min-width: 0;
}

.bike-name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
}

.bike-price {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ── Bike Groups with Size Rows ────────────────────────────── */
.bike-group {
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.bike-group:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.bike-row-header {
  border: none;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-bg);
}

.bike-sizes {
  display: flex;
  gap: 0;
}

.size-row {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-sm) var(--space-xs);
  gap: var(--space-xs);
  border-right: 1px solid var(--color-border);
}

.size-row:last-child {
  border-right: none;
}

.size-label {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ── Quantity Control (+/-) ─────────────────────────────────── */
.qty-control {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.qty-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-accent);
  border-radius: 50%;
  background: transparent;
  color: var(--color-accent);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
  padding: 0;
}

.qty-btn:hover {
  background: var(--color-accent);
  color: #fff;
  transform: scale(1.05);
}

.qty-btn:active {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: #fff;
  transform: scale(0.95);
}

.qty-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.qty-value {
  min-width: 2rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
}

@media (max-width: 767px) {
  .bike-sizes {
    flex-direction: column;
  }

  .size-row {
    flex-direction: row;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .size-row:last-child {
    border-bottom: none;
  }
}

/* ── Transport Dropdowns ────────────────────────────────────── */
.transport-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 480px) {
  .transport-grid {
    grid-template-columns: 1fr;
  }
}

.transport-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.transport-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.transport-field select {
  width: 100%;
  padding: 0.75rem var(--space-md);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-stack);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-bg-card);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.transport-field select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(43, 122, 75, 0.12);
}

/* ── Luggage Section ────────────────────────────────────────── */
.luggage-toggle-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  margin-bottom: var(--space-md);
}

.luggage-toggle-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--color-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.luggage-toggle-row .toggle-label {
  font-weight: 500;
  font-size: 0.95rem;
}

.luggage-details {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.luggage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.luggage-row .bags-label {
  font-weight: 500;
}

.luggage-info-text {
  font-size: 0.825rem;
  color: var(--color-text-muted);
  background: var(--color-accent-light);
  border-left: 3px solid var(--color-accent);
  padding: var(--space-sm) var(--space-md);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: var(--space-sm);
  line-height: 1.5;
}

/* ── Luggage Schedule (per-date) ───────────────────────────── */
.luggage-schedule {
  margin-top: var(--space-md);
}

.luggage-schedule-heading {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.luggage-date-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--color-border);
}

.luggage-date-row:last-child {
  border-bottom: none;
}

.luggage-date-label {
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 3rem;
  color: var(--color-text);
}

.luggage-date-fields {
  flex: 1;
  display: flex;
  gap: var(--space-sm);
}

.luggage-input {
  flex: 1;
  padding: 0.5rem var(--space-sm);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-stack);
  font-size: 0.85rem;
  color: var(--color-text);
  background: var(--color-bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.luggage-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(43, 122, 75, 0.12);
}

@media (max-width: 480px) {
  .luggage-date-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
    padding: var(--space-sm) 0;
  }

  .luggage-date-fields {
    width: 100%;
    flex-direction: column;
  }
}

/* ── Accommodation ─────────────────────────────────────────── */
.accommodation-details {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.accommodation-options {
  margin-top: var(--space-sm);
}

.stars-select {
  padding: 0.5rem var(--space-md);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-stack);
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-bg-card);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.stars-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(43, 122, 75, 0.12);
}

/* ── Extras / Accessories ───────────────────────────────────── */
.extras-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  gap: var(--space-md);
  transition: box-shadow 0.2s;
}

.extra-row:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.extra-info {
  flex: 1;
  min-width: 0;
}

.extra-name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
}

.extra-price {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ── Contact Fields ────────────────────────────────────────── */
.contact-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.contact-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-field input[type="text"],
.contact-field input[type="email"],
.contact-field input[type="tel"] {
  width: 100%;
  padding: 0.75rem var(--space-md);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-stack);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-field input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(43, 122, 75, 0.12);
}

.contact-error {
  color: #c0392b;
  font-size: 0.875rem;
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: #fdf0ef;
  border-left: 3px solid #c0392b;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Field Validation Error ────────────────────────────────── */
.field-error {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15) !important;
}

/* ── Terms Checkbox ───────────────────────────────────────── */
.terms-section {
  padding: var(--space-md) var(--space-xl);
}

.terms-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.terms-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--color-accent);
  cursor: pointer;
  flex-shrink: 0;
}

.terms-row span {
  font-weight: 500;
  font-size: 0.95rem;
}

.terms-link {
  color: var(--color-accent);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

/* ── Terms Modal ─────────────────────────────────────────── */
.terms-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-md);
}

.terms-modal[hidden] {
  display: none;
}

.terms-modal-content {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: var(--space-xl);
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.terms-modal-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.terms-modal-close:hover {
  background: var(--color-bg);
}

.terms-modal-content h2 {
  margin: 0 0 var(--space-md);
}

.terms-body p {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

/* ── Customer Comment ──────────────────────────────────────── */
.customer-comment-input {
  width: 100%;
  padding: 0.75rem var(--space-md);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-stack);
  font-size: 0.95rem;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.customer-comment-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(43, 122, 75, 0.12);
}

/* ── Book Action Button ────────────────────────────────────── */
.book-action {
  text-align: center;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
}

.book-btn {
  display: inline-block;
  width: 100%;
  max-width: 320px;
  padding: 1rem var(--space-xl);
  background: linear-gradient(135deg, #2B7A4B 0%, #1e5c38 100%);
  color: #ffffff;
  font-family: var(--font-stack);
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(43, 122, 75, 0.3);
}

.book-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(43, 122, 75, 0.4);
}

.book-btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(43, 122, 75, 0.3);
}

.book-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.book-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Confirmation Section ──────────────────────────────────── */
.confirmation-section {
  max-width: 600px;
  margin: var(--space-xl) auto;
  text-align: center;
  padding: var(--space-2xl);
  background: var(--color-bg-card);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.confirmation-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.confirmation-section p {
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.confirmation-section strong {
  font-size: 1.25rem;
  color: var(--color-text);
}

.confirm-total {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

/* ── Price Summary Panel ────────────────────────────────────── */
.price-summary {
  background: linear-gradient(160deg, #1e5c38 0%, #174a2e 100%);
  border: none;
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: 0 4px 16px rgba(30, 92, 56, 0.2);
  color: #ffffff;
}

@media (max-width: 767px) {
  .price-summary {
    border-radius: 0;
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(160deg, #1e5c38 0%, #174a2e 100%);
  }
}

.price-summary h2 {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.price-summary h2::after {
  display: none;
}

@media (max-width: 767px) {
  .price-summary h2 {
    display: none;
  }
}

.summary-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

@media (max-width: 767px) {
  .summary-rows {
    display: none;
  }
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.summary-row .label { }
.summary-row .amount {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.summary-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: var(--space-sm) 0;
}

.summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.1rem;
  font-weight: 700;
}

.summary-total-row .label {
  color: rgba(255, 255, 255, 0.9);
}

.summary-total-row .amount {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 800;
}

.summary-days-display {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: var(--space-xs);
  text-align: right;
}

@media (max-width: 767px) {
  .summary-days-display { display: none; }
}

.summary-no-dates {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: var(--space-md) 0;
}

/* ── Mobile summary compact ─────────────────────────────────── */
@media (max-width: 767px) {
  .summary-total-row {
    font-size: 1rem;
  }
  .summary-total-row .amount {
    font-size: 1.2rem;
  }
}
