/* Base Reset */
.hr-ota-widget-wrapper { display: flex; justify-content: center; font-family: var(--hr-font-family, sans-serif); line-height: 1.5; color: var(--hr-color-text-primary); }
.hr-ota-widget * { box-sizing: border-box; }

:root {
    --hr-font-base: 12px;
    --hr-font-header: 0.9rem;
    --hr-font-subtext: 0.65rem;
    --hr-font-ota-label: 0.8rem;
    --hr-font-ota-from: 0.6rem;
    --hr-font-ota-price: 0.8rem;
    --hr-font-ota-fees: 0.65rem;
    --hr-font-ota-diff: 0.75rem;
    --hr-widget-max-width: 500px;
    --hr-widget-padding: 24px;
    --hr-tile-padding: 18px 24px;
    --hr-row-gap: 22px;
    --hr-logo-size: 18px;
    --hr-radius-widget: 8px;
    --hr-radius-tile: 7px;
    --hr-radius-button: 5px;
    --hr-shadow-widget: 0 12px 32px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0,0,0,0.08);
    --hr-color-header-text: #ffffff;
    --hr-color-widget-bg: #ffffff;
    --hr-color-tile-bg: #E5E7EB;
    --hr-color-text-primary: #111827;
    --hr-color-text-secondary: #4B5563;
    --hr-color-text-muted: #9CA3AF;
    --hr-color-check: #22c55e;
    --hr-color-dots: #9ca3af;
    --hr-mobile-tab-bg: #1da452;
    --hr-mobile-tab-text: #ffffff;
}

/* Main Widget Container */
.hr-ota-widget {
    background: var(--hr-color-widget-bg);
    border-radius: var(--hr-radius-widget);
    box-shadow: var(--hr-shadow-widget);
    width: 100%;
    max-width: var(--hr-widget-max-width);
    overflow: hidden;
    font-size: var(--hr-font-base);
}

/* Header */
.hr-ota-header { 
    background: var(--hr-color-header-bg); 
    color: var(--hr-color-header-text); 
    padding: 8px 0; 
    font-weight: 600; 
    text-align: center; 
    font-size: var(--hr-font-header); 
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    user-select: none; transition: background-color 0.2s, filter 0.2s;
    text-decoration: underline; 
}
.hr-ota-header:hover { filter: brightness(1.1); }

/* Skeleton / Loader */
.hr-ota-skeleton { padding: 16px 24px 24px; position: relative; }
.hr-skel-line, .hr-skel-circle { background: linear-gradient(90deg, #e4e7ec 25%, #f2f4f7 50%, #e4e7ec 75%); background-size: 200% 100%; border-radius: 4px; animation: hr-skel-shimmer 1.4s infinite; }
@keyframes hr-skel-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.hr-skel-savings { height: 40px; width: 100%; border-radius: var(--hr-radius-button); margin: 0 auto 12px; }
.hr-skel-loader-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(255,255,255,0.9); padding: 8px 16px; border-radius: 20px; font-weight: 600; font-size: 13px; color: #333; z-index: 5; animation: hrPulse 1.5s infinite; }
@keyframes hrPulse { 0% { opacity: 0.8; } 50% { opacity: 1; } 100% { opacity: 0.8; } }

/* Collapsible Logic */
.hr-ota-widget:not(.hr-expanded) .hr-ota-chevron svg { transform: rotate(0deg); }
.hr-ota-widget.hr-expanded .hr-ota-chevron svg { transform: rotate(180deg); }
.hr-ota-chevron { transition: transform 0.3s ease; }

/* Direct Price */
.hr-ota-direct-price-wrap { font-size: var(--hr-font-direct-price); font-weight: 800; text-align: center; }
.hr-ota-best-price-highlight { background: var(--hr-color-highlight); padding: 2px 6px; font-weight: 600; }

/* Fix for giant checkmark icon */
.hr-ota-check { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    margin-left: 8px; 
    vertical-align: middle;
}

.hr-ota-check svg { 
    width: 24px !important; 
    height: 24px !important; 
    min-width: 24px; 
    display: block; 
    fill: var(--hr-color-check); 
}

/* Tile Rows */
.hr-ota-tiles { padding: 0 var(--hr-widget-padding); }
.hr-ota-tile { background: var(--hr-color-tile-bg); padding: var(--hr-tile-padding); border-radius: var(--hr-radius-tile); }
.hr-ota-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--hr-row-gap); position: relative; }
.hr-ota-flex-line { display: flex; align-items: flex-end; gap: 6px; width: 100%; }
.hr-ota-logo { width: var(--hr-logo-size); height: var(--hr-logo-size); border-radius: 50%; overflow: hidden; display: inline-block; vertical-align: middle; }
.hr-ota-logo svg { display: block; width: 100%; height: 100%; }
.hr-ota-dots { flex-grow: 1; border-bottom: 2px dotted var(--hr-color-dots); margin: 0 4px 4px; opacity: 0.5; }
.hr-ota-price { font-weight: 700; font-size: var(--hr-font-ota-price); }
.hr-ota-diff { position: absolute; top: 100%; right: 0; margin-top: 2px; font-size: var(--hr-font-ota-diff); color: var(--hr-color-diff); font-weight: 700; }

