/*
 * Brand tokens (single source of truth).
 *  --gg-brand-red:        #b30d18  primary
 *  --gg-brand-red-hover:  #8f0a12  primary hover
 *  --gg-brand-accent:     #f8e823  accent
 */
:root {
    --gg-brand-red: #b30d18;
    --gg-brand-red-hover: #8f0a12;
    --gg-brand-accent: #f8e823;
}

/*
 * Classic cart layout — main column follows page; sidebar is a white summary card.
 */
.gg-cart-page {
    --gg-radius-lg: 16px;
    --gg-radius-sm: 10px;
    --gg-border: color-mix(in srgb, currentColor 14%, transparent);
    --gg-sidebar-bg: #ffffff;
    --gg-sidebar-text: #111827;
    --gg-sidebar-muted: #475569;
    --gg-sidebar-border: rgba(15, 23, 42, 0.08);

    position: relative;
    background: transparent;
    color: inherit;
    box-sizing: border-box;
    padding: 0;
}

.gg-cart-page__inner {
    max-width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.62fr) minmax(296px, 1fr);
    gap: clamp(18px, 2.4vw, 28px);
    align-items: start;
}

/* Left column: gg-cart-main__stack holds bordered panel + trust (separate visual containers). Hooks row below. Sidebar spans all rows. */
.gg-cart-main {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

.gg-cart-main__stack {
    display: flex;
    flex-direction: column;
    gap: clamp(18px, 2.4vw, 26px);
    min-width: 0;
}

.gg-cart-sidebar {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (min-width: 981px) {
    .gg-cart-sidebar {
        position: sticky;
        top: 1.25rem;
        z-index: 2;
    }

    /* WordPress admin bar offset */
    body.admin-bar .gg-cart-sidebar {
        top: calc(1.25rem + 32px);
    }
}

@media screen and (max-width: 782px) {
    body.admin-bar .gg-cart-sidebar {
        top: calc(1.25rem + 46px);
    }
}

.gg-cart-form-hooks {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
}

.gg-cart-panel--main {
    background: transparent;
    border: 1px solid var(--gg-border);
    border-radius: var(--gg-radius-lg);
    padding: clamp(18px, 2vw, 26px);
}

.gg-cart-panel--coupon,
.gg-cart-panel--sidebar {
    background: var(--gg-sidebar-bg);
    color: var(--gg-sidebar-text);
    border-radius: var(--gg-radius-lg);
    padding: clamp(18px, 2vw, 22px);
    border: 1px solid var(--gg-sidebar-border);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

/* Title ------------------------------------------------------------ */
.gg-cart-title {
    margin: 4px 0 18px;
    font-size: clamp(1.35rem, 2.3vw, 1.625rem);
    font-weight: 700;
    color: inherit;
    letter-spacing: -0.02em;
}

/* Cross sells (optional) -------------------------------------------- */
.gg-cart-cross-sells {
    margin: 0 0 16px;
}

.gg-cart-cross-sells .cross-sells > h2 {
    color: inherit;
    font-size: 1rem;
    margin-bottom: 10px;
}

.gg-cart-cross-sells ul.products li.product .woocommerce-loop-product__title,
.gg-cart-cross-sells ul.products li.product .price {
    color: inherit;
}

/* Cart table chrome ------------------------------------------------ */
.gg-cart-table__head,
.gg-cart-row {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto
        24px;
    gap: clamp(10px, 2vw, 14px);
    align-items: center;
}

.gg-cart-table__col--subtotal,
.gg-cart-row__subtotal {
    text-align: right;
    white-space: nowrap;
    justify-self: end;
}

.gg-cart-table__head {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: inherit;
    opacity: 0.72;
    border-bottom: 1px solid var(--gg-border);
    padding-bottom: 10px;
    margin-bottom: 4px;
}

.gg-cart-row {
    padding: 14px 0;
    border-bottom: 1px solid var(--gg-border);
    font-size: 16px;
}

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

.gg-cart-row__product {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.gg-cart-row__product > a {
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--gg-border);
    background: transparent;
}

.gg-cart-row__product img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    display: block;
}

.gg-cart-row__product-meta a {
    font-weight: 600;
    text-decoration: none;
}

.gg-cart-row__product-meta a:hover {
    text-decoration: underline;
}

.gg-cart-row__product-meta .variation {
    color: inherit;
    opacity: 0.8;
    font-size: 0.85rem;
}

.gg-cart-row__qty-note {
    margin: 6px 0 0;
    font-size: 0.85rem;
    color: inherit;
    opacity: 0.8;
}

.gg-cart-row__subtotal {
    font-weight: 600;
    color: inherit;
}

.gg-cart-row__subtotal del {
    color: inherit;
    opacity: 0.65;
    font-weight: 500;
    margin-right: 6px;
}

.gg-cart-row__subtotal ins {
    text-decoration: none;
    color: inherit;
    font-weight: 700;
}

/* Remove ----------------------------------------------------------- */
.gg-cart-row__remove {
    justify-self: end;
}

.gg-cart-remove,
a.gg-cart-remove,
a.gg-cart-remove:link,
a.gg-cart-remove:visited,
a.gg-cart-remove:hover,
a.gg-cart-remove:focus,
a.gg-cart-remove:active,
.woocommerce a.remove.gg-cart-remove {
    color: var(--e-global-color-accent) !important;
}

.gg-cart-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.95rem;
    line-height: 1;
    text-decoration: none !important;
    opacity: 1 !important;
    border: 1px solid var(--gg-border);
    background: transparent !important;
}

/* Main actions ----------------------------------------------------- */
.gg-cart-actions--main {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    min-width: 0;
}

.gg-cart-actions__coupon {
    display: flex;
    gap: 8px;
    margin-left: auto;
    min-width: 0;
    flex: 0 1 auto;
}

.gg-cart-actions__coupon .input-text {
    border: 1px solid var(--gg-border);
    border-radius: 8px;
    padding: 9px 12px;
    background: transparent;
    color: inherit;
    min-width: 0;
    flex: 1 1 140px;
    max-width: 220px;
}

.gg-cart-actions__coupon .button {
    border-radius: 8px !important;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .gg-cart-actions--main {
        gap: 6px;
    }

    .gg-cart-actions__coupon {
        gap: 6px;
        flex: 1 1 0;
    }

    .gg-cart-actions__coupon .input-text {
        flex: 1 1 0;
        min-width: 0;
        padding: 8px 10px !important;
        font-size: 0.85rem;
    }

    .gg-cart-actions__coupon .button {
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
    }

    .gg-cart-actions__update {
        padding: 8px 12px !important;
        white-space: nowrap;
    }
}

.gg-cart-actions__update {
    background: #111827 !important;
    color: #ffffff !important;
    border: 0 !important;
    border-radius: 8px !important;
    padding: 10px 18px !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    line-height: 1.2 !important;
    text-transform: capitalize !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
    transition: background-color 0.15s ease;
}

.gg-cart-actions__update:hover,
.gg-cart-actions__update:focus {
    background: #1f2937 !important;
    color: #ffffff !important;
    opacity: 1;
}

/* Trust: sibling of bordered panel inside gg-cart-main__stack (not inside gg-cart-panel--main) */
.gg-cart-trust {
    margin: 0;
    padding: 0;
}

.gg-cart-trust__hero {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-radius: var(--gg-radius-sm);
    background: transparent;
    border: 1px solid var(--gg-border);
}

.gg-cart-trust__hero-icon {
    color: inherit;
    opacity: 0.85;
    flex-shrink: 0;
}

.gg-cart-trust__hero-copy strong {
    display: block;
    color: inherit;
    font-size: 1.2rem !important;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 4px;
}

@media (max-width: 600px) {
    .gg-cart-trust__hero-copy strong {
        font-size: 1rem !important;
    }
}

.gg-cart-trust__hero-copy p {
    margin: 0;
    color: inherit;
    opacity: 0.78;
    font-size: 0.9rem;
    line-height: 1.45;
}

.gg-cart-trust__badges {
    list-style: none;
    margin: 20px 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(10px, 1.6vw, 18px);
}

.gg-cart-trust__badge {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: 0;
}

.gg-cart-trust__badge-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    opacity: 0.85;
}

