/* Placeholder untuk Gutenberg Editor */
.hw360-compare-editor-stub {
    padding: 24px;
    border: 2px dashed var(--wp--preset--color--grey-border);
    background: var(--wp--preset--color--soft-grey);
    text-align: center;
    border-radius: 8px;
    color: var(--wp--preset--color--grey-muted);
}

/* Container Tabel Modern */
/* Pembungkus blok — hasil get_block_wrapper_attributes(), satu tingkat di atas
   .hw360-modern-table-wrapper.

   INI yang sebenarnya melebar di ponsel, bukan wrapper tabelnya. Ia adalah
   flex item milik .kt-inside-inner-col Kadence, dan flex item bawaannya
   min-width:auto — menolak menyusut di bawah lebar isinya. Terukur: induknya
   343px, elemen ini 902px. Selama ia lebih lebar dari layar, wrapper di
   dalamnya juga ikut lebar, overflow-x:auto tidak pernah punya sesuatu untuk
   di-scroll, dan kolom Action terpotong tanpa bisa dijangkau.

   Membatasi wrapper tabel saja tidak cukup — sudah dicoba, dan angkanya tidak
   bergerak. Batasnya harus dipasang di elemen yang menerima lebar itu. */
.hw360-compare {
    min-width: 0;
    max-width: 100%;
}

.hw360-modern-table-wrapper {
    background: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--grey-border);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    margin-top: 24px;

    /* Tanpa dua baris ini tabel tidak bisa digeser di ponsel meski sudah
       overflow-x:auto. Kolom Kadence yang memuat blok ini adalah flex
       container, dan sebuah flex item punya min-width:auto secara bawaan —
       ia menolak menyusut di bawah lebar isinya. Wrapper karenanya melebar
       ke 900px mengikuti tabelnya, tidak ada lagi yang lebih sempit dari
       tabel itu, jadi overflow-x tidak pernah punya sesuatu untuk di-scroll
       dan kolom Action terpotong tanpa bisa dijangkau. Persoalan yang sama
       pernah muncul di tabel shortcode. */
    min-width: 0;
    max-width: 100%;
}

.hw360-modern-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    text-align: left;
}

.hw360-modern-table th {
    background: var(--wp--preset--color--soft-grey);
    padding: 16px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wp--preset--color--grey-text-strong);
    border-bottom: 1px solid var(--wp--preset--color--grey-border);
}

.hw360-row-card {
    border-bottom: 1px solid var(--wp--preset--color--soft-grey);
    transition: background-color 0.2s ease;
}

.hw360-row-card:hover {
    background-color: var(--wp--preset--color--soft-grey);
}

.hw360-row-card td {
    padding: 20px;
    vertical-align: middle;
}

