/**
 * Cart · Checkout · Thank you — refined minimal commerce UI
 */

.comma-wc-funnel {
    --funnel-max: 1322px;
    --funnel-bg: #f4f4f5;
    --funnel-surface: #ffffff;
    --funnel-surface-elevated: #ffffff;
    --funnel-border: #e4e4e7;
    --funnel-border-soft: #f0f0f2;
    --funnel-text: #09090b;
    --funnel-muted: #71717a;
    --funnel-accent: var(--first-color, #2563eb);
    --funnel-accent-soft: color-mix(in srgb, var(--funnel-accent) 8%, #fff);
    --funnel-success: #16a34a;
    --funnel-radius: 16px;
    --funnel-radius-md: 12px;
    --funnel-radius-sm: 8px;
    --funnel-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
    --funnel-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --funnel-gap: 1.5rem;
    --funnel-pad: 1.75rem;
    --funnel-ease: cubic-bezier(0.4, 0, 0.2, 1);

    max-width: var(--funnel-max);
    margin-inline: auto;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 1.5rem) clamp(2.5rem, 6vw, 4rem);
    color: var(--funnel-text);
    font-size: 0.9375rem;
    line-height: 1.6;
    animation: commaFunnelFade 0.45s var(--funnel-ease);
}

@keyframes commaFunnelFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Steps breadcrumb ── */
.comma-funnel-steps {
    margin-bottom: 2rem;
}

.comma-funnel-steps__list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.comma-funnel-steps__item {
    flex: 1;
    max-width: 180px;
    position: relative;
}

.comma-funnel-steps__item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 11px;
    inset-inline-start: calc(50% + 14px);
    width: calc(100% - 28px);
    height: 2px;
    background: var(--funnel-border);
    z-index: 0;
}

.comma-funnel-steps__item--done:not(:last-child)::after {
    background: var(--funnel-accent);
}

.comma-funnel-steps__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--funnel-muted);
    position: relative;
    z-index: 1;
}

.comma-funnel-steps__dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--funnel-border);
    background: var(--funnel-surface);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.comma-funnel-steps__item--active .comma-funnel-steps__dot {
    border-color: var(--funnel-accent);
    background: var(--funnel-accent);
    box-shadow: 0 0 0 4px var(--funnel-accent-soft);
}

.comma-funnel-steps__item--done .comma-funnel-steps__dot {
    border-color: var(--funnel-accent);
    background: var(--funnel-accent);
    box-shadow: inset 0 0 0 3px var(--funnel-surface);
}

.comma-funnel-steps__label {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.comma-funnel-steps__item--active .comma-funnel-steps__label {
    color: var(--funnel-text);
    font-weight: 600;
}

.comma-funnel-steps__item--done .comma-funnel-steps__link:hover .comma-funnel-steps__label {
    color: var(--funnel-accent);
}

/* ── Page header ── */
.comma-wc-funnel__head {
    margin-bottom: 1.5rem;
    text-align: start;
}

.comma-wc-funnel__title {
    font-size: clamp(1.375rem, 3vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--funnel-text);
    margin: 0;
    line-height: 1.25;
}

.comma-wc-funnel__title::after {
    display: none;
}

.comma-wc-funnel__subtitle {
    margin: 0.5rem 0 0;
    font-size: 0.9375rem;
    color: var(--funnel-muted);
    font-weight: 400;
}

.comma-wc-funnel .woocommerce-content-style,
.comma-wc-funnel .comma-thankyou-card {
    background: var(--funnel-surface);
    border: 1px solid var(--funnel-border);
    border-radius: var(--funnel-radius);
    box-shadow: var(--funnel-shadow-sm);
    margin: 0;
    padding: var(--funnel-pad) !important;
}

.comma-wc-funnel .comma-cart-sidebar-box,
.comma-wc-funnel .comma-checkout-summary__inner {
    background: var(--funnel-surface-elevated);
    border: 1px solid var(--funnel-border);
    border-radius: var(--funnel-radius);
    box-shadow: var(--funnel-shadow);
    padding: var(--funnel-pad) !important;
}

/* ── Buttons ── */
.comma-wc-funnel .comma-wc-btn,
.comma-wc-funnel .actions .button,
.comma-wc-funnel .comma-update-cart,
.comma-wc-funnel .comma-apply-coupon,
.comma-wc-funnel .wc-proceed-to-checkout .checkout-button,
.comma-wc-funnel .comma-cart-proceed-btn,
.comma-wc-funnel .woocommerce-checkout #payment .button,
.comma-wc-funnel #place_order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--funnel-accent);
    color: #fff;
    border: none;
    border-radius: var(--funnel-radius-sm);
    padding: 0.8125rem 1.375rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    box-shadow: none;
    transition: transform 0.15s var(--funnel-ease), background 0.2s, opacity 0.2s;
    min-height: 48px;
    cursor: pointer;
    text-decoration: none;
}

