.gbhp-grade-panel {
    margin-top: 8px;
    direction: rtl;
    text-align: right;
}

.gbhp-grade-picker {
    margin-bottom: 16px;
    padding: 14px 16px 16px;
    border: 1px solid #eceff1;
    border-radius: 16px;
    background: #fff;
}

.gbhp-grade-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 13px;
    color: #37474f;
}

.gbhp-grade-pills {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

.gbhp-grade-panel .gbhp-grade-pill {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 16px;
    border: 1px solid #eceff1;
    background: #fafafa;
    border-radius: 999px !important;
    color: #546e7a;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
}

.gbhp-grade-pill:hover {
    border-color: #c8e6c9;
    color: #2e7d32;
    background: #fff;
}

.gbhp-grade-pill.is-active {
    border-color: #81c784;
    background: #f1f8e9;
    color: #2e7d32;
}

.gbhp-grade-table-wrap {
    border: 1px solid #eceff1;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.gbhp-grade-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    table-layout: fixed;
}

.gbhp-grade-table th,
.gbhp-grade-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eceff1;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.gbhp-grade-table th:nth-child(1),
.gbhp-grade-table td:nth-child(1) {
    width: 32%;
    text-align: right;
}

.gbhp-grade-table th:nth-child(2),
.gbhp-grade-table td:nth-child(2) {
    width: 40%;
}

.gbhp-grade-table th:nth-child(3),
.gbhp-grade-table td:nth-child(3) {
    width: 28%;
    padding-left: 8px;
    padding-right: 8px;
}

.gbhp-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    height: 28px;
}

.gbhp-qty button {
    width: 24px;
    height: 28px;
    border: 0;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.gbhp-qty input {
    width: 36px;
    height: 28px;
    border: 0;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    padding: 0;
    -moz-appearance: textfield;
}

.gbhp-qty input::-webkit-outer-spin-button,
.gbhp-qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gbhp-inquiry-note {
    margin: 10px 0 0;
    color: #607d8b;
    font-size: 13px;
    line-height: 1.8;
}

.gbhp-grade-panel .gbhp-grade-table thead th {
    background: #fafafa;
    font-weight: 600;
    font-size: 13px;
    color: #37474f;
}

.gbhp-grade-table tbody tr:last-child td {
    border-bottom: 0;
}

.gbhp-grade-table td:first-child,
.gbhp-grade-table th:first-child {
    text-align: right;
}

.gbhp-price {
    font-variant-numeric: tabular-nums;
    color: #263238;
    font-weight: 600;
}

.gbhp-grade-message {
    color: #c62828;
    background: #ffebee;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 12px;
}

.gbhp-grade-message.is-success {
    color: #2e7d32;
    background: #e8f5e9;
}

.gbhp-grade-add {
    width: 100%;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #43a047 !important;
    border: 0 !important;
    color: #fff !important;
    border-radius: 12px !important;
    min-height: 52px;
    font-weight: 800;
    cursor: pointer;
    position: relative;
}

.gbhp-grade-add:disabled {
    opacity: 1;
    cursor: wait;
}

.gbhp-grade-add.is-loading .gbhp-grade-add-label {
    opacity: 0.85;
}

.gbhp-grade-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gbhp-grade-spin .7s linear infinite;
}

.gbhp-grade-add.is-loading .gbhp-grade-spinner {
    display: inline-block;
}

@keyframes gbhp-grade-spin {
    to {
        transform: rotate(360deg);
    }
}

.gbhp-inquiry-link {
    display: block;
    text-align: center;
    margin-top: 10px;
}

.gbhp-grade-product .summary > p.price,
.gbhp-grade-product .wd-single-price {
    display: none;
}

@media (max-width: 767px) {
    .gbhp-grade-panel .gbhp-grade-pills {
        flex-wrap: wrap;
    }

    .gbhp-grade-panel .gbhp-grade-pill {
        flex: 1 1 calc(50% - 8px);
        min-width: calc(50% - 8px);
        max-width: calc(50% - 8px);
        box-sizing: border-box;
        padding: 8px 12px;
    }

    .gbhp-grade-table th,
    .gbhp-grade-table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .gbhp-qty input {
        width: 32px;
    }
}

