/* ============================================
   CUSTOM CART PAGE — GlucoseGear
   ============================================ */

.gg-cart-page {
    padding: 2rem 0 3rem;
    background: var(--gg-off-white);
}

.gg-cart-page__title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

/* ---- Layout: items + summary ---- */
.gg-cart-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

/* ============================================
   CART ITEMS
   ============================================ */
.gg-cart-items {
    background: var(--gg-white);
    border-radius: var(--gg-radius-lg);
    box-shadow: var(--gg-shadow-sm);
    padding: 1.5rem;
}

/* Individual item */
.gg-cart-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--gg-light-gray);
}

.gg-cart-item:first-child {
    padding-top: 0;
}

.gg-cart-item:last-of-type {
    border-bottom: none;
}

/* Thumbnail */
.gg-cart-item__image {
    flex-shrink: 0;
    width: 100px;
}

.gg-cart-item__image a {
    display: block;
}

.gg-cart-item__image img {
    width: 100%;
    height: auto;
    border-radius: var(--gg-radius);
    background: var(--gg-white);
    object-fit: contain;
    aspect-ratio: 1 / 1;
    padding: 0.5rem;
}

/* Details column */
.gg-cart-item__details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gg-cart-item__info {
    margin-bottom: 0.75rem;
}

.gg-cart-item__name {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gg-text);
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 0.2rem;
}

.gg-cart-item__name:hover {
    color: var(--gg-primary);
}

.gg-cart-item__unit-price {
    font-size: 0.8125rem;
    color: var(--gg-mid-gray);
}

/* Variation data */
.gg-cart-item__info dl.variation {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--gg-mid-gray);
}

.gg-cart-item__info dl.variation dt {
    float: left;
    margin-right: 0.25rem;
    font-weight: 600;
}

.gg-cart-item__info dl.variation dd {
    margin: 0 0 0.15rem;
}

/* Actions row: qty + subtotal + remove */
.gg-cart-item__actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

/* Quantity stepper */
.gg-qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--gg-light-gray);
    border-radius: var(--gg-radius);
    overflow: hidden;
    background: var(--gg-white);
}

.gg-qty-stepper__btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gg-off-white);
    border: none;
    color: var(--gg-dark-gray);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    padding: 0;
    font-family: var(--gg-font-body);
}

.gg-qty-stepper__btn:hover {
    background: var(--gg-primary-light);
    color: var(--gg-primary);
}

.gg-qty-stepper__btn:active {
    background: var(--gg-primary);
    color: var(--gg-white);
}

.gg-qty-stepper__input {
    width: 44px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--gg-light-gray);
    border-right: 1px solid var(--gg-light-gray);
    padding: 0.4rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--gg-font-body);
    color: var(--gg-text);
    background: var(--gg-white);
    outline: none;
    appearance: textfield;
    -moz-appearance: textfield;
}

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

/* Subtotal */
.gg-cart-item__subtotal {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--gg-primary);
    margin-left: auto;
}

/* Remove link */
.gg-cart-item__remove {
    font-size: 0.75rem;
    color: var(--gg-mid-gray);
    text-decoration: none;
    transition: color 0.15s;
}

.gg-cart-item__remove:hover {
    color: var(--gg-accent);
}

/* Update cart button */
.gg-cart-items__footer {
    padding-top: 1.25rem;
    margin-top: 0;
    border-top: none;
    display: flex;
    justify-content: flex-end;
}

.gg-btn-update {
    background: var(--gg-off-white);
    color: var(--gg-dark-gray);
    border: 1.5px solid var(--gg-light-gray);
    border-radius: var(--gg-radius);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: var(--gg-font-body);
    cursor: pointer;
    transition: all 0.2s;
}

.gg-btn-update:hover {
    background: var(--gg-primary-light);
    border-color: var(--gg-primary);
    color: var(--gg-primary);
}

/* ============================================
   ORDER SUMMARY SIDEBAR
   ============================================ */
.gg-cart-summary {
    background: var(--gg-white);
    border-radius: var(--gg-radius-lg);
    box-shadow: var(--gg-shadow-sm);
    padding: 1.75rem;
    position: sticky;
    top: 80px;
}

.gg-cart-summary h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gg-primary-light);
}

/* Summary rows */
.gg-cart-summary__rows {
    margin-bottom: 1rem;
}

.gg-cart-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.6rem 0;
    font-size: 0.9375rem;
    color: var(--gg-dark-gray);
    border-bottom: 1px solid var(--gg-light-gray);
}

.gg-cart-summary__row:last-child {
    border-bottom: none;
}

.gg-cart-summary__row span:last-child {
    font-weight: 600;
    color: var(--gg-text);
}

/* Shipping header row */
.gg-cart-summary__shipping-header {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gg-dark-gray);
    border-bottom: none;
}

/* Shipping options list */
.gg-cart-shipping-options {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Hide native radio */
.gg-cart-shipping-options input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.gg-cart-shipping-options li {
    position: relative;
    margin: 0;
}

/* Custom radio label — full width card */
.gg-cart-shipping-options label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gg-light-gray);
    border-radius: var(--gg-radius);
    transition: border-color 0.2s, background 0.2s;
    color: var(--gg-dark-gray);
}

