/* ============================================
   БЛОК 04: DETAILS - Детали отеля
   Версия: 7.2 - SVG Icons + Shimmer Gallery
   
   CHANGELOG v7.2:
   - Added shimmer animation for loading photos
   - SVG icon support for info-row
   - Gallery placeholder styling
   - Improved consistency with comparison block
   
   DEPENDS ON:
   - shared/variables.css  (tokens)
   - shared/base.css       (.screen, .glass-card)
   ============================================ */

/* --- Экран деталей --- */
#hotelDetailsScreen {
    display: none;
}

#hotelDetailsScreen.active {
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER — Transparent (floating over aurora)
   Same pattern as comparison .screen-header
   ============================================ */

.details-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-height: 52px;
    padding: var(--spacing-sm) 0;
    
    background: transparent;
    border-bottom: none;
    flex-shrink: 0;
}

.details-header .back-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast) var(--ease-out);
    flex-shrink: 0;
}

.details-header .back-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.12);
}

.details-header .back-btn svg {
    width: 20px;
    height: 20px;
}

.details-title {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.details-title h2 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.hotel-stars {
    color: #ffc107;
    font-size: var(--font-size-sm);
    margin-top: 2px;
}

/* SVG stars */
.stars-icons {
    display: inline-flex;
    gap: 2px;
    color: #fbbf24;
}

.stars-icons svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   CONTENT — scrollable area
   ============================================ */

.details-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: calc(var(--button-height) + var(--content-bottom) + var(--spacing-lg));
}

/* ============================================
   ГАЛЕРЕЯ ФОТО — rounded, aurora-aware
   ============================================ */

.photo-gallery {
    position: relative;
    width: 100%;
    height: clamp(160px, 30vh, 220px);
    background: linear-gradient(135deg, rgba(25, 35, 50, 0.8), rgba(10, 14, 20, 0.9));
    overflow: hidden;
    flex-shrink: 0;
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-md);
    touch-action: pan-y;
}

.gallery-container {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease;
}

.gallery-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(135deg, #1a1f35 0%, #0d1117 50%, #1a1f35 100%);
    background-size: 200% 200%;
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-slide img.loaded,
.gallery-slide img[src]:not([src=""]) {
    opacity: 1;
}

/* Gallery placeholder */
.gallery-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 12px;
}

.gallery-placeholder svg {
    width: 40px;
    height: 40px;
    opacity: 0.4;
}

/* --- Навигация галереи --- */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 5;
    opacity: 0.85;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.7);
    opacity: 1;
}

.gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.gallery-prev {
    left: var(--spacing-md);
}

.gallery-next {
    right: var(--spacing-md);
}

/* --- Точки галереи --- */
.gallery-dots {
    position: absolute;
    bottom: var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    max-width: 80%;
    overflow-x: auto;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 14px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gallery-dots::-webkit-scrollbar {
    display: none;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transition: all 0.25s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.gallery-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

.gallery-dot.active {
    background: var(--color-success);
    width: 20px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

/* --- Кнопка fullscreen --- */
.gallery-fullscreen {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all var(--transition-fast) var(--ease-out);
}

.gallery-fullscreen:active {
    transform: scale(0.92);
}

/* ============================================
   ИНФОРМАЦИЯ О БРОНИРОВАНИИ — Glass card
   ============================================ */

#hotelDetailsScreen .booking-info {
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-md);
}

.info-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.info-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
}

.info-icon svg {
    width: 16px;
    height: 16px;
}

.info-text {
    color: var(--text-primary);
}

/* ============================================
   ВАРИАНТЫ КОМНАТ
   ============================================ */

.room-variants-section {
    padding: 0;
}

.room-variants-section h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.room-variants {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.no-rooms {
    text-align: center;
    padding: 40px var(--spacing-xl);
    color: var(--text-secondary);
}

/* --- Карточка комнаты — Glass + visible border --- */
.room-variant {
    padding: var(--spacing-lg);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast) var(--ease-out);
}

.room-variant:active {
    transform: scale(0.985);
}

.room-variant:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--glass-bg-hover);
}

.room-variant.selected {
    border-color: var(--accent-primary);
    background: rgba(102, 126, 234, 0.08);
    box-shadow: 0 0 0 1px var(--accent-primary), 0 0 20px rgba(102, 126, 234, 0.1);
}

.room-variant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.room-variant-type {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    flex: 1;
    margin-right: var(--spacing-md);
}

.room-variant-price-wrapper {
    text-align: right;
}

.room-variant-price-old {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-decoration: line-through;
}

.room-variant-price {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-success);
}

.room-variant-board {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-variant-board svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}