/* Keep recommendations visually tied to the purchase controls on product pages. */
.single-product .gbhp-product-suggestions {
    max-width: 520px;
    margin: 16px 0 4px;
    padding: 14px;
    border-color: #dce7d9;
    border-radius: 17px;
    background: linear-gradient(135deg, #f2f7ee 0%, #fffaf0 100%);
    box-shadow: 0 10px 28px rgba(29, 74, 56, .07);
}

.single-product .gbhp-suggestions-heading {
    margin-bottom: 10px;
}

.single-product .gbhp-suggestions-heading h2 {
    font-size: 15px;
    line-height: 1.55;
}

.single-product .gbhp-suggestions-heading p {
    margin-top: 2px;
    font-size: 11px;
}

.single-product .gbhp-suggestions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.single-product .gbhp-suggestion-card {
    gap: 9px;
    padding: 8px;
    border-radius: 12px;
}

.single-product .gbhp-suggestion-image {
    flex-basis: 58px;
    width: 58px;
    height: 58px;
    border-radius: 10px;
}

.single-product .gbhp-suggestion-name,
.single-product .gbhp-suggestion-price {
    font-size: 11px;
}

@media (max-width: 767px) {
    .single-product .gbhp-product-suggestions {
        margin: 12px 0 2px;
        padding: 12px;
    }

    .single-product .gbhp-suggestions-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Compact the selector and keep the cart action text clear against the green button. */
.gbhp-grade-panel {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.gbhp-grade-picker {
    margin-bottom: 12px;
    padding: 10px 12px 12px;
    border-radius: 12px;
}

.gbhp-grade-label {
    margin-bottom: 8px;
}

.gbhp-grade-pills {
    gap: 6px;
}

.gbhp-grade-panel .gbhp-grade-pill {
    padding: 8px 12px;
    line-height: 1.4;
}

.gbhp-grade-table th,
.gbhp-grade-table td {
    padding: 6px 9px;
}

.gbhp-grade-add {
    min-height: 46px;
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 10px !important;
    background: #1d4a38 !important;
    color: #fff !important;
    font-family: inherit;
    font-size: 14px !important;
    line-height: 1.4;
}

.gbhp-grade-add:hover:not(:disabled) {
    background: #173c2e !important;
}

.gbhp-grade-panel .gbhp-grade-add,
.gbhp-grade-panel .gbhp-grade-add .gbhp-grade-add-label,
.gbhp-grade-panel .gbhp-grade-add > span {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    opacity: 1 !important;
    visibility: visible;
}

@media (max-width: 767px) {
    .gbhp-grade-table th,
    .gbhp-grade-table td {
        padding: 8px 6px;
    }

    .gbhp-grade-add {
        min-height: 44px;
        font-size: 13px !important;
    }
}

/* Free-delivery progress shown with the product's purchase options. */
.gbhp-free-shipping {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    margin: 14px 0;
    padding: 13px 14px;
    direction: rtl;
    text-align: right;
    border: 1px solid #dce8dd;
    border-radius: 14px;
    background: linear-gradient(115deg, #f1f7ef 0%, #fbf8ed 100%);
    color: #244b3a;
    font-family: inherit;
}

.gbhp-free-shipping-icon {
    display: inline-flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #1d4a38;
    color: #fff;
}

.gbhp-free-shipping-icon svg {
    display: block;
    width: 21px;
    height: 21px;
}

.gbhp-free-shipping-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.gbhp-free-shipping-title {
    color: #1d4a38;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.7;
}

.gbhp-free-shipping-title .woocommerce-Price-amount {
    white-space: nowrap;
}

.gbhp-free-shipping-message {
    color: #58685d;
    font-size: 12px;
    line-height: 1.8;
}

.gbhp-free-shipping-track {
    display: block;
    width: 100%;
    height: 6px;
    margin-top: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(29, 74, 56, .12);
}

.gbhp-free-shipping-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #d29b3d, #1d7652);
    transition: width .28s ease;
}

.gbhp-free-shipping.is-qualified {
    border-color: #b8d7c0;
    background: linear-gradient(115deg, #eaf6ed 0%, #f4f8ed 100%);
}

.gbhp-free-shipping.is-qualified .gbhp-free-shipping-track > span {
    background: #1d7652;
}

@media (max-width: 767px) {
    .gbhp-free-shipping {
        gap: 10px;
        margin: 12px 0;
        padding: 11px 12px;
        border-radius: 12px;
    }

    .gbhp-free-shipping-icon {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .gbhp-free-shipping-title {
        font-size: 12px;
    }

    .gbhp-free-shipping-message {
        font-size: 11px;
    }
}

.gbhp-product-suggestions {
    clear: both;
    width: 100%;
    box-sizing: border-box;
    margin: 22px 0 8px;
    padding: 18px;
    direction: rtl;
    text-align: right;
    border: 1px solid #e2e9df;
    border-radius: 18px;
    background: linear-gradient(135deg, #f5f8ef 0%, #fffaf0 100%);
    font-family: inherit;
}

.gbhp-suggestions-heading {
    margin-bottom: 13px;
}

.gbhp-suggestions-kicker {
    display: block;
    margin-bottom: 4px;
    color: #bd8730;
    font-size: 11px;
    font-weight: 800;
}

.gbhp-suggestions-heading h2 {
    margin: 0;
    color: #1d4a38;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.6;
}

.gbhp-suggestions-heading p {
    margin: 3px 0 0;
    color: #69736a;
    font-size: 12px;
    line-height: 1.8;
}

.gbhp-suggestions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.gbhp-suggestion-card {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 10px;
    border: 1px solid #e9ece5;
    border-radius: 13px;
    background: #fff;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.gbhp-suggestion-card:hover {
    transform: translateY(-2px);
    border-color: #cbdccf;
    box-shadow: 0 8px 20px rgba(29, 74, 56, .09);
}

.gbhp-suggestion-image {
    display: block;
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    overflow: hidden;
    border-radius: 10px;
    background: #f5f5f0;
}

.gbhp-suggestion-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gbhp-suggestion-info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
}

.gbhp-suggestion-name {
    display: -webkit-box;
    width: 100%;
    overflow: hidden;
    color: #243c31;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.7;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.gbhp-suggestion-price {
    color: #1d4a38;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.6;
}

.gbhp-suggestion-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    color: #a86e20;
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
}

.gbhp-suggestion-link:hover,
.gbhp-suggestion-name:hover {
    color: #1d7652;
}

.gbhp-suggestion-action {
    min-height: 30px;
    padding: 5px 10px;
    border: 0;
    border-radius: 999px;
    background: #1d4a38;
    color: #fff !important;
    line-height: 1.5;
    transition: background .18s ease, transform .18s ease;
}

.gbhp-suggestion-action:hover {
    transform: translateY(-1px);
    background: #28664c;
    color: #fff !important;
}

.gbhp-suggestions-assistant {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid #e2e9df;
    color: #69736a;
    font-size: 12px;
    line-height: 1.8;
}

.gbhp-suggestions-assistant button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid #d8e5d7;
    border-radius: 999px;
    background: #fff;
    color: #1d4a38;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.gbhp-suggestions-assistant button:hover {
    border-color: #1d4a38;
    background: #1d4a38;
    color: #fff;
}

.gbhp-recommendation-toast[hidden] {
    display: none !important;
}

.gbhp-recommendation-toast {
    position: fixed;
    z-index: 999970;
    right: 22px;
    bottom: 22px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto 30px;
    align-items: center;
    gap: 10px;
    width: min(470px, calc(100vw - 28px));
    padding: 12px;
    border: 1px solid #dbe7d9;
    border-radius: 16px;
    background: #fffdf7;
    box-shadow: 0 14px 42px rgba(20, 47, 32, .18);
    direction: rtl;
    font-family: inherit;
    animation: gbhp-toast-in .2s ease-out;
}

.gbhp-recommendation-toast-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e7f2e6;
    color: #1d7652;
    font-size: 17px;
    font-weight: 900;
}

.gbhp-recommendation-toast-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
    color: #69736a;
    font-size: 11px;
    line-height: 1.65;
}

.gbhp-recommendation-toast-copy strong {
    color: #1d4a38;
    font-size: 12px;
}

.gbhp-recommendation-toast-view {
    min-height: 32px;
    padding: 6px 10px;
    border: 0;
    border-radius: 999px;
    background: #1d4a38;
    color: #fff;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.gbhp-recommendation-toast-view:hover {
    background: #28664c;
}

.gbhp-recommendation-toast-close {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #657269;
    font: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.gbhp-recommendation-toast-close:hover {
    background: #eef3eb;
    color: #1d4a38;
}

@keyframes gbhp-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 767px) {
    .single-product .gbhp-grade-column-empty-mobile { display: none !important; }

    .gbhp-product-suggestions {
        margin: 18px 0 6px;
        padding: 14px;
        border-radius: 15px;
    }

    .gbhp-suggestions-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .gbhp-suggestion-card {
        gap: 10px;
        padding: 8px;
    }

    .gbhp-suggestion-image {
        flex-basis: 62px;
        width: 62px;
        height: 62px;
    }

    .gbhp-suggestions-assistant {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .gbhp-recommendation-toast {
        right: 12px;
        bottom: calc(90px + env(safe-area-inset-bottom));
        grid-template-columns: 30px minmax(0, 1fr) 28px;
        gap: 8px;
        width: calc(100vw - 24px);
        padding: 10px;
        border-radius: 14px;
    }

    .gbhp-recommendation-toast-mark {
        width: 28px;
        height: 28px;
    }

    .gbhp-recommendation-toast-view {
        grid-column: 2;
        justify-self: start;
        min-height: 29px;
        margin-top: 3px;
    }

    .gbhp-recommendation-toast-close {
        grid-column: 3;
        grid-row: 1;
        align-self: start;
    }
}

/* Product page refinements: clarify grade pricing and keep the product image compact. */
.gbhp-grade-rationale {
    margin: 9px 0 12px;
    padding: 9px 11px;
    border: 1px solid #e8e8dc;
    border-right: 3px solid #bd813c;
    border-radius: 10px;
    background: linear-gradient(105deg, #f5f7ef 0%, #fbf6e9 100%);
    color: #58675c;
    font-size: 11px;
    line-height: 1.9;
}

.single-product .woocommerce-product-gallery__image img,
.single-product .wd-single-product-images img,
.single-product .wd-product-images img,
.single-product .elementor-widget-woocommerce-product-images img {
    width: auto;
    max-width: 100%;
    max-height: min(58vh, 420px);
    margin-inline: auto;
    object-fit: contain;
}

.single-product .woocommerce-product-gallery,
.single-product .wd-single-product-images,
.single-product .wd-product-images,
.single-product .elementor-widget-woocommerce-product-images {
    min-height: 0;
    align-self: start;
}

.single-product .woocommerce-product-gallery__image,
.single-product .wd-product-images .wd-carousel-item,
.single-product .wd-single-product-images .wd-carousel-item,
.single-product .elementor-widget-woocommerce-product-images .woocommerce-product-gallery__image {
    min-height: 0;
    max-height: min(62vh, 450px);
    display: grid;
    place-items: center;
    overflow: hidden;
}

@media (max-width: 767px) {
    .gbhp-grade-rationale {
        margin: 8px 0 10px;
        padding: 8px 9px;
        font-size: 10px;
    }

    .single-product .woocommerce-product-gallery__image img,
    .single-product .wd-single-product-images img,
    .single-product .wd-product-images img,
    .single-product .elementor-widget-woocommerce-product-images img {
        max-height: min(38vh, 285px);
    }

    .single-product .woocommerce-product-gallery__image,
    .single-product .wd-product-images .wd-carousel-item,
    .single-product .wd-single-product-images .wd-carousel-item,
    .single-product .elementor-widget-woocommerce-product-images .woocommerce-product-gallery__image {
        max-height: min(42vh, 310px);
    }
}