.gg-cart-shipping-options label:hover {
    border-color: var(--gg-primary-light);
    background: var(--gg-off-white);
}

/* Custom radio circle */
.gg-cart-shipping-options label::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--gg-light-gray);
    border-radius: 50%;
    flex-shrink: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--gg-white);
}

/* Checked state */
.gg-cart-shipping-options input[type="radio"]:checked + label {
    border-color: var(--gg-primary);
    background: rgba(0, 151, 167, 0.04);
}

.gg-cart-shipping-options input[type="radio"]:checked + label::before {
    border-color: var(--gg-primary);
    box-shadow: inset 0 0 0 4px var(--gg-primary);
}

/* Focus ring */
.gg-cart-shipping-options input[type="radio"]:focus + label {
    box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.15);
}

/* Shipping method name */
.gg-ship-name {
    flex: 1;
}

/* Shipping cost — right aligned */
.gg-ship-cost {
    font-weight: 700;
    color: var(--gg-text);
    white-space: nowrap;
}

/* Total */
.gg-cart-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-top: 2px solid var(--gg-light-gray);
    border-bottom: 2px solid var(--gg-light-gray);
}

.gg-cart-summary__total span:first-child {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--gg-text);
}

.gg-cart-summary__total span:last-child,
.gg-cart-summary__total .order-total .woocommerce-Price-amount {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--gg-primary);
}

/* Coupon */
.gg-cart-coupon {
    margin-bottom: 1rem;
}

.gg-cart-coupon__form {
    display: flex;
    gap: 0.5rem;
}

.gg-cart-coupon__input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 1.5px solid var(--gg-light-gray);
    border-radius: var(--gg-radius);
    font-size: 0.875rem;
    font-family: var(--gg-font-body);
    color: var(--gg-text);
    background: var(--gg-off-white);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.gg-cart-coupon__input:focus {
    border-color: var(--gg-primary);
    background: var(--gg-white);
    box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.1);
}

.gg-cart-coupon__btn {
    background: var(--gg-primary);
    color: var(--gg-white);
    border: none;
    border-radius: var(--gg-radius);
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: var(--gg-font-body);
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.gg-cart-coupon__btn:hover {
    background: var(--gg-primary-dark);
}

/* Checkout button */
.gg-cart-summary__checkout {
    margin-bottom: 0.75rem;
}

.gg-btn--full {
    display: block;
    width: 100%;
    text-align: center;
}

/* Continue shopping */
.gg-cart-summary__continue {
    text-align: center;
    margin-bottom: 1.25rem;
}

.gg-cart-summary__continue a {
    font-size: 0.875rem;
    color: var(--gg-primary);
    font-weight: 500;
}

.gg-cart-summary__continue a:hover {
    color: var(--gg-primary-dark);
}

/* Trust signals */
.gg-cart-summary__trust {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gg-light-gray);
}

.gg-cart-summary__trust > div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--gg-mid-gray);
}

.gg-cart-summary__trust svg {
    width: 16px;
    height: 16px;
    fill: var(--gg-success);
    flex-shrink: 0;
}

/* ============================================
   EMPTY CART
   ============================================ */
.gg-cart-empty {
    text-align: center;
    padding: 4rem 1rem;
    background: var(--gg-white);
    border-radius: var(--gg-radius-lg);
    box-shadow: var(--gg-shadow-sm);
    margin-bottom: 2.5rem;
}

.gg-cart-empty svg {
    width: 64px;
    height: 64px;
    color: var(--gg-mid-gray);
    margin-bottom: 1rem;
}

.gg-cart-empty h2 {
    font-size: 1.375rem;
    margin-bottom: 0.5rem;
}

.gg-cart-empty p {
    color: var(--gg-mid-gray);
    margin-bottom: 1.5rem;
}

/* Suggestions */
.gg-cart-suggestions {
    margin-top: 2rem;
}

.gg-cart-suggestions h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

/* ============================================
   NOTICES
   ============================================ */
.gg-cart-page .woocommerce-message,
.gg-cart-page .woocommerce-info,
.gg-cart-page .woocommerce-error {
    margin-bottom: 1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .gg-cart-layout {
        grid-template-columns: 1fr;
    }

    .gg-cart-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .gg-cart-page {
        padding: 1rem 0 2rem;
    }

    .gg-cart-page__title {
        font-size: 1.375rem;
    }

    .gg-cart-items {
        padding: 1rem;
    }

    .gg-cart-item {
        gap: 0.75rem;
    }

    .gg-cart-item__image {
        width: 72px;
    }

    .gg-cart-item__actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .gg-cart-item__subtotal {
        margin-left: 0;
    }

    .gg-cart-summary {
        padding: 1.25rem;
    }
}

/* ============================================
   CART UPSELLS / CROSS-SELLS
   ============================================ */
.gg-cart-upsells {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid var(--gg-light-gray);
}

.gg-cart-upsells h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}