.gg-cart-trust__badge-icon svg {
    display: block;
}

.gg-cart-trust__badge-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.gg-cart-trust__badge-copy strong {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: inherit;
    margin: 0 0 2px;
}

.gg-cart-trust__badge-copy span {
    display: block;
    font-size: 0.6rem;
    color: inherit;
    opacity: 0.7;
}

/* Sidebar coupon --------------------------------------------------- */
.gg-cart-sidebar .gg-cart-coupon__label {
    margin: 0 0 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gg-sidebar-text);
}

.gg-cart-coupon {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gg-cart-sidebar .gg-cart-coupon .input-text {
    flex: 1 1 160px;
    min-width: 0;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 10px 12px;
    background: var(--gg-sidebar-bg);
    color: var(--gg-sidebar-text);
}

.gg-cart-coupon .button {
    border-radius: 10px;
    font-weight: 600;
}

/* Totals / order summary ------------------------------------------- */
.gg-cart-sidebar .gg-cart-totals {
    color: var(--gg-sidebar-text);
}

.gg-cart-totals__title {
    margin: 0 0 14px;
    font-size: 1.15rem;
    color: inherit;
}

.gg-cart-sidebar .gg-cart-totals__title {
    color: var(--gg-sidebar-text);
}

.gg-cart-totals__rows {
    width: 100%;
    margin: 0 0 14px;
    display: flex;
    flex-direction: column;
}

.gg-cart-totals__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    font-size: 0.95rem;
}

.gg-cart-totals__label {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 500;
    color: inherit;
    opacity: 0.72;
    text-align: left;
}

.gg-cart-sidebar .gg-cart-totals__label {
    color: var(--gg-sidebar-muted);
    opacity: 1;
}

.gg-cart-totals__value {
    flex: 0 1 auto;
    max-width: min(58%, 100%);
    text-align: right;
    font-weight: 600;
    color: inherit;
    word-break: break-word;
}