.comma-wc-funnel .comma-wc-btn:hover,
.comma-wc-funnel .actions .button:hover,
.comma-wc-funnel .comma-cart-proceed-btn:hover,
.comma-wc-funnel #place_order:hover {
    opacity: 1;
    transform: translateY(-1px);
    color: #fff;
}

.comma-wc-funnel .comma-wc-btn--outline {
    background: var(--funnel-surface);
    color: var(--funnel-text) !important;
    border: 1px solid var(--funnel-border);
}

.comma-wc-funnel .comma-wc-btn--outline:hover {
    background: var(--funnel-bg);
    transform: none;
    color: var(--funnel-text) !important;
}

.comma-wc-funnel .comma-update-cart,
.comma-wc-funnel .comma-apply-coupon {
    background: var(--funnel-surface) !important;
    color: var(--funnel-text) !important;
    border: 1px solid var(--funnel-border) !important;
    font-weight: 500;
    min-height: 42px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.comma-wc-funnel .comma-cart-proceed-btn,
.comma-wc-funnel #place_order,
.comma-wc-funnel .wc-proceed-to-checkout .checkout-button {
    width: 100%;
}

.comma-wc-funnel .comma-cart-proceed-btn__arrow {
    display: inline-flex;
    opacity: 0.9;
}

[dir="rtl"] .comma-wc-funnel .comma-cart-proceed-btn__arrow svg {
    transform: scaleX(-1);
}

/* ═══ Cart ═══ */
.comma-wc-funnel .comma-cart-items {
    background: var(--funnel-surface);
    border: 1px solid var(--funnel-border);
    border-radius: var(--funnel-radius);
    box-shadow: var(--funnel-shadow-sm);
    padding: var(--funnel-pad);
}

.comma-wc-funnel .comma-cart-main {
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.comma-wc-funnel .comma-checkout-fields {
    background: var(--funnel-surface);
    border: 1px solid var(--funnel-border);
    border-radius: var(--funnel-radius);
    box-shadow: var(--funnel-shadow-sm);
    padding: var(--funnel-pad);
}

.comma-wc-funnel .comma-checkout-fields > .woocommerce-content-style {
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.comma-wc-funnel .comma-cart-form {
    width: 100%;
}

.comma-wc-funnel .woocommerce-cart-form__contents {
    width: 100%;
    border-collapse: collapse;
}

.comma-wc-funnel .comma-cart-table-head th {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--funnel-muted);
    padding: 0 0.75rem 1rem;
    border-bottom: 1px solid var(--funnel-border);
}

.comma-wc-funnel .woocommerce-cart-form__cart-item {
    background: transparent;
    border: none;
    transition: background 0.15s;
}

.comma-wc-funnel .woocommerce-cart-form__cart-item:hover {
    background: color-mix(in srgb, var(--funnel-bg) 60%, transparent);
}

.comma-wc-funnel .woocommerce-cart-form__cart-item td {
    padding: 1.25rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--funnel-border-soft);
}

/* button.quantity-button.button-minus,
button.quantity-button.button-plus {
    width: 25px;
    height: 40px;
    border: 1px solid var(--funnel-border);
    border-radius: var(--funnel-radius-sm);
    background: white;
    box-shadow: 0 0 5px 5px #b6b4b43d;
    margin-left: 6px;
} */

.comma-wc-funnel td.product-thumbnail {
    width: 88px;
}

.comma-wc-funnel td.product-thumbnail img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--funnel-radius-md);
    border: 1px solid var(--funnel-border);
    display: block;
}