/* Kolom Provider */
.hw-provider-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hw-avatar {
    width: 40px;
    height: 40px;
    background: var(--wp--preset--color--soft-grey);
    color: var(--wp--preset--color--grey-text-strong);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.hw-provider-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hw-name {
    font-weight: 700;
    color: var(--wp--preset--color--navy);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* The provider name links to our own record page for that pharmacy. Only the
   name is a link — never the row or the cell — so the outbound "See offer"
   control stays a separate, distinguishable target.

   The underline is always on, not hover-only: inside a dense table the name is
   the one element a reader has no other cue for, and colour alone would not
   carry it (WCAG 2.2 AA, SC 1.4.1). */
.hw-name__link {
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-decoration-color: var(--wp--preset--color--grey-subtle, #82898F);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.hw-name__link:hover,
.hw-name__link:focus-visible {
    color: var(--wp--preset--color--link-blue, #005FCC);
    text-decoration-color: currentColor;
}

.hw-name__link:focus-visible {
    outline: 2px solid var(--wp--preset--color--link-blue, #005FCC);
    outline-offset: 2px;
    border-radius: 2px;
}

.hw-rating {
    font-size: 13px;
    font-weight: 600;
    color: var(--wp--preset--color--grey-text-strong);
}

.hw-star { color: var(--wp--preset--color--rating-amber); }
.hw-muted { color: var(--wp--preset--color--grey-muted); font-weight: 400; }

/* Kolom Harga & Total */
.hw-price-main {
    font-size: 18px;
    font-weight: 800;
    color: var(--wp--preset--color--trust-teal);
}

.hw-price-sub {
    font-size: 12px;
    color: var(--wp--preset--color--grey-muted);
    margin: 4px 0;
}

.hw-price-regular {
    font-size: 15px;
    font-weight: 600;
    color: var(--wp--preset--color--grey-text-strong);
}

/* Badges */
.hw-promo-pill {
    display: inline-block;
    margin-top: 10px;
    background: var(--wp--preset--color--success-surface);
    color: var(--wp--preset--color--success-text);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.hw-badge-green-light {
    display: inline-block;
    background: var(--wp--preset--color--success-surface);
    color: var(--wp--preset--color--success-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.hw-badge-blue-light {
    display: inline-block;
    background: var(--wp--preset--color--info-indigo-surface);
    color: var(--wp--preset--color--info-indigo);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.hw-delivery-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 14px;
}

.hw-text-green { color: var(--wp--preset--color--success-green); }

/* Trust Column */
.hw-trust-gphc {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--wp--preset--color--grey-text-strong);
    font-weight: 500;
}

/* The registration number links to the regulator's own register entry.

   Underlined explicitly: this sits in a table cell where Kadence removes
   underlines through a selector more specific than a single class, and inside
   a row already carrying green trust colour, so colour alone cannot mark it
   as a link (SC 1.4.1).

   min-height 24px meets SC 2.5.8 without widening the cell — the link is
   inline, so only its vertical box needs help. */
.hw-trust-reg-link {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    color: var(--wp--preset--color--link-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hw-trust-reg-link:hover,
.hw-trust-reg-link:focus {
    color: var(--wp--preset--color--navy);
    text-decoration: underline;
}

.hw-trust-verified {
    font-size: 12px;
    color: var(--wp--preset--color--success-green);
    margin-top: 4px;
    padding-left: 20px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Tombol Action */
.hw-btn-see-offer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--wp--preset--color--trust-teal);
    color: var(--wp--preset--color--white);
    padding: 10px 16px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.hw-btn-see-offer:hover {
    background: var(--wp--preset--color--trust-teal-dark);
    color: white;
}

/* Pengganti tombol untuk baris yang belum punya tautan keluar. Bukan tombol
   berwarna abu: sebuah kontrol yang tampak bisa ditekan tapi tidak melakukan
   apa pun lebih membingungkan daripada teks biasa yang menyebut keadaannya. */
.hw-no-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--wp--preset--color--grey-muted);
}

.hw-table-footer {
    background: var(--wp--preset--color--soft-grey);
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--wp--preset--color--grey-muted);
    border-top: 1px solid var(--wp--preset--color--grey-border);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* --- Dose Selector Dropdown --- */
.hw360-dose-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: -8px; /* Menarik tabel sedikit ke atas agar lebih rapat */
    margin-top: 16px;
}

.hw360-dose-label {
    font-size: 14px;
    color: var(--wp--preset--color--grey-text-strong);
    font-weight: 500;
}

.hw360-select-container {
    position: relative;
    display: inline-block;
}

.hw360-dose-dropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--wp--preset--color--white);
    border: 1px solid var(--wp--preset--color--grey-border);
    border-radius: 6px;
    padding: 8px 36px 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--wp--preset--color--grey-text-strong);
    cursor: pointer;
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 120px;
}

.hw360-dose-dropdown:hover,
.hw360-dose-dropdown:focus {
    border-color: var(--wp--preset--color--trust-teal);
    box-shadow: 0 0 0 3px rgba(15, 92, 79, 0.1);
}

/* Kustomisasi icon panah dropdown */
.hw360-select-container::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 6px;
    background-color: var(--wp--preset--color--grey-muted);
    clip-path: polygon(100% 0%, 0 0%, 50% 100%);
    pointer-events: none;
}

.hw-trust-pending {
    font-size: 12px;
    color: var(--wp--preset--color--grey-muted);
    margin-top: 4px;
    padding-left: 20px;
    font-weight: 500;
}

.hw-provider-entity {
    font-size: 12px;
    color: var(--wp--preset--color--grey-muted);
}

.hw360-modern-table th[scope="row"] {
    background: transparent;
    font-weight: 400;
    padding: 20px;
    vertical-align: middle;
}

/* Kolom Provider dipaku di tepi kiri selama tabel digeser. Dengan tujuh kolom
   di layar 375px, tanpa ini pengunjung yang menggeser ke kolom biaya kehilangan
   nama apoteknya — angka di depan mata jadi tidak jelas milik siapa, tepat pada
   kolom yang paling berkonsekuensi kalau dibaca salah.

   Latar wajib solid: sel sticky melintas di atas sel lain, dan latar transparan
   membuat keduanya tertumpuk jadi tidak terbaca. Itu sebabnya aturan ini harus
   berada SETELAH `background: transparent` di atas. */
.hw360-modern-table thead th:first-child,
.hw360-modern-table tbody th[scope="row"] {
    position: sticky;
    left: 0;
    z-index: 2;
    border-right: 1px solid var(--wp--preset--color--grey-border);
}

.hw360-modern-table tbody th[scope="row"] {
    background: var(--wp--preset--color--white);
}

/* Sel yang dipaku harus ikut menyala saat barisnya di-hover, kalau tidak satu
   sel putih akan menyela baris yang sedang disorot. Selektornya dibuat lebih
   spesifik daripada aturan putih di atas, yang kalau tidak akan menang. */
.hw360-modern-table tbody .hw360-row-card:hover th[scope="row"] {
    background: var(--wp--preset--color--soft-grey);
}

@media (max-width: 640px) {
    /* Sel dirapatkan supaya tujuh kolom tidak menuntut geseran sejauh mungkin,
       dan kolom yang dipaku tidak mengambil terlalu banyak ruang. */
    .hw360-row-card td,
    .hw360-modern-table th[scope="row"] {
        padding: 12px 10px;
    }

    .hw360-modern-table thead th:first-child,
    .hw360-modern-table tbody th[scope="row"] {
        min-width: 132px;
    }

    .hw-avatar {
        display: none;
    }
}

.hw-col-price .hw360-flag {
    margin: 8px 0 0;
    font-size: 11px;
    color: var(--wp--preset--color--grey-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.hw-col-price .hw360-flag--stale,
.hw-col-price .hw360-flag--expired {
    color: var(--wp--preset--color--warning-amber);
    font-weight: 600;
}

.hw-trust-gphc--pending { color: var(--wp--preset--color--grey-muted); }