/* ========================================
   XHomestay Frontend Styles
   Integrates with Flatsome theme
   ======================================== */

/* === Room Grid Layout === */
.xhs-rooms-grid.row {
    margin-left: -12px !important;
    margin-right: -12px !important;
}

.xhs-rooms-grid .col {
    padding: 12px !important;
}

/* === Room Card Styles === */
.xhs-room-card {
    border-radius: 16px !important;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f1f5f9 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06) !important;
}

.xhs-room-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12) !important;
    border-color: #e2e8f0 !important;
}

.xhs-room-card .box-image {
    border-radius: 16px 16px 0 0 !important;
    overflow: hidden !important;
}

.xhs-room-card .box-image img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.xhs-room-card:hover .box-image img {
    transform: scale(1.06);
}

.xhs-room-card .box-text {
    padding: 20px !important;
}

.xhs-room-card .box-text-inner {
    padding: 0 !important;
}

.xhs-room-card .post-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    margin-bottom: 8px !important;
}

.xhs-room-card .post-title a {
    color: #1e293b !important;
    text-decoration: none !important;
}

.xhs-room-card .post-title a:hover {
    color: #c94a33 !important;
}

.xhs-room-card .from_the_blog_excerpt {
    font-size: 13px !important;
    color: #64748b !important;
    line-height: 1.6 !important;
    margin-bottom: 12px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.xhs-room-card .is-divider {
    margin: 10px 0 !important;
    border-color: #f1f5f9 !important;
}

/* Room Specs */
.xhs-room-specs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #64748b;
}

.xhs-room-specs span {
    white-space: nowrap;
}

.xhs-room-specs .emoji {
    width: 14px !important;
    height: 14px !important;
    vertical-align: -2px !important;
    margin-right: 2px !important;
}

.xhs-spec-divider {
    color: #cbd5e1;
    margin: 0 2px;
}

/* Amenity Tags */
.xhs-amenities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 10px 0;
}

.xhs-amenity-tag {
    display: inline-block;
    padding: 4px 10px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 500;
    border-radius: 8px;
    line-height: 1.5;
}

.xhs-amenity-more {
    background: linear-gradient(135deg, #c94a33, #aa3d2a);
    color: #fff;
}

/* Price Block */
.xhs-price-block {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 12px 0 14px;
}

.xhs-price-original {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: line-through;
}

.xhs-price-current {
    font-size: 22px;
    font-weight: 800;
    color: #c94a33;
}

.xhs-price-unit {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
}

/* Badges */
.xhs-room-card .box-image {
    position: relative !important;
}

.xhs-badge-availability {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    right: auto !important;
    z-index: 2 !important;
}

.xhs-badge-promo {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    z-index: 2 !important;
}

.xhs-badge-availability .badge-inner,
.xhs-badge-promo .badge-inner {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    color: #fff;
}

.xhs-badge-availability .xhs-available {
    background: rgba(16, 185, 129, 0.92);
    backdrop-filter: blur(4px);
}

.xhs-badge-availability .xhs-unavailable {
    background: rgba(239, 68, 68, 0.92);
    backdrop-filter: blur(4px);
}

.xhs-badge-promo .badge-inner.xhs-promo {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: xhs-pulse 2s infinite;
}

@keyframes xhs-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* Book Button */
.xhs-book-btn {
    width: 100%;
    text-align: center;
    border-radius: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    font-size: 14px !important;
    padding: 12px 20px !important;
    background: linear-gradient(135deg, #c94a33, #aa3d2a) !important;
    color: #fff !important;
    border: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 14px rgba(201, 74, 51, 0.3) !important;
    text-transform: none !important;
}

.xhs-book-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 74, 51, 0.4) !important;
    background: linear-gradient(135deg, #aa3d2a, #8b3020) !important;
    color: #fff !important;
}

.xhs-booking-form input:focus,
.xhs-booking-form select:focus,
.xhs-booking-form textarea:focus {
    border-color: var(--primary-color, #c94a33);
    box-shadow: 0 0 0 3px rgba(201, 74, 51, 0.12);
}

.xhs-booking-form .xhs-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 549px) {
    .xhs-booking-form .xhs-form-row {
        grid-template-columns: 1fr;
    }
}

/* Price Summary */
.xhs-price-summary {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    margin: 24px 0;
}

.xhs-price-summary h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.xhs-price-summary h4::before {
    content: '💰';
}

.xhs-price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    color: #475569;
}

.xhs-price-line.xhs-discount {
    color: #10b981;
}

