/* ==========================================================================
   KRS PUBLIC HOTEL STYLES — Estilo Despegar (Search-First & Rich Room Cards)
   Soft UI + Touch UI Standard (AGENTS.md)
   ========================================================================== */

/* Search Bar Wrapper */
.krs-hotel-search-bar-wrap {
    width: 100%;
    margin-bottom: 24px;
}

.krs-hotel-search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: #f8fafc;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--kuad-krs-border);
    align-items: flex-end;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
    box-sizing: border-box;
}

.krs-hotel-search-field {
    flex: 1 1 180px;
    min-width: 140px;
}

.krs-hotel-search-field label {
    font-size: 13px;
    font-weight: 700;
    color: #2D1A68;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.krs-hotel-search-field label .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #1BA59D;
}

.krs-hotel-search-field input[type="text"] {
    width: 100%;
    height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 15px;
    background: #ffffff;
    color: var(--kuad-krs-text);
    box-sizing: border-box;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.02);
    transition: border-color 0.2s ease;
}

.krs-hotel-search-field input[type="text"]:focus {
    border-color: #2D1A68;
    outline: none;
}

/* Guests Stepper */
.krs-hotel-guests-stepper {
    display: flex;
    align-items: center;
    height: 48px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    overflow: hidden;
    box-sizing: border-box;
}

.krs-hotel-guests-stepper button {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background: #f1f5f9;
    border: none;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    color: #2D1A68;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
    user-select: none;
}

.krs-hotel-guests-stepper button:hover {
    background: #2D1A68;
    color: #ffffff;
}

.krs-guests-count {
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--kuad-krs-text);
    padding: 0 6px;
    white-space: nowrap;
}

.krs-hotel-search-action {
    flex: 1 1 200px;
}

.krs-btn-search-hotel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
}

/* Results Section & Room Cards Grid */
.krs-hotel-rooms-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.krs-hotel-room-card {
    display: flex;
    flex-direction: row;
    background: #ffffff;
    border: 1px solid var(--kuad-krs-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.krs-hotel-room-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -4px rgba(45, 26, 104, 0.1);
    border-color: rgba(27, 165, 157, 0.4);
}

/* Media (Left Column) */
.krs-hotel-room-media {
    width: 260px;
    min-width: 260px;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.krs-hotel-room-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.krs-hotel-room-card:hover .krs-hotel-room-img {
    transform: scale(1.04);
}

.krs-hotel-room-placeholder {
    color: #94a3b8;
    font-size: 48px;
}

.krs-btn-open-gallery {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.78);
    color: #ffffff;
    border: none;
    border-radius: 24px;
    min-height: 48px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: none;
    transition: background 0.15s ease;
    box-sizing: border-box;
}

.krs-btn-open-gallery:hover {
    background: #2D1A68;
}

/* Info (Center Column) */
.krs-hotel-room-info {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
}

.krs-hotel-room-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #2D1A68;
    line-height: 1.3;
}

.krs-hotel-room-features {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #64748b;
}

.krs-feature-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.krs-feature-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #1BA59D;
}

