/**
 * Hotel Cards CSS for Astra Override
 * Custom styling for WooCommerce product loops displaying as hotel cards
 * 
 * UNIFIED RATING SYSTEM:
 * - All rating displays now use .ihm-rating-card structure
 * - Centralized CSS for consistent styling across all contexts
 * - PHP helper functions in includes/rating-card-helper.php
 * - Modern card design with Google icon
 */

/* Hotel Thumbnail Wrapper */
.ihm-hotel-thumbnail-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.ihm-hotel-thumbnail-wrapper img {
    transition: transform 0.3s ease;
}

.ihm-hotel-thumbnail-wrapper:hover img {
    transform: scale(1.05);
}

/* Hotel Type Badge */
.ihm-hotel-type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 2;
}

/* Star Rating Badge */
.ihm-star-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f39c12;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    z-index: 2;
}

.ihm-product-title {
    font-size: var(--e-global-typography-ast-h4-font-size, 17px) !important;
    font-weight: var(--e-global-typography-ast-h4-font-weight, bold) !important;
    text-transform: var(--e-global-typography-ast-h4-text-transform, none) !important;
    font-style: var(--e-global-typography-ast-h4-font-style, normal) !important;
    line-height: var(--e-global-typography-ast-h4-line-height, 1.4) !important;
    letter-spacing: var(--e-global-typography-ast-h4-letter-spacing, normal) !important;
    word-spacing: var(--e-global-typography-ast-h4-word-spacing, normal) !important;
    color: #008080 !important; /* Only override the color */
}

/* Hotel Details Section */
.ihm-hotel-details {
    margin: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Feature Badges */
.ihm-feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ecf0f1;
    color: #2c3e50;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #bdc3c7;
}

