/* Gadget Review Hub — compare styles (works with any theme, including Elementor)
   Same-to-same as the MobileDokan Redmi 17 reference (v2.2): floating compare
   button + slide-in tray. */

/* Elementor's global kit styles every native <button> with the site accent
   color (orange) and white text — win back our own look. Orange is only a
   fill with BLACK text, never white on orange. */

.grh-compare-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border: 1px solid #2b2e33 !important;
    background: #2b2e33 !important;
    color: #fff !important;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    min-height: 42px;
}

/* ---------- Shared buttons (used by the tray + single template) ---------- */

.grh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 8px;
    padding: 9px 16px;
    font-weight: 700;
    font-size: 15px;
    border: 1px solid transparent;
    min-height: 42px;
    text-decoration: none;
    cursor: pointer;
}

.grh-btn:hover {
    text-decoration: none;
    filter: brightness(.97);
}

.grh-on-orange {
    background: var(--grh-primary, #F97316) !important;
    border-color: var(--grh-primary, #F97316) !important;
    color: #14161a !important;
}

.grh-btn-outline {
    background: #fff !important;
    border: 2px solid var(--grh-primary, #F97316) !important;
    color: #14161a !important;
}

.grh-btn-dark {
    background: #2b2e33 !important;
    border-color: #2b2e33 !important;
    color: #fff !important;
}

/* ---------- Toast (dark pill, bottom center) ---------- */

.grh-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translate(-50%, 0);
    background: #14161a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    z-index: 400;
    max-width: 92vw;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

/* ---------- Floating compare button ---------- */

.grh-cmp-fab {
    position: fixed;
    right: 0;
    top: 44%;
    z-index: 150;
    background: var(--grh-primary, #F97316) !important;
    color: #14161a !important;
    border: 0 !important;
    border-radius: 10px 0 0 10px;
    width: 46px;
    min-height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    box-shadow: -3px 3px 12px rgba(0, 0, 0, .25);
    padding: 8px 0;
    cursor: pointer;
}

.grh-cmp-n {
    background: #14161a;
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    padding: 1px 8px;
}

/* ---------- Slide-in compare tray ---------- */

.grh-tray {
    position: fixed;
    top: 0;
    right: 0;
    height: 100dvh;
    width: min(360px, 92vw);
    background: #fff;
    color: #232629;
    z-index: 280;
    box-shadow: -12px 0 40px rgba(0, 0, 0, .3);
    transform: translateX(105%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
}

.grh-tray.open {
    transform: none;
}

.grh-tray-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #e1e5e8;
}

.grh-tray-head h2 {
    font-size: 18px;
    color: #14161a;
    margin: 0;
}

.grh-tray-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0 !important;
    background: #f4f6f7 !important;
    color: #14161a !important;
    font-size: 18px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.grh-tray-tab {
    align-self: flex-start;
    margin: 12px 18px 0;
    background: var(--grh-primary, #F97316);
    color: #14161a;
    font-weight: 800;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 14px;
}

.grh-tray-items {
    padding: 8px 18px;
    overflow: auto;
    flex: 1;
}

.grh-tray-item {
    display: flex;
    gap: 12px;
    align-items: center;
    border: 1px solid #e1e5e8;
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
}

.grh-tray-item img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
}

.grh-tray-item h3 {
    font-size: 15px;
    color: #14161a;
    margin: 0;
}

.grh-tray-price {
    font-weight: 700;
    font-size: 14px;
    margin: 2px 0 0;
}

.grh-tray-rm {
    margin-left: auto;
    background: #d33f2e !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 16px;
    flex: none;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.grh-tray-empty {
    color: #5d646b;
    padding: 16px 2px;
    font-size: 15px;
}

.grh-tray-foot {
    padding: 14px 18px;
    border-top: 1px solid #e1e5e8;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.grh-tray-foot .grh-btn {
    justify-content: center;
    width: 100%;
}

/* ---------- Spec tables (reference look, site-wide) ---------- */

.grh-spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.grh-spec-table th,
.grh-spec-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e1e5e8;
    vertical-align: top;
    text-align: left;
}

.grh-spec-table th {
    width: 34%;
    color: #5d646b;
    font-weight: 600;
    background: #f4f6f7;
}

.grh-spec-table td {
    color: #232629;
}

.grh-price-t th {
    width: 34%;
}

.grh-spec-group {
    margin-top: 18px;
}

.grh-spec-group:first-of-type {
    margin-top: 4px;
}

.grh-spec-group h3 {
    color: var(--grh-secondary, #09793E);
    font-size: 17px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
}

.grh-cnt {
    background: var(--grh-secondary, #09793E);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 10px;
    padding: 1px 8px;
}

.grh-ok {
    color: var(--grh-secondary, #09793E);
    font-weight: 700;
}

/* ---------- Compare table (VS page) ---------- */

.grh-compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 15px;
}

.grh-compare-table th,
.grh-compare-table td {
    border: 1px solid #e5e5e5;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.grh-compare-table tbody th {
    background: #f7f7f7;
    width: 160px;
    white-space: nowrap;
}

.grh-compare-table thead th {
    text-align: center;
}

.grh-compare-table thead img {
    max-width: 120px;
    height: auto;
}

.grh-compare-table td.grh-winner {
    background: #e9f9ee;
    font-weight: 700;
}

.grh-score-bar {
    display: inline-block;
    width: 90px;
    height: 8px;
    background: #eee;
    border-radius: 99px;
    overflow: hidden;
    vertical-align: middle;
}

.grh-score-bar span {
    display: block;
    height: 100%;
    background: var(--grh-secondary, #09793E);
}

.grh-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}

.grh-pros,
.grh-cons {
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 14px 16px;
}

.grh-pros h4 { color: #15803d; }
.grh-cons h4 { color: #b91c1c; }

.grh-compare-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.grh-compare-picker select {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.grh-compare-picker .grh-compare-go {
    background: var(--grh-primary, #F97316);
    color: #000 !important;
    border: none !important;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 640px) {
    .grh-pros-cons { grid-template-columns: 1fr; }
    .grh-compare-table thead img { max-width: 70px; }
}

/* On phones the floating compare button sat at mid-screen height on the
   right edge (top: 44%), covering the gallery and the spec text while
   scrolling. Dock it at the bottom-right corner instead, clear of the
   main content. */
@media (max-width: 820px) {
    .grh-cmp-fab {
        top: auto;
        bottom: 16px;
        right: 12px;
        border-radius: 12px;
        width: 52px;
        min-height: 52px;
    }
}

/* "Add to Compare" checkbox for Elementor Loop Item cards — reference style
   (checkbox + text, no button), same look as the related-card checkbox.
   margin-top: auto pins it to the card bottom when the loop item is a
   vertical flex container. */
.grh-loop-cmp {
    margin-top: auto;
    border-top: 1px solid #e1e5e8;
    padding-top: 9px;
}

.grh-loop-cmp label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    cursor: pointer;
    padding: 6px 2px;
    min-height: 36px;
}

.grh-loop-cmp input {
    width: 18px;
    height: 18px;
    accent-color: var(--grh-primary, #F97316);
}
