/* ── Cart Page Styles ── */

/* ── WooCommerce Default Overrides ── */
.woocommerce-cart .woocommerce,
.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-error,
.woocommerce-cart .woocommerce-info {
    margin: 0;
}

.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-error,
.woocommerce-cart .woocommerce-info {
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}

.woocommerce-cart .woocommerce-message {
    background: rgba(0, 168, 107, 0.08);
    border: 1px solid rgba(0, 168, 107, 0.2);
    color: var(--brand-accent);
}

.woocommerce-cart .woocommerce-info {
    background: rgba(0, 114, 255, 0.08);
    border: 1px solid rgba(0, 114, 255, 0.2);
    color: var(--brand-sky);
}

.woocommerce-cart .woocommerce-error {
    background: rgba(255, 61, 129, 0.08);
    border: 1px solid rgba(255, 61, 129, 0.2);
    color: var(--brand-secondary);
}

.woocommerce-cart .woocommerce-message::before,
.woocommerce-cart .woocommerce-info::before,
.woocommerce-cart .woocommerce-error::before {
    display: none;
}

.woocommerce-cart table.shop_table {
    display: none;
}

.woocommerce-cart .cart-collaterals {
    display: none;
}

.cart_totals {
    display: none;
}

.woocommerce-cart {
    background: #fff;
    min-height: 100vh;
    font-family: var(--font-display);
}

.woocommerce-cart .container {
    max-width: 1350px;
    padding: 0 24px;
}

.woocommerce-page .woocommerce {
    margin: 0;
}

.wp-block-woocommerce-cart {
    margin-top: 50px;
}

.wp-block-woocommerce-cart-order-summary-heading-block {
    margin-top: 0
}

/* ── Page Title ── */
.cart-page-title {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    color: #1A202C;
}

/* ── Cart Layout ── */
.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
    margin-bottom: 60px;
}


.cart-items {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

/* ── Cart Item ── */
.cart-item {
    display: grid;
    grid-template-columns: 84px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #F3F4F6;
    transition: opacity var(--transition-fast);
}

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


.cart-item.removing {
    opacity: 0.3;
    pointer-events: none;
}

/* Product Image */
.item-image {
    width: 84px;
    height: 84px;
    border-radius: 10px;
    overflow: hidden;
    background: #F8F8F6;
    border: 1px solid #E5E7EB;
}


.item-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Details */
.item-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.item-name {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1A202C;
    line-height: 1.3;
}

.item-name a {
    color: #1A202C;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.item-name a:hover {
    color: #1E3F2A;
}

.item-variant {
    font-size: 12px;
    color: var(--brand-muted);
}

.item-variant p {
    margin: 0;
}

.item-variant .variation {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    margin: 0 0 2px;
}

.item-variant .variation dt,
.item-variant .variation dd {
    margin: 0;
    display: inline;
}

.item-variant .variation dd::after {
    content: "";
}

.item-variant .variation dd ~ dt::before {
    content: "·";
    margin-right: 4px;
    color: var(--brand-muted);
}

.item-variant .wc-item-meta {
    margin: 0;
    padding: 0;
    list-style: none;
}

.item-variant .wc-item-meta li {
    font-size: 13px;
    color: var(--brand-text-muted);
}

.backorder_notification {
    font-size: 12px;
    color: var(--brand-highlight);
    margin: 4px 0 0;
    padding: 4px 8px;
    background: rgba(255, 184, 0, 0.1);
    border-radius: 4px;
    display: inline-block;
}

.item-price {
    font-size: 16px;
    font-weight: 800;
    color: #1E3F2A;
    font-family: var(--font-display);
}

.item-price .woocommerce-Price-amount {
    font-weight: 800;
}

.item-price del,
.item-price .woocommerce-Price-amount del {
    font-size: 12px;
    color: #9CA3AF;
    text-decoration: line-through;
    font-weight: 600;
    margin-left: 4px;
}

/* ── Item Actions ── */
.item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}


/* ── Quantity Control ── */
.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #E5E7EB;
    border-radius: 999px;
    height: 32px;
    padding: 0 2px;
    gap: 0;
}

.quantity-control .quantity {
    display: flex;
    align-items: center;
    gap: 0;
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
    height: 100%;
}

.quantity-control .qty-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
    height: 100%;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1F2937;
    transition: all var(--transition-fast);
    padding: 0;
    font-family: var(--font-display);
    line-height: 1;
}

.qty-btn:hover {
    background: #F3F4F6;
    color: #1E3F2A;
}

