/* ============================================
   CSS Variables & Design Tokens
   ============================================ */
:root {
  /* Colors */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-text-light: #9ca3af;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-bg-muted: #f1f5f9;
  --color-border: #e2e8f0;
  --color-success: #10b981;
  --color-telegram: #0088cc;
  --color-max: #ff6b35;
  
  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --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;
  --font-size-4xl: 2.5rem;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  
  /* Layout */
  --container-max: 1200px;
  --container-padding: var(--space-6);
  
  /* Borders */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  
  /* Focus */
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.4);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ============================================
   Accessibility
   ============================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-4);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

a:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* ============================================
   Layout
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.section {
  padding-block: var(--space-10);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section--gradient {
  background: var(--gradient-hero);
  color: white;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4 {
  line-height: var(--line-height-tight);
  font-weight: 700;
  color: var(--color-text);
}

.section--gradient h1,
.section--gradient h2 {
  color: white;
}

h1 {
  font-size: clamp(var(--font-size-2xl), 5vw, var(--font-size-4xl));
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(var(--font-size-xl), 4vw, var(--font-size-3xl));
  margin-bottom: var(--space-6);
}

h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-3);
  color: var(--color-primary);
}

p {
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

.text-center {
  text-align: center;
}

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

.text-lg {
  font-size: var(--font-size-lg);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: inherit;
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.btn--primary {
  background-color: var(--color-primary);
  color: white;
}

.btn--primary-outline {
  background-color: white;
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--font-size-lg);
}

.btn--telegram {
  background-color: var(--color-telegram);
  color: white;
}

.btn--max {
  background-color: var(--color-max);
  color: white;
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
  }
  
  .btn--primary:hover {
    background-color: var(--color-primary-hover);
  }
}

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

/* Button groups */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.btn-group--center {
  justify-content: center;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  padding-block: var(--space-10);
  text-align: center;
}

.hero h1 {
  margin-bottom: 0;
}

/* ============================================
   Photos Section
   ============================================ */
.photos__header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.photos__subtitle {
  color: var(--color-text-muted);
  font-size: var(--font-size-lg);
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.tabs__btn {
  padding: var(--space-3) var(--space-6);
  background-color: var(--color-bg-muted);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-base);
}

@media (hover: hover) {
  .tabs__btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
  }
}

.tabs__btn--active,
.tabs__btn.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.gallery__item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--color-bg-muted);
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

@media (hover: hover) {
  .gallery__item:hover img {
    transform: scale(1.05);
  }
}

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

/* ============================================
   Amenities Section
   ============================================ */
.amenities__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}

.amenity-card {
  padding: var(--space-6);
  background-color: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

@media (hover: hover) {
  .amenity-card:hover {
    box-shadow: var(--shadow-md);
  }
}

.amenity-card__title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.amenity-card__desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ============================================
   Prices Section
   ============================================ */
.prices-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}

@media (max-width: 639px) {
  .prices-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.price-card {
  padding: var(--space-3);
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  text-align: center;
}

.price-card__month {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.price-card__value {
  font-weight: 700;
  font-size: var(--font-size-lg);
}

.price-card--summer {
  border: 2px solid var(--color-primary-light);
}

.prices-notes {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-bg-muted);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

.prices-notes p {
  margin-bottom: var(--space-2);
}

.prices-notes p:last-child {
  margin-bottom: 0;
}

/* ============================================
   Rules Section
   ============================================ */
.rules__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.rule-card {
  padding: var(--space-6);
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--color-primary);
}

.rule-card__list {
  list-style: none;
}

.rule-card__list li {
  position: relative;
  padding-left: var(--space-6);
  padding-block: var(--space-2);
}

.rule-card__list li::before {
  content: "✕";
  position: absolute;
  left: 0;
  color: #ef4444;
  font-weight: 700;
}

/* ============================================
   Location Section
   ============================================ */
.location__grid {
  display: grid;
  gap: var(--space-8);
  align-items: start;
}

@media (min-width: 768px) {
  .location__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }
}

