/* =====================================================
   FH CART PAGE — uses theme brand CSS variables
   ===================================================== */
.fh-is-cart-page .wrap.page-wrap {
    max-width: 1100px;
    padding-inline: 20px;
    box-sizing: border-box;
}

.fh-is-cart-page .woocommerce-notices-wrapper {
    margin-bottom: 16px;
}

.fh-is-cart-page .woocommerce-notices-wrapper:empty {
    display: none;
    margin: 0;
}

.fh-is-cart-page .woocommerce-notices-wrapper .woocommerce-message,
.fh-is-cart-page .woocommerce-notices-wrapper .woocommerce-info,
.fh-is-cart-page .woocommerce-notices-wrapper .woocommerce-error {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 8px;
    border: none;
    outline: none;
    box-shadow: none;
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    list-style: none;
}

.fh-is-cart-page .woocommerce-notices-wrapper .woocommerce-message li,
.fh-is-cart-page .woocommerce-notices-wrapper .woocommerce-info li,
.fh-is-cart-page .woocommerce-notices-wrapper .woocommerce-error li {
    margin: 0;
    padding: 0;
    list-style: none;
    flex: 1;
}

.fh-is-cart-page .woocommerce-notices-wrapper .woocommerce-message {
    background: rgba(var(--brand-rgb), .06);
}

.fh-is-cart-page .woocommerce-notices-wrapper .woocommerce-info {
    background: var(--brand-light);
}

.fh-is-cart-page .woocommerce-notices-wrapper .woocommerce-error {
    background: #fff6f5;
    color: #c0392b;
}

.fh-is-cart-page .woocommerce-notices-wrapper .woocommerce-message::before,
.fh-is-cart-page .woocommerce-notices-wrapper .woocommerce-info::before,
.fh-is-cart-page .woocommerce-notices-wrapper .woocommerce-error::before {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    inset: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.25em;
    height: 1.25em;
    margin: 0;
    padding: 0;
    line-height: 1;
    color: var(--brand);
}

.fh-is-cart-page .woocommerce-notices-wrapper .woocommerce-error::before {
    color: #ea2816;
}

.fh-cart-page {
    padding: 24px 0 48px;
    background: var(--soft);
}

.fh-cart-page__head {
    margin-bottom: 20px;
    gap: 12px;
    padding-inline: 4px;
}

.fh-cart-page__title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: var(--ink);
}

.fh-cart-page__count {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(var(--brand-rgb), .1);
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
}

.fh-cart-cta {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    direction: rtl;
}

.fh-cart-cta__text {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.7;
    color: var(--ink);
    text-align: center;
}

.fh-cart-cta__track {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: #eee;
    overflow: visible;
    direction: rtl;
}

.fh-cart-cta__fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--brand);
    animation: fh-cart-cta-fill 1.8s ease-out .35s forwards;
}

.fh-cart-cta__truck {
    position: absolute;
    top: 50%;
    right: 0;
    left: auto;
    transform: translate(50%, -50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--brand-rgb), .3);
    animation: fh-cart-cta-truck 1.8s ease-out .35s forwards;
}

.fh-cart-cta__truck svg {
    width: 14px;
    height: 14px;
    transform: scaleX(-1);
}

@keyframes fh-cart-cta-fill {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes fh-cart-cta-truck {
    from { right: 0; }
    to { right: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .fh-cart-cta__fill {
        width: 100%;
        animation: none;
    }

    .fh-cart-cta__truck {
        right: 100%;
        animation: none;
    }
}

.fh-cart-shipping {
    margin-bottom: 20px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.fh-cart-shipping__text {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.fh-cart-shipping__bar {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: #eee;
    overflow: visible;
    direction: rtl;
    --fh-ship-pct: 0;
}

.fh-cart-shipping__fill {
    display: block;
    height: 100%;
    width: calc(var(--fh-ship-pct) * 1%);
    border-radius: inherit;
    background: var(--brand);
    transition: width .35s ease;
}

.fh-cart-shipping__truck {
    position: absolute;
    top: 50%;
    right: calc(var(--fh-ship-pct) * 1%);
    left: auto;
    transform: translate(50%, -50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--brand-rgb), .3);
}

.fh-cart-shipping__truck svg {
    width: 14px;
    height: 14px;
    transform: scaleX(-1);
}

.fh-cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.fh-cart-main {
    min-width: 0;
}

.fh-cart-table {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.fh-cart-table__head,
.fh-cart-row {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) .8fr 1fr .8fr;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
}

.fh-cart-table__head {
    background: #fafafa;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
}

.fh-cart-row {
    border-bottom: 1px solid var(--line);
}

.fh-cart-row:last-child {
    border-bottom: 0;
}

.fh-cart-row__product {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.fh-cart-row__thumb {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--soft);
    border: 1px solid var(--line);
}

.fh-cart-row__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fh-cart-row__name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.4;
}

.fh-cart-row__name a {
    color: inherit;
    text-decoration: none;
}

.fh-cart-row__remove {
    flex-shrink: 0;
    margin-inline-start: auto;
}

.fh-cart-row__name dl {
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

.fh-cart-row__price,
.fh-cart-row__total {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
}

.fh-cart-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

.fh-cart-qty.is-static {
    min-width: 36px;
    justify-content: center;
    padding: 8px 12px;
    font-weight: 700;
}

.fh-cart-qty__btn {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--brand);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}

.fh-cart-qty__btn:hover {
    background: var(--brand-light);
}

.fh-cart-qty__input {
    width: 42px;
    height: 34px;
    border: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    background: transparent;
    -moz-appearance: textfield;
}

.fh-cart-qty__input::-webkit-outer-spin-button,
.fh-cart-qty__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fh-cart-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s ease, background-color .2s ease;
}

.fh-cart-remove:hover {
    color: #c0392b;
    background: #fff0f0;
}

.fh-cart-remove svg {
    width: 18px;
    height: 18px;
}

.fh-cart-actions {
    margin-top: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.fh-cart-update {
    display: none;
}

.fh-cart-continue {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    color: var(--brand);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.fh-cart-continue svg {
    width: 16px;
    height: 16px;
}

.fh-cart-continue--summary {
    display: none;
    margin-top: 12px;
}

.fh-cart-summary__card {
    position: sticky;
    top: 80px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.fh-cart-summary__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
}

.fh-cart-summary__title svg {
    width: 20px;
    height: 20px;
    color: var(--brand);
}

.fh-cart-summary__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--ink);
}

.fh-cart-summary__row small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
}