.qty-btn:active {
    transform: scale(0.95);
}

/* Quantity Input */
.quantity input[type="number"],
.ci-qty input[type="number"] {
    width: 28px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #1F2937;
    font-family: var(--font-display);
    -moz-appearance: textfield;
    padding: 0;
    height: auto;
}

.quantity input[type="number"]::-webkit-outer-spin-button,
.quantity input[type="number"]::-webkit-inner-spin-button,
.ci-qty input[type="number"]::-webkit-outer-spin-button,
.ci-qty input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity input[type="number"]:focus,
.ci-qty input[type="number"]:focus {
    outline: none;
    box-shadow: none;
}

.quantity-control .quantity {
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}

.remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #9CA3AF;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: color var(--transition-fast);
    font-family: var(--font-display);
    font-weight: 600;
}

.remove-btn:hover {
    color: #C44D4D;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Cart Summary ── */
.cart-summary {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #E5E7EB;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: calc(var(--header-height) + 16px);
    overflow: hidden;
}


.summary-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 800;
    margin: -16px -16px 16px;
    padding: 16px;
    color: #1A202C;
    background: #E9EFE9;
    border-bottom: 1px solid #D1E7D6;
    letter-spacing: -0.01em;
}

.summary-products {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--brand-border-light);
    max-height: 320px;
    overflow-y: auto;
}

.summary-product-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--brand-border-light);
}

.summary-product-item:last-child {
    border-bottom: none;
}

.summary-product-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--brand-bg-secondary);
}

.summary-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.summary-product-thumb a {
    display: block;
    width: 100%;
    height: 100%;
}

.summary-product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.summary-product-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--brand-dark);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-product-name a {
    color: var(--brand-dark);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.summary-product-name a:hover {
    color: var(--brand-accent-warm);
}

.summary-product-qty {
    font-size: 12px;
    color: var(--brand-text-muted);
}

.summary-product-total {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-dark);
    white-space: nowrap;
}

.summary-product-total .woocommerce-Price-amount {
    font-weight: 600;
}

/* Scrollbar for products list */
.summary-products::-webkit-scrollbar {
    width: 4px;
}

.summary-products::-webkit-scrollbar-track {
    background: transparent;
}

.summary-products::-webkit-scrollbar-thumb {
    background: var(--brand-border);
    border-radius: 2px;
}


/* ── Summary Rows ── */
.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--brand-muted);
    margin-bottom: 9px;
}

.summary-row .summary-value {
    color: #1A202C;
    font-weight: 600;
}

.summary-row.discount-line .summary-value {
    color: #065F46;
}

.summary-row.total {
    font-weight: 700;
    color: #1A202C;
    font-size: 15px;
    border-top: 1px solid #F3F4F6;
    border-bottom: 1px solid #F3F4F6;
    padding: 12px 0;
    margin-top: 4px;
    margin-bottom: 16px;
    align-items: center;
}

.summary-row.total .summary-value {
    font-size: 24px;
    font-weight: 800;
    color: #1E3F2A;
    font-family: var(--font-display);
}

.summary-tax {
    font-size: 12px;
    color: var(--brand-muted);
    text-align: center;
    margin: 8px 0 16px;
}

/* ── Promo Input Group ── */
.promo-input-group {
    margin: 16px 0;
}

.promo-box {
    display: flex;
    gap: 8px;
}

.promo-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    color: #1F2937;
    font-family: var(--font-display);
    outline: none;
    transition: border var(--transition-fast);
}

.promo-input:focus {
    border-color: #1E3F2A;
    box-shadow: none;
}

.promo-input::placeholder {
    color: #9CA3AF;
}

.promo-input.error {
    border-color: var(--brand-secondary);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.promo-btn {
    height: 40px;
    padding: 0 14px;
    background: #1E3F2A;
    color: #fff;
    border: 1px solid #0f2316;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-family: var(--font-display);
}

.promo-btn:hover {
    background: #163322;
}

.promo-btn:active {
    transform: scale(0.98);
}

/* ── Checkout Button ── */
.wc-proceed-to-checkout {
    margin-top: 8px;
}

.btn-checkout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    padding: 0 32px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 999px;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 1px solid #0f2316;
    font-family: var(--font-display);
    background: #1E3F2A;
    color: #fff;
    box-shadow: 0 4px 14px rgba(30, 63, 42, 0.22);
    margin-bottom: 8px;
}

.btn-checkout:hover {
    background: #163322;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(30, 63, 42, 0.28);
    color: #fff;
}