.comma-wc-funnel .woocommerce-cart-form__cart-item .product-name a {
    color: var(--funnel-text);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    line-height: 1.4;
}

.comma-wc-funnel .woocommerce-cart-form__cart-item .product-name a:hover {
    color: var(--funnel-accent);
}

.comma-wc-funnel .woocommerce-cart-form__cart-item .variation,
.comma-wc-funnel .woocommerce-cart-form__cart-item dl {
    font-size: 0.8125rem;
    color: var(--funnel-muted);
    margin-top: 0.25rem;
}

.comma-wc-funnel .woocommerce-cart-form__cart-item .product-price,
.comma-wc-funnel .woocommerce-cart-form__cart-item .product-subtotal {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--funnel-text);
    white-space: nowrap;
}

.comma-wc-funnel a.comma-cart-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--funnel-bg);
    color: var(--funnel-muted) !important;
    font-size: 1.25rem;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.comma-wc-funnel a.comma-cart-remove:hover {
    background: #fef2f2;
    color: #dc2626 !important;
}

.comma-wc-funnel .quantity .qty {
    max-width: 120px;
    text-align: center;
    padding: 0.5rem;
    border: 1px solid var(--funnel-border);
    border-radius: var(--funnel-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.comma-wc-funnel .comma-cart-coupon {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: stretch;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--funnel-border);
}

.comma-wc-funnel .comma-cart-coupon .input-text {
    flex: 1;
    min-width: 12rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--funnel-border);
    border-radius: var(--funnel-radius-sm);
    font-size: 0.875rem;
}

.comma-wc-funnel .comma-cart-actions-row .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
    padding-top: 1rem;
}

.comma-wc-funnel .comma-cart-sidebar-box {
    position: sticky;
    top: 6rem;
}

.comma-wc-funnel .cart_totals h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--funnel-text);
    margin: 0 auto;
    width: max-content;
    letter-spacing: -0.02em;
}

table.shop_table.shop_table_responsive {
    margin: 0 auto;
    width: stretch;
}

.comma-wc-funnel .cart_totals h2::before {
    display: none;
}

.comma-wc-funnel .cart_totals .shop_table th,
.comma-wc-funnel .cart_totals .shop_table td {
    padding: 0.625rem 0;
    font-size: 0.875rem;
    border: none;
}

.comma-wc-funnel .cart_totals .shop_table th {
    color: var(--funnel-muted);
    font-weight: 500;
}

.comma-wc-funnel .cart_totals .shop_table td {
    text-align: end;
    font-weight: 600;
    color: var(--funnel-text);
}

.comma-wc-funnel .cart_totals .order-total th,
.comma-wc-funnel .cart_totals .order-total td {
    font-size: 1.125rem;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--funnel-border);
    color: var(--funnel-text);
}

.comma-wc-funnel .wc-proceed-to-checkout {
    margin-top: 1.5rem;
}

/* ═══ Checkout ═══ */
.comma-wc-funnel .woocommerce-billing-fields > h3,
.comma-wc-funnel .woocommerce-shipping-fields > h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--funnel-border-soft);
    color: var(--funnel-text);
}

.comma-wc-funnel .comma-checkout-form .form-row {
    margin-bottom: 1.125rem;
}

.comma-wc-funnel .comma-checkout-form .form-row label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--funnel-muted);
    margin-bottom: 0.375rem;
}