.xhs-price-line.xhs-total {
    border-top: 2px solid #e2e8f0;
    margin-top: 10px;
    padding-top: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.xhs-price-line .xhs-amount {
    font-weight: 600;
}

/* Promotion Banner in form */
.xhs-promo-banner {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #92400e;
    font-weight: 500;
}

.xhs-promo-banner::before {
    content: '🎉';
    font-size: 20px;
}

/* Submit Button */
.xhs-submit-btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    background: var(--primary-color, #c94a33);
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.xhs-submit-btn:hover {
    background: var(--primary-color-hover, #aa3d2a);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(201, 74, 51, 0.3);
}

.xhs-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Confirmation */
.xhs-confirmation {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.xhs-confirmation-icon {
    width: 80px;
    height: 80px;
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
}

.xhs-confirmation-code {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color, #c94a33);
    letter-spacing: 2px;
    margin: 10px 0;
}

.xhs-confirmation-details {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    text-align: left;
    margin: 24px 0;
}

.xhs-confirmation-details .xhs-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.xhs-confirmation-details .xhs-detail-row:last-child {
    border-bottom: none;
}

.xhs-detail-label {
    color: #64748b;
}

.xhs-detail-value {
    font-weight: 600;
    color: #1e293b;
}

/* Room Info in Booking */
.xhs-selected-room {
    display: flex;
    gap: 16px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.xhs-selected-room img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
}

.xhs-selected-room-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.xhs-selected-room-info p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* Section Headings */
.xhs-section-heading {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 28px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.xhs-section-heading:first-child {
    margin-top: 0;
}

/* Loading spinner */
.xhs-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: xhs-spin 0.8s ease-in-out infinite;
}

@keyframes xhs-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast notification */
.xhs-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.xhs-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.xhs-toast.success {
    background: #10b981;
}

.xhs-toast.error {
    background: #ef4444;
}

.xhs-toast.warning {
    background: #f59e0b;
}

/* Horizontal style adjustments */
.box-horizontal .box-image,
.box-horizontal .box-text {
    display: inline-block;
    vertical-align: top;
}

/* Flatpickr custom theme */
.flatpickr-calendar {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12) !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--primary-color, #c94a33) !important;
    border-color: var(--primary-color, #c94a33) !important;
}

.flatpickr-day.inRange {
    background: rgba(201, 74, 51, 0.1) !important;
    border-color: rgba(201, 74, 51, 0.1) !important;
}

/* === Booking Form Styles (override Flatsome) === */
.xhs-booking-form {
    font-family: 'Roboto', sans-serif !important;
}

.xhs-booking-form *,
.xhs-booking-form *::before,
.xhs-booking-form *::after {
    box-sizing: border-box !important;
}

.xhs-booking-form .xhs-section-heading {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin: 16px 0 12px !important;
    padding: 0 !important;
}

.xhs-booking-form .xhs-form-row {
    display: flex !important;
    gap: 12px !important;
    margin-bottom: 0 !important;
}

.xhs-booking-form .xhs-form-group {
    flex: 1 !important;
    margin-bottom: 14px !important;
}

.xhs-booking-form label {
    display: block !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    margin-bottom: 6px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.xhs-booking-form .xhs-required {
    color: #ef4444 !important;
}

.xhs-booking-form input[type="text"],
.xhs-booking-form input[type="email"],
.xhs-booking-form input[type="tel"],
.xhs-booking-form input[type="number"],
.xhs-booking-form select,
.xhs-booking-form textarea {
    width: 100% !important;
    padding: 10px 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    color: #1e293b !important;
    background: #fff !important;
    outline: none !important;
    transition: border-color 0.2s !important;
    font-family: 'Roboto', sans-serif !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-shadow: none !important;
}

.xhs-booking-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 32px !important;
}

.xhs-booking-form input:focus,
.xhs-booking-form select:focus,
.xhs-booking-form textarea:focus {
    border-color: #c94a33 !important;
    box-shadow: 0 0 0 3px rgba(201, 74, 51, 0.1) !important;
}

.xhs-booking-form textarea {
    resize: vertical !important;
}

/* Selected room info */
.xhs-selected-room {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 16px;
}

.xhs-selected-room img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
}

.xhs-selected-room-info h4 {
    font-size: 14px !important;
    font-weight: 700 !important;
    margin: 0 0 4px !important;
    color: #1e293b !important;
}

.xhs-selected-room-info p {
    font-size: 12px !important;
    color: #64748b !important;
    margin: 0 !important;
}

/* Promo banner */
.xhs-promo-banner {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    margin-bottom: 16px;
    color: #92400e;
}

/* Price summary */
.xhs-price-summary {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.xhs-price-summary h4 {
    font-size: 13px !important;
    font-weight: 700 !important;
    margin: 0 0 10px !important;
    color: #1e293b !important;
}

.xhs-price-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: #475569;
}

.xhs-price-line.xhs-discount {
    color: #16a34a;
}

.xhs-price-line.xhs-total {
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
    padding-top: 10px;
    font-weight: 700;
    font-size: 15px;
    color: #c94a33;
}

.xhs-amount {
    font-weight: 600;
}

/* Submit button */
.xhs-submit-btn {
    width: 100% !important;
    padding: 14px !important;
    background: #c94a33 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-family: 'Roboto', sans-serif !important;
    margin-top: 8px !important;
}

.xhs-submit-btn:hover:not(:disabled) {
    background: #aa3d2a !important;
    transform: translateY(-1px) !important;
}

.xhs-submit-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

@media (max-width: 480px) {
    .xhs-booking-form .xhs-form-row {
        flex-direction: column !important;
        gap: 0 !important;
    }
}