.ihm-feature-badge.ihm-breakfast {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.ihm-feature-badge .dashicons {
    font-size: 12px;
    line-height: 1;
}

/* Hotel Rating - updated to match POI system */
.ihm-hotel-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

/* UNIFIED RATING CARD SYSTEM - Use this for all rating displays */
.ihm-rating-card {
    display: flex !important;
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    border-radius: 8px !important;
    padding: 6px 15px 6px 5px !important;
    margin: 8px auto 6px auto !important;
    width: fit-content !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

.ihm-rating-card-icon {
    flex: 0 0 auto !important;
    margin-right: 10px !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 40px !important;
    width: 40px !important;
}

.ihm-rating-card-details {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    min-width: 0 !important;
    width: auto !important;
    padding-right: 0 !important;
}

.ihm-rating-card img {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    display: block !important;
}

.ihm-rating-card-stars {
    font-size: 15px !important;
    line-height: 1.2 !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #333 !important;
}

.ihm-rating-card-reviews {
    font-size: 14px !important;
    color: #444 !important;
    line-height: 1.1 !important;
}

/* Mobile responsive adjustments for rating card */
@media (max-width: 768px) {
    .ihm-rating-card {
        padding: 4px 8px 4px 4px !important;
        margin: 6px auto 4px auto !important;
        border-radius: 6px !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
        min-width: 0 !important;
        max-width: 95% !important;
    }
    
    .ihm-rating-card-icon {
        height: 24px !important;
        width: 24px !important;
        margin-right: 6px !important;
    }
    
    .ihm-rating-card-icon img {
        height: 20px !important;
        width: 20px !important;
    }
    
    .ihm-rating-card-stars {
        font-size: 13px !important;
    }
    
    .ihm-rating-card-reviews {
        font-size: 12px !important;
    }
}

/* LEGACY SUPPORT - Map old classes to new rating card */
.poi-rating-enhanced {
    /* Hide old structure when rating card is present */
    display: none;
}

.ihm-hotel-enhancements-wrapper .ihm-rating-card + .poi-rating-enhanced {
    display: none !important;
}

/* Hotel Location - enhanced with postal code and prefecture */
.ihm-hotel-location {
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.ihm-location-primary,
.ihm-location-secondary {
    display: flex;
    align-items: center;
    justify-content: center;    flex-wrap: wrap;
    gap: 0.25em;
}

.ihm-location-icon {
    font-size: 1.2em;
}

/* Reset styles to inherit from theme */
.ihm-hotel-location,
.ihm-hotel-location * { /* Target all children of the location block */
    color: unset !important;
    font-size: unset !important;
    font-weight: unset !important;
}

.ihm-location-text {
    font-weight: bold !important; /* Keep city/locality bold for emphasis */
}

/* Hotel Price Wrapper */
.ihm-hotel-price-wrapper {
    margin: 15px 0 0 0;
    padding: 12px 0 0 0;
    border-top: 1px solid #ecf0f1;
}

.ihm-hotel-price {
    font-size: 18px;
    font-weight: bold;
    color: #333333;
}

.ihm-price-period {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 2px;
}

/* Product Loop Item Enhancements */
.woocommerce ul.products li.product.ihm-hotel-card {
    background: white;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.woocommerce ul.products li.product.ihm-hotel-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #3498db;
}

/* Override Astra's default spacing */
.woocommerce ul.products li.product.ihm-hotel-card .woocommerce-loop-product__link {
    display: block;
    padding: 0;
}

.woocommerce ul.products li.product.ihm-hotel-card .woocommerce-loop-product__link > * {
    padding-left: 15px;
    padding-right: 15px;
}

.woocommerce ul.products li.product.ihm-hotel-card .woocommerce-loop-product__link .ihm-hotel-thumbnail-wrapper {
    padding: 0;
    margin: 0;
}

/* Hotel Badges (modern layout: inline, centered, with gap) */
.ihm-hotel-badges {
    margin: 8px 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    text-align: center;
    font-size: 14px !important;
}

.ihm-badge {
    padding: 0;
    border-radius: 0;
    font-size: 12px;
    font-weight: 500;
    background: none;
    text-shadow: none;
    display: block;
}

.ihm-badge.ihm-hotel-type {
    background: none;
    color: #333333;
}

.ihm-badge.ihm-star-category {
    background: none;
    color: #333333;
    font-weight: 600;
}

/* Google Business Profile Rating - centered */
.ihm-hotel-gbp-rating {
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

.ihm-rating-label {
    color: #666;
    font-weight: 500;
    margin-right: 4px;
}

.ihm-stars-wrapper {
    margin: 0 4px;
}

.ihm-star {
    font-size: 14px;
    line-height: 1;
    margin-right: 1px;
}

.ihm-star-full {
    color: #f39c12;
}

.ihm-star-half {
    color: #f39c12;
}

.ihm-star-empty {
    color: #ddd;
}

.ihm-rating-number {
    font-weight: 600;
    color: #2c3e50;
    margin-left: 2px;
}

.ihm-review-count {
    color: #7f8c8d;
    font-size: 12px;
}

/* Hotel Location - centered */
.ihm-hotel-location {
    margin: 8px 0;
    font-size: 12px;
    color: #7f8c8d;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
}

.ihm-location-icon {
    font-size: 12px;
    margin-bottom: 2px;
}

.ihm-location-primary {
    display: flex;
    align-items: center;
    gap: 2px;
}

.ihm-location-text {
    font-weight: 500;
}

.ihm-postal-code {
    font-weight: 400;
    color: #95a5a6;
}

.ihm-location-secondary {
    display: flex !important; /* Make this a flex container */
    align-items: center !important; /* Align items vertically */
    flex-wrap: wrap; /* Allow wrapping if needed */
    gap: 5px; /* Add a gap between items */
    font-size: 11px;
    color: #95a5a6;
    margin-top: 2px;    text-align: center;
}

.ihm-prefecture-label {
    font-weight: 400;
}

.ihm-prefecture-text {
    font-weight: 500;
    color: #7f8c8d;
}

/* POI Rating Enhanced - Override to ensure correct styling */
.poi-rating-enhanced {
    margin: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.poi-rating-enhanced .poi-stars-rating-line,
.poi-rating-enhanced .review-count {
    display: block !important;
}

.poi-stars-rating-line {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    width: 100%;
}

/* Keep existing centering fix for backward compatibility */
.ihm-rating-center-fix {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.ihm-rating-center-fix .review-count {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 4px;
}

/* Force Centering for Enhanced POI Rating */
.poi-rating-enhanced.ihm-rating-center-fix {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.poi-rating-enhanced.ihm-rating-center-fix > .poi-stars-rating-line,
.poi-rating-enhanced.ihm-rating-center-fix > .review-count {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* FINAL: Force center for POI rating block inside Astra/WooCommerce thumbnail */
.astra-shop-thumbnail-wrap .poi-rating-enhanced.ihm-rating-center-fix,
.woocommerce-LoopProduct-link .poi-rating-enhanced.ihm-rating-center-fix {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-top: 8px;
  padding-bottom: 4px;
}
.astra-shop-thumbnail-wrap .poi-rating-enhanced.ihm-rating-center-fix > .poi-stars-rating-line,
.astra-shop-thumbnail-wrap .poi-rating-enhanced.ihm-rating-center-fix > .review-count,
.woocommerce-LoopProduct-link .poi-rating-enhanced.ihm-rating-center-fix > .poi-stars-rating-line,
.woocommerce-LoopProduct-link .poi-rating-enhanced.ihm-rating-center-fix > .review-count {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Hotel Enhancements Wrapper - appears below title and price */
.ihm-hotel-enhancements-wrapper {
    padding: 0 15px;
    margin-top: 0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    position: relative;
}

/* Shortcode-specific 2-column layout and card constraints */
.ihm-hotel-enhancements-wrapper {
    /* Adjusted padding for tighter spacing */
    padding: 5px !important;
    max-width: 600px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
    margin: 5px auto;
}

.ihm-hotel-enhancements-wrapper:hover {
    background-color: #E6F5F5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ihm-hotel-enhancements-wrapper .ihm-hotel-shortcode-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
}

.ihm-hotel-enhancements-wrapper .ihm-hotel-image-wrapper {
    flex: 0 0 33.3333% !important;
    max-width: 33.3333% !important;
    padding: 5px !important;
}

.ihm-hotel-enhancements-wrapper .ihm-hotel-image-wrapper img {
    display: block !important;
    width: 100% !important;
    aspect-ratio: 1/1 !important;
    object-fit: cover !important;
    border-radius: 15px !important;
}

.ihm-hotel-enhancements-wrapper .ihm-hotel-shortcode-content {
    flex: 1 1 66.6666% !important;
    padding: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0px !important; /* Reduced gap */
}

/* Reduce all margins on direct children to a minimum */
.ihm-hotel-enhancements-wrapper .ihm-hotel-shortcode-content > * {
    margin-top: 1px !important;
    margin-bottom: 1px !important;
}

/* Further reduce margins on specific problematic elements */
.ihm-hotel-enhancements-wrapper .ihm-rating-card,
.ihm-hotel-enhancements-wrapper .ihm-hotel-badges,
.ihm-hotel-enhancements-wrapper .ihm-product-price,
.ihm-hotel-enhancements-wrapper .ihm-hotel-location {
    margin-top: 2px !important;
    margin-bottom: 2px !important;
}

/* Keep 2-column layout on mobile for hotel cards */
@media (max-width: 768px) {
    .ihm-hotel-enhancements-wrapper .ihm-hotel-shortcode-container {
        flex-direction: row !important;
        display: flex !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    .ihm-hotel-enhancements-wrapper .ihm-hotel-image-wrapper {
        flex: 0 0 40% !important;
        max-width: 40% !important;
    }
    .ihm-hotel-enhancements-wrapper .ihm-hotel-shortcode-content {
        flex: 1 !important;
        max-width: calc(60% - 12px) !important;
    }
    
    /* Ensure proper spacing on mobile */
    .ihm-hotel-enhancements-wrapper .ihm-hotel-image-wrapper {
        margin-bottom: 0 !important;
    }
    /* Set global mobile font size for hotel card titles */
    .ihm-hotel-enhancements-wrapper .ihm-product-title {
        font-size: 15px !important;
        line-height: 1.4 !important;
    }
}

.ihm-hotel-enhancements-wrapper .ihm-clickable-overlay {
    color: inherit;
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}

.ihm-hotel-enhancements-wrapper .ihm-clickable-overlay:hover {
    color: inherit;
    text-decoration: none;
}

.ihm-hotel-enhancements-wrapper .ihm-product-price {
    margin: 0 0 12px 0;
    text-align: center;
    font-size: 14px !important;
}

 .ihm-hotel-enhancements-wrapper .ihm-product-price .price {
    font-weight: normal !important;
    color: #333333 !important;
    font-size: 14px !important;
}

.ihm-hotel-enhancements-wrapper .poi_rating_enhanced {
    margin: 12px 0 8px 0;
}

.ihm-hotel-enhancements-wrapper .ihm-hotel-badges {
    margin: 8px 0;
}

.ihm-hotel-enhancements-wrapper .ihm-hotel-location {
    margin: 8px 0 0 0;
    font-size: 14px !important;
    color: #333333 !important;
}
/* Ensure all child elements of location inherit correct font size and color */
.ihm-hotel-enhancements-wrapper .ihm-hotel-location,
.ihm-hotel-enhancements-wrapper .ihm-hotel-location * {
    font-size: 14px !important;
    color: #333333 !important;
}

/* Basic reset for badges and reviews; preserve custom text styles for location and titles */
.ihm-hotel-enhancements-wrapper .ihm-badge,
.ihm-hotel-enhancements-wrapper .review-count {
    text-transform: none !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
}
/* Force unified badge color and size */
.ihm-hotel-enhancements-wrapper .ihm-hotel-badges .ihm-badge {
    color: #444444 !important;
    font-size: 14px !important;
    font-weight: normal !important;
}

.ihm-hotel-enhancements-wrapper .ihm-location-text {
    font-weight: bold !important; /* Keep city/locality bold for emphasis */
}

.ihm-hotel-enhancements-wrapper .ihm-hotel-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0; /* Remove gap, use pseudo-element for spacing */
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

/* Add a separator between the hotel type and star category */
.ihm-hotel-enhancements-wrapper .ihm-badge:not(:last-child) {
    margin-right: 5px; /* Add some space between badges */
}

/* Rating Card Styles - Ensure consistent styling across all contexts */
.ihm-hotel-enhancements-wrapper .ihm-rating-card {
    display: flex !important;
    align-items: center !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    border-radius: 8px !important;
    padding: 6px 15px 6px 5px !important;
    margin: 8px auto 6px auto !important;
    width: fit-content !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

.ihm-hotel-enhancements-wrapper .ihm-rating-card-icon {
    flex: 0 0 auto !important;
    margin-right: 10px !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 40px !important;
    width: 40px !important;
}

.ihm-hotel-enhancements-wrapper .ihm-rating-card-details {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    min-width: 0 !important;
    width: auto !important;
    padding-right: 0 !important;
}

.ihm-hotel-enhancements-wrapper .ihm-rating-card img {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    display: block !important;
}

.ihm-hotel-enhancements-wrapper .ihm-rating-card-stars {
    font-size: 15px !important;
    line-height: 1.2 !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #333 !important;
}

 .ihm-hotel-enhancements-wrapper .ihm-rating-card-reviews {
    font-size: 12px !important;
    font-weight: normal !important;
    color: #444 !important;
    line-height: 1.1 !important;
}

/* Mobile responsive adjustments for rating card */
@media (max-width: 768px) {
    .ihm-hotel-enhancements-wrapper .ihm-rating-card {
        padding: 4px 8px 4px 4px !important;
        margin: 6px auto 4px auto !important;
        border-radius: 6px !important;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
        min-width: 0 !important;
        max-width: 95% !important;
    }
    
    .ihm-hotel-enhancements-wrapper .ihm-rating-card-icon {
        height: 24px !important;
        width: 24px !important;
        margin-right: 6px !important;
    }
    
    .ihm-hotel-enhancements-wrapper .ihm-rating-card-icon img {
        height: 20px !important;
        width: 20px !important;
    }
    
    .ihm-hotel-enhancements-wrapper .ihm-rating-card-stars {
        font-size: 13px !important;
    }
    
    .ihm-hotel-enhancements-wrapper .ihm-rating-card-reviews {
        font-size: 12px !important;
    }
    
    .ihm-hotel-enhancements-wrapper .ihm-product-title { font-size: 13px !important; }
    
    #map-selected-item-container .ihm-hotel-location { display: none !important; }
    .ihm-hotel-enhancements-wrapper .ihm-hotel-badges .ihm-badge { font-size: 12px !important; }
}

/* Highlighted Hotel Card - for map overlay display */
.highlighted-hotel-card {
    background: #fff;
    border: 2px solid #3498db;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

.highlighted-hotel-card .ihm-hotel-enhancements-wrapper {
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.highlighted-hotel-card .ihm-rating-card {
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
}

/* Enhanced highlighted hotel card styling to ensure perfect consistency */
.highlighted-hotel-card .ihm-hotel-enhancements-wrapper {
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure all text elements use consistent styling in highlighted card */
.highlighted-hotel-card .ihm-product-title,
.highlighted-hotel-card .ihm-product-price,
.highlighted-hotel-card .ihm-hotel-badges,
.highlighted-hotel-card .ihm-hotel-location,
.highlighted-hotel-card .ihm-rating-card-stars,
.highlighted-hotel-card .ihm-rating-card-reviews {
    color: inherit !important;
    font-size: inherit !important;
}

/* Ensure highlighted card doesn't override spacing */
.highlighted-hotel-card .ihm-hotel-shortcode-content > * {
    margin: inherit !important;
}

/* Mobile responsiveness for highlighted card */
@media (max-width: 768px) {
    .highlighted-hotel-card {
        border-width: 1px !important;
        border-radius: 6px !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ihm-hotel-details {
        gap: 4px;
    }
    
    .ihm-feature-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .ihm-hotel-price {
        font-size: 16px;
    }
    
    .ihm-rating-stars .ihm-star {
        font-size: 14px;
    }
    
    .ihm-thumbnail-badges {
        top: 8px;
        left: 8px;
        right: 8px;
    }
    
    .ihm-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .ihm-hotel-gbp-rating {
        font-size: 12px;
    }
    
    .ihm-star {
        font-size: 13px;
    }
    
    .ihm-hotel-location {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .ihm-hotel-type-badge,
    .ihm-star-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .ihm-hotel-location {
        font-size: 12px;
    }
    
    .ihm-rating-text {
        font-size: 12px;
    }
    
    .ihm-thumbnail-badges {
        top: 6px;
        left: 6px;
        right: 6px;
    }
    
    .ihm-badge {
        font-size: 9px;
        padding: 2px 5px;
    }
    
    .ihm-rating-label {
        display: none; /* Hide "Google Rating:" label on very small screens */
    }
}

/* Ensure compatibility with Astra theme variations */
.ast-woo-shop-archive .ihm-hotel-gbp-rating,
.ast-woo-category-archive .ihm-hotel-gbp-rating {
    border-top: 1px solid #eee;
    padding-top: 8px;
    margin-top: 8px;
}

.ast-woo-shop-archive .ihm-hotel-location,
.ast-woo-category-archive .ihm-hotel-location {
    margin-bottom: 0;
}

/* Loading State */
.ihm-hotel-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ihm-hotel-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3498db;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Ensure rating and review count have the correct color */
.ihm-hotel-enhancements-wrapper .ihm-rating-card-reviews {
    color: #006666 !important; /* Darker teal for rating and reviews - important to override theme styles */
    font-weight: bold !important; /* Ensure this overrides theme styles */
}


/*
 * Badge & Location Text Unification
 * Ensures consistency in styling for badges and location text across the site
 */
.ihm-badge,
.ihm-location-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ihm-location-text {
    font-size: 14px;
    color: #333;
}

.ihm-badge {
    font-size: 12px;
    color: #fff;
    background: #0073aa;
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-block;
    margin: 4px 0;
}

/* Specific Badge Styles */
.ihm-badge.ihm-hotel-type {
    background: #28a745;
}

.ihm-badge.ihm-star-category {
    background: #ffc107;
}

/* Location Text Enhancements */
.ihm-location-primary {
    font-weight: 600;
    color: #0073aa;
}

.ihm-location-secondary {
    font-weight: 400;
    color: #666;
}

/* Responsive Adjustments for Badges and Location Text */
@media (max-width: 768px) {
    .ihm-badge {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .ihm-location-text {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .ihm-badge {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .ihm-location-text {
        font-size: 11px;
    }
}

/* General Style Unification
 * These rules ensure that all informational text (address, badges, reviews)
 * inherits the site's default text styles, except where explicitly overridden.
 */
.ihm-hotel-enhancements-wrapper .ihm-hotel-location,
.ihm-hotel-enhancements-wrapper .ihm-badge {
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    text-transform: none !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0;
    margin: 0;
    display: inline; /* Override any block-level styles */
}

/* Ensure address parts are inline and have no extra styling */
.ihm-hotel-location * {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
}

/* Hide the location icon if it's not needed, but keep it for now */
.ihm-location-icon {
    margin-right: 5px; /* Space between icon and text */
}

/* Remove any lingering pseudo-elements from old structure */
.ihm-location-secondary::before,
.ihm-location-secondary::after,
.ihm-prefecture-text::after,
.ihm-location-text::after,
.ihm-postal-code::after,
.ihm-region-text::after {
    content: "" !important;
    display: none !important;
}

/* Ensure the wrapper itself doesn't force flex-column or other weird layouts on our address */
.ihm-hotel-location {
    display: block; /* The address tag itself is a block */
    text-align: center; /* But we want its inline contents centered */
}

/*
Description: Overrides Elementor's grid styles to apply Astra's column settings for hotel cards on mobile and tablet.
*/

/* Tablet view: 2 columns */
@media (min-width: 768px) and (max-width: 991px) {
    .woocommerce ul.products.elementor-grid.columns-4,
    .woocommerce-page ul.products.elementor-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile view: 1 column */
@media (max-width: 767px) {
    .woocommerce ul.products.elementor-grid.columns-4,
    .woocommerce-page ul.products.elementor-grid.columns-4 {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Specific adjustment for review count color in the centered rating block */
.poi-rating-enhanced.ihm-rating-center-fix > .review-count {
    color: #444444 !important;
}
/* Card text sizes and layout overrides (centralized from inline styles) */
.ihm-hotel-enhancements-wrapper .ihm-product-title {
    text-align: center;
    margin: 6px 0;
    font-size: 17px;
    border-top: none;
}
.ihm-hotel-enhancements-wrapper .ihm-hotel-location {
    text-align: center;
    width: 100%;
    display: block;
}
.ihm-hotel-enhancements-wrapper .ihm-location-text,
.ihm-hotel-enhancements-wrapper .ihm-postal-code,
.ihm-hotel-enhancements-wrapper .ihm-prefecture-text,
.ihm-hotel-enhancements-wrapper .ihm-region-text {
    display: inline;
    font-size: 14px;
    margin-top: 2px;
    margin-bottom: 2px;
}
.ihm-hotel-enhancements-wrapper .ihm-product-price {
    text-align: center;
    margin: 2px 0 8px 0;
    font-size: 14px;
    font-family: inherit;
    font-weight: normal;
    color: #333333;
    letter-spacing: normal;
}
.ihm-hotel-enhancements-wrapper .ihm-product-price .price {
    font-weight: normal;
    color: #333333;
    font-size: 14px;
    font-family: inherit;
    letter-spacing: normal;
}
.ihm-hotel-enhancements-wrapper .ihm-hotel-badges {
    text-align: center;
    justify-content: center;
    font-size: 14px;
    margin-top: 2px;
    margin-bottom: 2px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
}
/* Responsive text adjustments */
@media (max-width: 768px) {
    .ihm-hotel-enhancements-wrapper .ihm-product-title { font-size: 15px !important; }
    .ihm-hotel-enhancements-wrapper .ihm-product-price,
    .ihm-hotel-enhancements-wrapper .ihm-product-price .price,
    .ihm-hotel-enhancements-wrapper .ihm-hotel-badges { font-size: 12px !important; }
    .ihm-hotel-enhancements-wrapper .ihm-location-text,
    .ihm-hotel-enhancements-wrapper .ihm-postal-code,
    .ihm-hotel-enhancements-wrapper .ihm-prefecture-text,
    .ihm-hotel-enhancements-wrapper .ihm-region-text { font-size: 12px !important; }
}

/* Force unified review text color */
.ihm-hotel-enhancements-wrapper .ihm-rating-card-reviews {
    color: #444444 !important;
    font-size: 12px !important;
    font-weight: normal !important;
}

/* Override price color for Elementor shortcode context */
.ihm-hotel-enhancements-wrapper .ihm-product-price .price,
.elementor-shortcode .ihm-hotel-enhancements-wrapper .ihm-product-price .price {
    color: #333333 !important;
}