/* Savings */
.hr-ota-savings-text { color: var(--hr-color-receipt-text); font-size: var(--hr-font-saving); font-weight: 600; text-align: center; }
.hr-ota-savings-amount { font-weight: 800; font-size: 1.2em; }
.hr-ota-savings-subtext { font-size: var(--hr-font-subtext); text-align: center; font-weight: bold; }
.hr-ota-disclaimer { font-size: 9px; color: #9CA3AF; text-align: center; margin-top: 8px; padding: 0 20px; }

/* Drawer (Mobile) */
.hr-mobile-drawer { position: fixed; bottom: var(--hr-mobile-offset, 0px); left: 0; width: 100%; z-index: 999990; display: flex; flex-direction: column; align-items: center; pointer-events: none; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.hr-mobile-drawer.is-open { transform: translateY(0); pointer-events: auto; }
.hr-mobile-drawer-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 999980; opacity: 0; pointer-events: none; transition: opacity 0.3s; display: none; }
.hr-mobile-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; display: block; }
.hr-mobile-tab { position: absolute; bottom: 100%; left: 0; right: 0; margin: 0 auto; width: 85%; max-width: 380px; background: var(--hr-mobile-tab-bg); color: var(--hr-mobile-tab-text); padding: 8px 12px; border-radius: 12px 12px 0 0; font-weight: 600; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; pointer-events: auto; z-index: 2; margin-bottom: -1px; }
.hr-mobile-drawer .hr-ota-widget { width: 96%; max-width: 450px; border-radius: 20px 20px 0 0; }
.hr-mobile-drawer .hr-ota-header { display: none !important; }
.hr-mobile-drawer .hr-ota-content { display: block !important; opacity: 1 !important; }

/* Checkout Modal */
.hr-modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 999999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.hr-modal-overlay.is-open { opacity: 1; pointer-events: auto; }
.hr-modal-backdrop-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); }
.hr-checkout-modal { position: relative; z-index: 2; width: 90%; max-width: 400px; }
.hr-checkout-close { position: absolute; top: -10px; right: -10px; background: #fff; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-weight: bold; }
.hr-checkout-embedded-bar { background: #1da452; color: #fff; padding: 8px 12px; border-radius: 4px; margin: 10px 0; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }

@media (max-width: 959px) {
    .hr-ota-widget-wrapper:not(.hr-wrapper-checkout) { display: none !important; }
}
@media (min-width: 960px) {
    .hr-mobile-drawer, .hr-mobile-drawer-backdrop { display: none !important; }
    .hr-ota-widget-wrapper:not([data-mode="checkout"]) .hr-ota-collapsible-wrapper { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s ease-out; }
    .hr-ota-widget.hr-expanded .hr-ota-collapsible-wrapper { grid-template-rows: 1fr; }
    .hr-ota-collapsible-wrapper > div { overflow: hidden; }
}