.gg-cart-sidebar .gg-cart-totals__value {
    color: var(--gg-sidebar-text);
}

.gg-cart-totals__row.cart-discount .gg-cart-totals__label,
.gg-cart-totals__row.cart-discount .gg-cart-totals__value {
    color: inherit;
    opacity: 1;
}

.gg-cart-sidebar .gg-cart-totals__row.cart-discount .gg-cart-totals__label,
.gg-cart-sidebar .gg-cart-totals__row.cart-discount .gg-cart-totals__value {
    color: #2563eb;
}

.gg-cart-totals__row.order-total {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--gg-border);
}

.gg-cart-sidebar .gg-cart-totals__row.order-total {
    border-top-color: rgba(15, 23, 42, 0.08);
}

.gg-cart-totals__row.order-total .gg-cart-totals__label,
.gg-cart-totals__row.order-total .gg-cart-totals__value {
    font-size: 1.15rem;
}

/* Shipping column: methods read left-to-right inside the right cell */
.gg-cart-sidebar .gg-cart-totals__value .woocommerce-shipping-methods {
    text-align: left;
    margin: 0 0 0 auto;
    max-width: 100%;
}

.gg-cart-sidebar .gg-cart-totals__row.woocommerce-shipping-totals .gg-cart-totals__value {
    max-width: min(65%, 100%);
}

.gg-cart-secure-notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: var(--gg-radius-sm);
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #14532d;
    line-height: 1.45;
    margin-bottom: 14px;
}

.gg-cart-secure-notice__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #16a34a;
    line-height: 0;
}

.gg-cart-secure-notice__icon svg {
    display: block;
}

.gg-cart-secure-notice__body {
    flex: 1 1 auto;
    min-width: 0;
}

.gg-cart-secure-notice__title {
    display: block;
    font-weight: 700;
    color: #14532d;
    font-size: 0.95rem;
    margin-bottom: 2px;
    line-height: 1.3;
}

.gg-cart-secure-notice p {
    margin: 0;
    font-size: 0.85rem;
    color: #166534;
}

.gg-cart-totals__checkout {
    margin: 0 0 12px;
}

.gg-checkout-button {
    width: 100%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 16px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 1.1rem !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    background: var(--gg-brand-red) !important;
    color: #ffffff !important;
    border: 0 !important;
    box-shadow: 0 12px 28px rgba(179, 13, 24, 0.35);
    text-decoration: none !important;
}

.gg-checkout-button:hover {
    background: var(--gg-brand-red-hover) !important;
    color: #ffffff !important;
}

.gg-checkout-button__lock {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: #ffffff;
}

.gg-checkout-button__label {
    display: inline-block;
}

/* Payment extras --------------------------------------------------- */
.gg-cart-pay-extras {
    margin-top: 8px;
}

.gg-cart-pay-banner {
    margin: 0 0 12px;
    display: flex;
    justify-content: center;
}

.gg-cart-pay-banner__img {
    display: block;
    width: 75%;
    max-width: 75%;
    height: auto;
}

.gg-cart-pay-legal {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.55;
    color: inherit;
    opacity: 0.72;
}

.gg-cart-sidebar .gg-cart-pay-legal {
    color: var(--gg-sidebar-muted);
    opacity: 1;
}

.gg-cart-pay-legal__sep {
    margin: 0 4px;
}

.gg-cart-pay-legal__period {
    margin-left: -2px;
}

.gg-cart-pay-legal a {
    color: inherit;
    text-decoration: underline;
}

/* WooCommerce fragments / calculators -------------------------------- */
.gg-cart-sidebar .shipping-calculator-button,
.gg-cart-sidebar a.shipping-calculator-button {
    color: #2563eb;
}

.gg-cart-sidebar .woocommerce-shipping-calculator .button {
    border-radius: 8px;
}

/* Woo notices inside cart ------------------------------------------ */
.gg-cart-page .woocommerce-message,
.gg-cart-page .woocommerce-error,
.gg-cart-page .woocommerce-info {
    max-width: 1120px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive -------------------------------------------------------- */
@media (max-width: 980px) {
    .gg-cart-page__inner {
        grid-template-columns: 1fr;
    }

    .gg-cart-main,
    .gg-cart-sidebar,
    .gg-cart-form-hooks {
        grid-column: 1;
        grid-row: auto;
    }

    .gg-cart-trust__badges {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .gg-cart-table__head {
        display: none;
    }

    .gg-cart-row {
        grid-template-columns: minmax(0, 1fr) 36px;
        grid-template-rows: auto;
        gap: 8px;
    }

    .gg-cart-row__product {
        grid-column: 1 / -2;
    }

    .gg-cart-row__remove {
        grid-column: -2 / -1;
        grid-row: 1;
        justify-self: end;
        align-self: start;
    }

    .gg-cart-row__subtotal {
        grid-column: 1 / -1;
    }

    .gg-cart-row__subtotal::before {
        content: attr(data-title) ": ";
        font-weight: 700;
        color: inherit;
        opacity: 1;
        margin-right: 6px;
    }
}