.comma-wc-funnel .comma-checkout-form .form-row input.input-text,
.comma-wc-funnel .comma-checkout-form .form-row textarea,
.comma-wc-funnel .comma-checkout-form .form-row select {
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--funnel-border);
    border-radius: var(--funnel-radius-sm);
    font-size: 0.9375rem;
    background: var(--funnel-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.comma-wc-funnel .comma-checkout-form .form-row input.input-text:focus,
.comma-wc-funnel .comma-checkout-form .form-row textarea:focus,
.comma-wc-funnel .comma-checkout-form .form-row select:focus {
    outline: none;
    border-color: var(--funnel-accent);
    box-shadow: 0 0 0 3px var(--funnel-accent-soft);
}

.comma-wc-funnel .comma-checkout-review-heading {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1.25rem !important;
    padding: 0;
    border: none;
    color: var(--funnel-text);
}

.comma-wc-funnel .woocommerce-checkout-review-order-table {
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.comma-wc-funnel .woocommerce-checkout-review-order-table th,
.comma-wc-funnel .woocommerce-checkout-review-order-table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--funnel-border-soft);
    font-size: 0.875rem;
}

.comma-wc-funnel .woocommerce-checkout-review-order-table .order-total th,
.comma-wc-funnel .woocommerce-checkout-review-order-table .order-total td {
    font-size: 1.0625rem;
    font-weight: 700;
    border-bottom: none;
    padding-top: 1rem;
}

.comma-wc-funnel .woocommerce-checkout #payment {
    background: var(--funnel-bg);
    border: 1px solid var(--funnel-border);
    border-radius: var(--funnel-radius-md);
    padding: 1.25rem;
    margin-top: 1rem;
}

.comma-wc-funnel .woocommerce-checkout #payment ul.payment_methods li {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--funnel-border-soft);
}

.comma-wc-funnel .woocommerce-checkout #payment ul.payment_methods li:last-child {
    border-bottom: none;
}

.comma-wc-funnel .woocommerce-info,
.comma-wc-funnel .woocommerce-message {
    border-radius: var(--funnel-radius-sm);
    border: 1px solid var(--funnel-border);
    background: var(--funnel-bg);
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ═══ Thank you ═══ */
.comma-wc-funnel.comma-thankyou-page {
    max-width: 800px;
}

.comma-wc-funnel .comma-thankyou-card--hero {
    border: none !important;
    background: linear-gradient(165deg, var(--funnel-accent-soft) 0%, var(--funnel-surface) 55%) !important;
    box-shadow: var(--funnel-shadow) !important;
    text-align: center;
    padding: clamp(2rem, 5vw, 3rem) var(--funnel-pad) !important;
}

.comma-wc-funnel .comma-thankyou-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.comma-wc-funnel .comma-thankyou-received__ring {
    margin-bottom: 0.25rem;
}

.comma-wc-funnel .comma-thankyou-received__circle {
    stroke: var(--funnel-border);
    fill: none;
}

.comma-wc-funnel .comma-thankyou-received__check {
    stroke: var(--funnel-success);
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: commaCheckDraw 0.6s var(--funnel-ease) 0.2s forwards;
}

@keyframes commaCheckDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.comma-wc-funnel .comma-thankyou-received {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

.comma-wc-funnel .comma-thankyou-received__text {
    font-size: clamp(1.0625rem, 2.5vw, 1.25rem);
    font-weight: 600;
    color: var(--funnel-text);
    line-height: 1.5;
    max-width: 26rem;
}

.comma-wc-funnel .comma-thankyou-hero__order {
    margin: 0;
    font-size: 0.875rem;
    color: var(--funnel-muted);
}

.comma-wc-funnel .comma-thankyou-hero__order strong {
    color: var(--funnel-text);
    font-weight: 700;
}

.comma-wc-funnel .comma-thankyou-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 0;
    list-style: none;
}

.comma-wc-funnel .comma-thankyou-meta li {
    background: var(--funnel-surface);
    border: 1px solid var(--funnel-border);
    border-radius: var(--funnel-radius-md);
    padding: 1rem 1.125rem;
    box-shadow: var(--funnel-shadow-sm);
}

.comma-wc-funnel .comma-thankyou-meta__label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--funnel-muted);
    margin-bottom: 0.35rem;
}