.room-variant-price-night {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

/* --- Политика отмены --- */
.room-variant-refund {
    font-size: var(--font-size-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
}

.room-variant-refund svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.room-variant-refund.refundable {
    background: rgba(52, 211, 153, 0.15);
    color: var(--color-success);
}

.room-variant-refund.non-refundable {
    background: rgba(248, 113, 113, 0.15);
    color: var(--color-danger);
}

/* --- Дополнительная информация --- */
.room-variant-extra {
    font-size: var(--font-size-xs);
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-variant-extra svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.room-variant-promo {
    color: var(--color-success);
}

.room-variant-discount {
    color: var(--color-danger);
    font-weight: var(--font-weight-semibold);
}

.room-variant-warning {
    color: var(--color-warning);
}

.room-variant-remark {
    color: var(--text-secondary);
    font-style: italic;
}

/* --- Система --- */
.room-variant-system {
    margin-top: var(--spacing-sm);
}

.system-badge-small {
    padding: 3px var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

/* ============================================
   FOOTER БРОНИРОВАНИЯ — Accent Gradient + Glow
   ============================================ */

.booking-footer {
    position: fixed;
    bottom: calc(var(--content-bottom) + var(--spacing-md));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-overlay);
    
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 12px 32px 10px;
    
    /* Aurora accent gradient */
    background: var(--accent-gradient);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    cursor: pointer;
    
    max-width: calc(var(--app-max-width) - var(--screen-padding-x) * 2);
    
    /* Glow shadow */
    box-shadow: 
        0 4px 20px rgba(102, 126, 234, 0.35),
        0 8px 40px rgba(118, 75, 162, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.booking-footer:active {
    transform: translateX(-50%) scale(0.97);
    box-shadow: 
        0 2px 12px rgba(102, 126, 234, 0.4),
        0 4px 20px rgba(118, 75, 162, 0.25);
}

/* Shine overlay */
.booking-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
    border-radius: inherit;
    pointer-events: none;
}

/* Кнопка — текст на gradient bg */
#hotelDetailsScreen .btn-book {
    order: 1;
    padding: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    min-height: auto;
    width: auto;
    position: relative;
    z-index: 1;
}

#hotelDetailsScreen .btn-book:disabled {
    opacity: 0.7;
}

/* Цена под текстом */
.total-price {
    order: 2;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    position: relative;
    z-index: 1;
}

.price-label {
    display: none;
}

.total-price .price-value {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: rgba(255, 255, 255, 0.85);
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

@media (min-width: 768px) {
    .photo-gallery {
        height: 300px;
    }
    
    .room-variants {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
}

@media (max-width: 380px) {
    .photo-gallery {
        height: 180px;
    }
    
    .booking-footer {
        padding: 10px 24px 8px;
    }
}

/* ============================================
   FULLSCREEN ГАЛЕРЕЯ
   ============================================ */

.fullscreen-gallery {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.98);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.fullscreen-gallery.active {
    display: flex;
}

.fullscreen-close {
    position: absolute;
    top: max(var(--spacing-lg), env(safe-area-inset-top, 0px));
    right: var(--screen-padding-x);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all var(--transition-fast);
}

.fullscreen-close:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.92);
}

.fullscreen-container {
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.fullscreen-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fullscreen-slide img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all var(--transition-fast);
}

.fullscreen-nav:active {
    background: rgba(255, 255, 255, 0.25);
}

.fullscreen-prev {
    left: var(--screen-padding-x);
}

.fullscreen-next {
    right: var(--screen-padding-x);
}

.fullscreen-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    z-index: 10001;
}

/* ============================================
   TOUCH FEEDBACK
   ============================================ */

@media (hover: none) {
    .gallery-nav {
        opacity: 0.7;
    }

    .gallery-nav:active {
        opacity: 1;
    }
}

/* ============================================
   Step 5.3-5.5: RateHawk hotel info section
   ============================================ */
.rh-hotel-info {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rh-hi-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 14px;
}
.rh-hi-title {
    font-size: 14px;
    font-weight: 700;
    color: #f0f0f0;
    margin: 0 0 10px;
}
.rh-hi-subtitle {
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin: 8px 0 4px;
}
.rh-hi-para {
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 6px;
}
.rh-hi-about.rh-hi-collapsed {
    max-height: 7.5em;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
    mask-image: linear-gradient(180deg, #000 60%, transparent);
}
.rh-hi-toggle {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: #5eb8d6;
    text-decoration: underline;
    cursor: pointer;
}
.rh-room-collapsed { display: none; }
.rh-rooms-toggle {
    display: block;
    text-align: center;
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    font-size: 13px;
    color: #5eb8d6;
    text-decoration: underline;
    cursor: pointer;
}
.rh-hi-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}
.rh-hi-chip {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 10px;
    border-radius: 999px;
}
.rh-hi-chip-paid {
    font-style: italic;
    color: rgba(255, 255, 255, 0.6);
}
.rh-hi-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 10px;
}
.rh-hi-inline-item {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}
.rh-hi-phone {
    color: #5eb8d6;
}
.rh-hi-policies {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rh-hi-policy-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12.5px;
}
.rh-hi-policy-icon {
    flex-shrink: 0;
}
.rh-hi-policy-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}
.rh-hi-policy-value {
    color: rgba(255, 255, 255, 0.7);
}
.rh-am-collapsed { display: none; }
.rh-am-toggle {
    display: block;
    text-align: center;
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    font-size: 13px;
    color: #5eb8d6;
    text-decoration: underline;
    cursor: pointer;
}