.fh-cart-summary__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    font-size: 15px;
    font-weight: 800;
}

.fh-cart-summary__total strong {
    font-size: 24px;
    color: var(--brand);
}

.fh-cart-checkout {
    width: 100%;
    height: 48px;
    gap: 8px;
    border-radius: 10px;
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #fff !important;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
}

.fh-cart-checkout:hover {
    background: var(--brand-dark) !important;
    border-color: var(--brand-dark) !important;
    color: #fff !important;
}

.fh-cart-checkout svg {
    width: 18px;
    height: 18px;
}

.fh-cart-empty {
    padding: 48px 24px;
    text-align: center;
    border: 1px dashed var(--brand-border);
    border-radius: 12px;
    background: #fff;
}

.fh-cart-empty p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 16px;
}

.fh-cart-empty .fh-cart-checkout {
    max-width: 280px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .fh-cart-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .fh-cart-summary__card {
        position: static;
    }
}

@media (max-width: 640px) {
    .fh-is-cart-page .wrap.page-wrap {
        padding-left: 12px;
        padding-right: 12px;
    }

    .fh-cart-page {
        padding: 12px 0 28px;
    }

    .fh-cart-page__head {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
        margin-bottom: 14px;
    }

    .fh-cart-page__title {
        font-size: 22px;
    }

    .fh-cart-cta {
        padding: 12px 14px;
        margin-bottom: 14px;
    }

    .fh-cart-cta__text {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .fh-cart-shipping {
        padding: 14px 12px;
        margin-bottom: 14px;
    }

    .fh-cart-shipping__text {
        font-size: 13px;
        line-height: 1.5;
    }

    .fh-cart-shipping__bar {
        margin-top: 10px;
    }

    .fh-cart-table {
        border-radius: 10px;
    }

    .fh-cart-table__head {
        display: none;
    }

    .fh-cart-row {
        grid-template-columns: 1fr 1fr 1fr;
        grid-template-areas:
            "product product product"
            "price qty total";
        gap: 10px 8px;
        position: relative;
        padding: 14px 12px 16px;
    }

    .fh-cart-row__product {
        grid-area: product;
        align-items: flex-start;
        gap: 10px;
    }

    .fh-cart-row__thumb {
        width: 56px;
        height: 56px;
    }

    .fh-cart-row__name {
        font-size: 13px;
    }

    .fh-cart-row__price {
        grid-area: price;
    }

    .fh-cart-row__qty {
        grid-area: qty;
        justify-self: center;
    }

    .fh-cart-row__total {
        grid-area: total;
        justify-self: end;
        text-align: end;
    }

    .fh-cart-row__remove {
        position: static;
        margin-inline-start: auto;
        align-self: center;
    }

    .fh-cart-row__price,
    .fh-cart-row__qty,
    .fh-cart-row__total {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .fh-cart-row__qty {
        align-items: center;
    }

    .fh-cart-row__total {
        align-items: flex-end;
    }

    .fh-cart-row__price::before,
    .fh-cart-row__qty::before,
    .fh-cart-row__total::before {
        display: block;
        font-size: 11px;
        color: var(--muted);
        font-weight: 600;
    }

    .fh-cart-row__price::before { content: 'السعر'; }
    .fh-cart-row__qty::before { content: 'الكمية'; }
    .fh-cart-row__total::before { content: 'المجموع'; }

    .fh-cart-actions {
        display: none;
    }

    .fh-cart-continue--summary {
        display: inline-flex;
        width: 100%;
        margin: 12px 0 0;
        justify-content: center;
        padding: 10px 0;
    }

    .fh-cart-summary__card {
        padding: 16px;
        border-radius: 10px;
    }

    .fh-cart-summary__title {
        font-size: 16px;
        margin-bottom: 14px;
    }

    .fh-cart-summary__total strong {
        font-size: 20px;
    }

    .fh-cart-checkout {
        height: 50px;
        font-size: 14px;
    }

    .fh-cart-empty {
        padding: 32px 16px;
    }
}