.location__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.location-card {
  padding: var(--space-4);
  background-color: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.location-card__label {
  display: block;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.location__image {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
}

/* ============================================
   Reviews Section
   ============================================ */
.reviews__content {
  max-width: 600px;
  margin-inline: auto;
  padding: var(--space-8);
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-xl);
  text-align: center;
}

.reviews__rating {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-6);
}

/* ============================================
   FAQ Section
   ============================================ */
.faq__list {
  max-width: 800px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.faq__item {
  background-color: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq__item summary {
  padding: var(--space-5);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  transition: background-color var(--transition-fast);
}

.faq__item summary::-webkit-details-marker {
  display: none;
}

.faq__item summary::after {
  content: "+";
  font-size: var(--font-size-xl);
  font-weight: 300;
  color: var(--color-primary);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.faq__item[open] summary::after {
  transform: rotate(45deg);
}

@media (hover: hover) {
  .faq__item summary:hover {
    background-color: var(--color-bg-alt);
  }
}

.faq__answer {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--color-text-muted);
  line-height: var(--line-height-relaxed);
}

/* ============================================
   Contacts Section
   ============================================ */
.contacts {
  text-align: center;
}

.contacts__cta {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-8);
  opacity: 0.95;
}

.contacts__email {
  margin-top: var(--space-6);
  opacity: 0.9;
}

.contacts__email a {
  color: white;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background-color: var(--color-text);
  color: white;
  padding-block: var(--space-12) var(--space-6);
}

.footer__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer__section h3 {
  color: white;
  font-size: var(--font-size-base);
  margin-bottom: var(--space-4);
}

.footer__section p,
.footer__section a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  line-height: var(--line-height-relaxed);
}

@media (hover: hover) {
  .footer__section a:hover {
    color: white;
  }
}

.footer__bottom {
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--font-size-sm);
}

/* ============================================
   Mobile Bottom Bar
   ============================================ */
.mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-3);
  background-color: var(--color-bg);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  /* Safe area for iPhone notch */
  padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
}

.mobile-bar__buttons {
  display: flex;
  gap: var(--space-2);
}

.mobile-bar .btn {
  flex: 1;
  padding: var(--space-3);
  font-size: var(--font-size-sm);
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

/* Small phones */
@media (max-width: 374px) {
  :root {
    --container-padding: var(--space-4);
  }
  
  .hero {
    padding-block: var(--space-8);
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group .btn {
    width: 100%;
  }
}

/* Phones */
@media (max-width: 639px) {
  .section {
    padding-block: var(--space-6);
  }
  
  .mobile-bar {
    display: block;
  }
  
  body {
    padding-bottom: 70px;
  }
  
  .hero {
    padding-block: var(--space-6);
  }
  
  .gallery {
    grid-template-columns: 1fr;
  }
  
  .tabs {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: var(--space-2);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .tabs::-webkit-scrollbar {
    display: none;
  }
  
  .tabs__btn {
    flex-shrink: 0;
  }
  
  .rules__grid {
    grid-template-columns: 1fr;
  }
}

/* Tablets */
@media (min-width: 640px) and (max-width: 1023px) {
  .mobile-bar {
    display: block;
  }
  
  body {
    padding-bottom: 70px;
  }
  
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large tablets & small desktops */
@media (min-width: 1024px) {
  .mobile-bar {
    display: none;
  }
}

/* Touch device hover fix */
@media (hover: none) {
  .btn:hover,
  .amenity-card:hover,
  .gallery__item:hover img {
    transform: none;
    box-shadow: inherit;
  }
}

/* Print styles */
@media print {
  .mobile-bar,
  .btn-group {
    display: none;
  }
  
  .section {
    padding-block: var(--space-6);
    page-break-inside: avoid;
  }
  
  body {
    padding-bottom: 0;
  }
}