.comma-wc-funnel .comma-thankyou-meta li strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--funnel-text);
}

.comma-wc-funnel .comma-thankyou-meta__total {
    color: var(--funnel-accent) !important;
    font-size: 1.0625rem !important;
}

.comma-wc-funnel .comma-thankyou-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.comma-wc-funnel .comma-thankyou-actions .comma-wc-btn {
    min-width: 10rem;
}

.comma-wc-funnel .comma-thankyou-details .woocommerce-order-details,
.comma-wc-funnel .comma-thankyou-details .woocommerce-customer-details {
    border-radius: var(--funnel-radius);
    border: 1px solid var(--funnel-border);
    box-shadow: var(--funnel-shadow-sm);
    padding: var(--funnel-pad) !important;
}

.comma-wc-funnel .woocommerce-order-details h2,
.comma-wc-funnel .woocommerce-customer-details h2 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0 0 1rem !important;
}

.comma-wc-funnel .woocommerce-order-details h2::after,
.comma-wc-funnel .woocommerce-customer-details h2::after {
    display: none;
}

.comma-wc-funnel .woocommerce-table--order-details th,
.comma-wc-funnel .woocommerce-table--order-details td {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--funnel-border-soft);
    font-size: 0.875rem;
}

.comma-wc-funnel .wc-empty-cart-message {
    text-align: center;
    padding: 2rem;
    color: var(--funnel-muted);
    background: var(--funnel-surface);
    border: 1px dashed var(--funnel-border);
    border-radius: var(--funnel-radius);
}

.comma-wc-elementor-banner {
    margin-bottom: var(--funnel-gap);
}

/* ── Mobile cart cards ── */
@media (max-width: 991px) {
    .comma-funnel-steps__label {
        font-size: 0.6875rem;
    }

    .comma-wc-funnel .comma-cart-table-head {
        display: none;
    }

    .comma-wc-funnel .woocommerce-cart-form__cart-item {
        display: grid;
        grid-template-columns: 72px 1fr auto;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "thumb name remove"
            "thumb price price"
            "thumb qty subtotal";
        gap:0.75rem;
        padding: 1.25rem 0;
        border-bottom: 1px solid var(--funnel-border);
    }

    .comma-wc-funnel .woocommerce-cart-form__cart-item td {
        display: block;
        padding: 0;
        border: none;
    }

    .comma-wc-funnel .woocommerce-cart-form__cart-item td::before {
        display: none;
    }

    .comma-wc-funnel td.product-thumbnail {
        grid-area: thumb;
        align-self: start;
    }

    .comma-wc-funnel td.product-name {
        grid-area: name;
        padding-inline-end: 2rem;
    }

    .comma-wc-funnel td.product-remove {
        grid-area: remove;
        justify-self: end;
        align-self: start;
    }

    .comma-wc-funnel td.product-price {
        grid-area: price;
        font-size: 0.8125rem;
        color: var(--funnel-muted);
    }

    .comma-wc-funnel td.product-price::before {
        content: attr(data-title) ": ";
        font-weight: 500;
    }

    .comma-wc-funnel td.product-quantity {
        grid-area: qty;
    }

    .comma-wc-funnel td.product-subtotal {
        grid-area: subtotal;
        justify-self: end;
        font-weight: 700;
    }

    .comma-wc-funnel .comma-cart-sidebar-box,
    .comma-wc-funnel .comma-checkout-summary__inner {
        position: static;
        margin-top: 1rem;
    }
}

@media (min-width: 992px) {
    .comma-wc-funnel .comma-cart-row {
        align-items: flex-start;
    }

    .comma-wc-funnel .comma-thankyou-details {
        display: flex;
        flex-wrap: wrap;
        gap: var(--funnel-gap);
    }

    .comma-wc-funnel .comma-thankyou-details .woocommerce-order-details,
    .comma-wc-funnel .comma-thankyou-details .woocommerce-customer-details {
        flex: 1 1 calc(50% - 0.75rem);
        max-width: calc(50% - 0.75rem);
    }
}