.btn-checkout:active {
    transform: translateY(0);
}

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

.btn-continue-shopping {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 999px;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #1F2937;
    font-family: var(--font-display);
    margin-top: 8px;
}

.btn-continue-shopping:hover {
    background: #F9FAFB;
    border-color: #1F2937;
    color: #1F2937;
}

/* ── Empty Cart State ── */
.cart-empty-wrapper {
    padding: 80px 24px;
    background: var(--brand-bg);
    min-height: 0;
}

.empty-cart {
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--brand-dark);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: #fff;
}

.empty-icon svg {
    width: 36px;
    height: 36px;
    stroke: #fff;
    fill: none;
}

.empty-cart h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    color: var(--brand-dark);
    margin: 0 0 12px;
}

.empty-cart p {
    font-size: 15px;
    color: var(--brand-text-muted);
    line-height: 1.7;
    margin: 0 0 32px;
}

.btn-shop {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    border-radius: 50px;
    background: var(--brand-dark);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    font-family: var(--font-display);
}

.btn-shop:hover,
.btn-shop:focus {
    background: #333;
    color: #fff;
    outline: none;
}

.btn-shop svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    transition: transform var(--transition-fast);
}

.btn-shop:hover svg {
    transform: translateX(4px);
}

.woocommerce-cart .return-to-shop {
    display: none !important;
}

.cart-collaterals {
    margin-top: 40px;
}

/* ── Animations ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item {
    animation: fadeInUp 0.4s ease-out;
    animation-fill-mode: both;
}

.cart-item:nth-child(1) { animation-delay: 0.05s; }
.cart-item:nth-child(2) { animation-delay: 0.1s; }
.cart-item:nth-child(3) { animation-delay: 0.15s; }
.cart-item:nth-child(4) { animation-delay: 0.2s; }
.cart-item:nth-child(5) { animation-delay: 0.25s; }

/* Loading State */
.cart-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.shop-zen-cart-updating {
    position: relative;
}

.shop-zen-cart-updating::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    border-radius: inherit;
    z-index: 2;
}

.shop-zen-summary-updating .summary-value,
.shop-zen-summary-updating .summary-product-total,
.shop-zen-summary-updating .summary-product-qty {
    position: relative;
    color: transparent !important;
}

.shop-zen-summary-updating .summary-value::after,
.shop-zen-summary-updating .summary-product-total::after,
.shop-zen-summary-updating .summary-product-qty::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 14px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, var(--brand-border-light) 25%, var(--brand-bg-secondary) 50%, var(--brand-border-light) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: shop-zenSkeletonPulse 1.2s ease-in-out infinite;
}

@keyframes shop-zenSkeletonPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Spinner for cart item row updating */
.shop-zen-cart-updating .item-price {
    position: relative;
    color: transparent !important;
}

.shop-zen-cart-updating .item-price::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid var(--brand-border);
    border-top-color: var(--brand-dark);
    border-radius: 50%;
    animation: shop-zenSpin 0.6s linear infinite;
}

@keyframes shop-zenSpin {
    to { transform: rotate(360deg); }
}

.cart-item.removing {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(40px);
        height: 0;
        padding: 0;
        margin: 0;
        border: none;
        overflow: hidden;
    }
}

/* ── WooCommerce Notices Override ── */
.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-info,
.woocommerce-cart .woocommerce-error {
    margin-bottom: 24px;
}

/* ── Responsive Design ── */


/**
====================================================================
  Responsive Styles
====================================================================
*/

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

@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 80px 1fr auto;
        gap: 12px;
        padding: 14px;
    }

    .item-image {
        width: 80px;
        height: 80px;
    }

    .cart-summary {
        position: static;
        margin-top: 20px;
    }

    .summary-product-item {
        grid-template-columns: 40px 1fr auto;
        gap: 8px;
    }

    .summary-product-thumb {
        width: 40px;
        height: 40px;
    }

    .cart-page-title {
        font-size: 26px;
        margin-bottom: 16px;
    }

    .cart-layout {
        margin-bottom: 40px;
    }
}

@media (max-width: 480px) {
    .cart-item {
        grid-template-columns: 70px 1fr;
    }

    .item-image {
        width: 70px;
        height: 90px;
    }

    .item-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 8px;
    }

    .promo-box {
        flex-direction: column;
    }

    .promo-btn {
        width: 100%;
    }

    .btn-checkout {
        padding: 14px 24px;
        font-size: 13px;
    }

    .btn-continue-shopping {
        padding: 14px 24px;
        font-size: 13px;
    }
}