.krs-hotel-amenities-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.krs-hotel-amenity-tag {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.krs-hotel-card-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.krs-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.krs-badge-alert {
    background: #fee2e2;
    color: #991b1b;
}

/* Pricing & Action (Right Column) */
.krs-hotel-room-pricing {
    width: 220px;
    min-width: 220px;
    padding: 20px;
    background: #fafafa;
    border-left: 1px solid var(--kuad-krs-border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    text-align: right;
    gap: 8px;
    box-sizing: border-box;
}

.krs-hotel-price-label {
    font-size: 12px;
    color: #64748b;
    display: block;
}

.krs-hotel-nightly-price {
    font-size: 22px;
    font-weight: 800;
    color: #2D1A68;
    display: block;
}

.krs-hotel-stay-total {
    font-size: 14px;
    color: #166534;
    font-weight: 600;
    display: block;
}

.krs-hotel-nights-count {
    font-size: 12px;
    color: #64748b;
    display: block;
}

.krs-hotel-deposit-note {
    font-size: 11px;
    color: #C05A86;
    font-weight: 600;
    background: rgba(192, 90, 134, 0.08);
    padding: 3px 6px;
    border-radius: 4px;
}

.krs-btn-choose-room {
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    min-height: 48px !important;
    min-width: 140px;
    padding: 0 16px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
}

/* Hotel & Stock Badges */
.krs-hotel-establishment-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #1BA59D;
    margin-bottom: 6px;
}

.krs-badge-stock-alert {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #b91c1c;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    padding: 4px 10px;
    border-radius: 8px;
    margin-bottom: 8px;
}

/* Sold-out Room Muted Styling (Booking/Despegar Style) */
.krs-hotel-room-card.krs-room-sold-out {
    opacity: 0.72;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    box-shadow: none;
}

.krs-hotel-room-card.krs-room-sold-out:hover {
    transform: none;
    box-shadow: none;
}

.krs-hotel-card-badge.krs-badge-soldout {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    padding: 4px 10px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.krs-btn-choose-room.krs-btn-disabled,
.krs-btn-book-room.krs-btn-disabled {
    background: #94a3b8 !important;
    color: #ffffff !important;
    cursor: not-allowed !important;
    border: none !important;
    border-radius: 12px !important;
    opacity: 0.8 !important;
    pointer-events: none !important;
    min-height: 44px !important;
    font-weight: 700 !important;
}

.krs-hotel-selected-summary-card {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid var(--kuad-krs-border);
    border-radius: 16px;
    margin-bottom: 20px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .krs-hotel-search-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .krs-hotel-search-field,
    .krs-hotel-search-action {
        width: 100%;
    }

    .krs-hotel-room-card {
        flex-direction: column;
    }

    .krs-hotel-room-media {
        width: 100%;
        min-width: 100%;
        height: 200px;
    }

    .krs-hotel-room-pricing {
        width: 100%;
        min-width: 100%;
        border-left: none;
        border-top: 1px solid var(--kuad-krs-border);
        align-items: center;
        text-align: center;
    }
}

/* Guests Breakdown Popover (Touch UI & Soft UI) */
.krs-hotel-guests-trigger, .krs-guests-trigger { cursor: pointer; user-select: none; position: relative; }
.krs-guests-popover {
    position: absolute; z-index: 1050; top: calc(100% + 8px); left: 0; min-width: 290px;
    background: #ffffff; border-radius: 16px; border: 1px solid #e2e8f0;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    padding: 16px; box-sizing: border-box; text-align: left;
}
.krs-guests-popover-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.krs-guests-popover-row:last-of-type { border-bottom: none; }
.krs-guests-popover-label strong { display: block; font-size: 14px; font-weight: 700; color: #2D1A68; }
.krs-guests-popover-label span { font-size: 12px; color: #64748b; }
.krs-guests-popover-stepper { display: flex; align-items: center; gap: 8px; }
.krs-btn-guests-step {
    width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 10px;
    border: 1px solid #cbd5e1; background: #f8fafc; font-size: 18px; font-weight: 700;
    color: #2D1A68; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.15s ease; padding: 0;
}
.krs-btn-guests-step:hover:not(:disabled) { background: #2D1A68; color: #ffffff; border-color: #2D1A68; }
.krs-btn-guests-step:disabled { opacity: 0.4; cursor: not-allowed; }
.krs-guests-val { font-size: 15px; font-weight: 700; color: #1e293b; min-width: 24px; text-align: center; }
.krs-guests-popover-footer { margin-top: 12px; padding-top: 10px; border-top: 1px solid #f1f5f9; text-align: right; }
.krs-btn-guests-done { min-height: 44px; padding: 0 16px; font-size: 13px; font-weight: 700; border-radius: 10px; }

/* Min-Stay Badge & Assisted Action */
.krs-badge-min-stay {
    display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
    color: #b45309; background: #fef3c7; border: 1px solid #fde68a; padding: 4px 10px;
    border-radius: 8px; margin-bottom: 8px;
}
.krs-btn-adjust-stay { min-height: 44px; padding: 8px 16px; font-size: 13px; font-weight: 700; border-radius: 12px; cursor: pointer; }

/* Multi-Room Selector */
.krs-room-qty-box { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.krs-room-qty-box label { font-size: 12px; font-weight: 700; color: #475569; }
.krs-room-qty-select {
    height: 38px; min-width: 130px; padding: 4px 8px; border: 1px solid #cbd5e1;
    border-radius: 8px; font-size: 13px; font-weight: 600; color: #2D1A68; background: #ffffff;
}

/* Crib Auto-suggestion Badge */
.krs-crib-suggested-pill {
    display: inline-block; font-size: 11px; font-weight: 700; color: #0f766e;
    background: #ccfbf1; border: 1px solid #99f6e4; padding: 2px 8px; border-radius: 6px; margin-left: 6px;
}

/* Future Season Action Button */
.krs-btn-future-season {
    width: 100%;
    min-height: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 12px;
    background: #1BA59D;
    color: #ffffff;
    border: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.krs-btn-future-season:hover {
    background: #158079;
}

/* Pricing, Strikethrough & Volume Discount Badges */
.krs-price-strikethrough-line { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-bottom: 2px; flex-wrap: wrap; }
.krs-price-strikethrough { font-size: 13px; color: #94a3b8; text-decoration: line-through; font-weight: 600; }
.krs-badge-discount-tag { background: #1BA59D; color: #ffffff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.krs-badge-discount-tag.krs-badge-room-disc { background: #C05A86; color: #ffffff; }
.krs-single-use-line { margin-bottom: 4px; }
.krs-badge-single-use { background: #f1f5f9; color: #403A60; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; border: 1px solid #cbd5e1; }
.krs-hotel-volume-discount-badge { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 8px; margin: 4px 0; display: inline-flex; align-items: center; gap: 4px; }
.krs-hotel-volume-discount-badge[hidden],
.krs-hotel-volume-discount-badge:empty { display: none !important; }
.krs-hotel-final-discount-badge { background: #e6fffa; border: 1px solid #99f6e4; color: #0f766e; font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 8px; margin: 4px 0; display: inline-flex; align-items: center; gap: 4px; }
.krs-hotel-total-strikethrough { font-size: 13px; color: #94a3b8; text-decoration: line-through; font-weight: 600; margin-right: 6px; }
.krs-hotel-card-badge.krs-badge-discount { background: #1BA59D; color: #ffffff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }
.krs-hotel-summary-discount { color: #1BA59D; font-weight: 700; }
.krs-room-badge-wrap { margin-bottom: 4px; }
.krs-hotel-crib-wrap { margin-top: 16px; }
.krs-hotel-crib-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.krs-hotel-crib-label { font-weight: normal; display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; min-height: 48px; }
.krs-hotel-crib-checkbox { width: 20px; height: 20px; }
