/* ============================================
   CART PAGE — SILENTHOUGHT
   Clean · Minimal · Professional
   Aligned with product page design language.
   Covers: WC Block Cart + Custom Classic Template
   ============================================ */

/* ─── Design tokens (local, mirrors product-page) ─── */
:root {
    --ct-border:   #e5e5e5;
    --ct-surface:  #fafafa;
    --ct-text-2:   #525252;
    --ct-text-3:   #a3a3a3;
    --ct-success:  #16a34a;
    --ct-radius:   12px;
    --ct-shadow:   0 2px 8px rgba(0,0,0,0.04);
}

/* ─── Page ─── */
body.woocommerce-cart {
    background: #ffffff;
}

/* ============================================
   WC BLOCK CART
   ============================================ */

.wp-block-woocommerce-cart,
.wc-block-cart {
    max-width: 1120px;
    margin: 0 auto;
    padding: 56px 32px 96px;
    font-family: var(--font-body);
    color: var(--color-black);
}

/* Page heading */
.wc-block-cart h1,
.woocommerce-cart-form + * h1,
.woocommerce-cart h1.entry-title,
.cart-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--color-black);
    margin: 0 0 40px;
    letter-spacing: -0.2px;
}

/* ── Item list ── */
.wc-block-cart-items {
    background: transparent;
    border: none;
    border-top: 1.5px solid var(--color-black);
    border-radius: 0;
    overflow: visible;
}

.wc-block-cart-item {
    display: grid;
    grid-template-columns: 88px 1fr auto auto;
    gap: 20px;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--ct-border);
    background: transparent;
    transition: background 0.15s;
}

.wc-block-cart-item:hover {
    background: transparent;
}

/* Product image */
.wc-block-cart-item__image {
    width: 88px !important;
    height: 88px !important;
    border-radius: 10px !important;
    overflow: hidden;
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    flex-shrink: 0;
}

.wc-block-cart-item__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

/* Product info column */
.wc-block-cart-item__product {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wc-block-components-product-name a,
.wc-block-cart-item__description h3 a {
    font-family: var(--font-display) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--color-black) !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    transition: color 0.2s !important;
}

.wc-block-components-product-name a:hover,
.wc-block-cart-item__description h3 a:hover {
    color: var(--color-red) !important;
}

/* Variation / meta tags */
.wc-block-components-product-metadata {
    margin-top: 4px !important;
}

.wc-block-components-product-metadata dl {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 0;
}

.wc-block-components-product-metadata dt {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--ct-text-3) !important;
}

.wc-block-components-product-metadata dd {
    font-size: 12px !important;
    color: var(--ct-text-2) !important;
    margin: 0 !important;
}

/* Remove link */
.wc-block-cart-item__remove-link,
.wc-block-cart-item__remove-link a {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px !important;
    color: var(--ct-text-3) !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: color 0.2s !important;
}

.wc-block-cart-item__remove-link:hover,
.wc-block-cart-item__remove-link a:hover {
    color: var(--color-red) !important;
}

/* Quantity stepper */
.wc-block-components-quantity-stepper {
    display: inline-flex !important;
    align-items: center !important;
    border: 1px solid var(--ct-border) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #ffffff !important;
    width: auto !important;
}

.wc-block-components-quantity-stepper__button {
    width: 34px !important;
    height: 36px !important;
    border: none !important;
    background: transparent !important;
    color: var(--ct-text-2) !important;
    font-size: 16px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s, color 0.15s !important;
    flex-shrink: 0 !important;
}

.wc-block-components-quantity-stepper__button:hover {
    background: var(--color-red) !important;
    color: #ffffff !important;
}

.wc-block-components-quantity-stepper input[type="number"] {
    width: 44px !important;
    height: 36px !important;
    border: none !important;
    border-left: 1px solid var(--ct-border) !important;
    border-right: 1px solid var(--ct-border) !important;
    text-align: center !important;
    font-family: var(--font-display) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--color-black) !important;
    background: transparent !important;
    -moz-appearance: textfield !important;
    outline: none !important;
}

.wc-block-components-quantity-stepper input[type="number"]::-webkit-outer-spin-button,
.wc-block-components-quantity-stepper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* Item total */
.wc-block-cart-item__total {
    font-family: var(--font-display) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--color-black) !important;
    text-align: right !important;
    white-space: nowrap !important;
}

.wc-block-cart-item__total .wc-block-formatted-money-amount {
    color: var(--color-black) !important;
}

/* ── Order summary sidebar ── */
.wc-block-cart__sidebar {
    position: sticky;
    top: 24px;
}

.wc-block-cart__sidebar .wc-block-components-totals-wrapper {
    background: #ffffff;
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    padding: 28px;
    box-shadow: var(--ct-shadow);
}

/* Synthesise a heading for the sidebar block */
.wc-block-cart__sidebar .wc-block-components-totals-wrapper::before {
    content: "Order Summary";
    display: block;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-black);
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--ct-border);
}

/* Totals rows */
.wc-block-components-totals-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    padding: 9px 0 !important;
    border: none !important;
    font-size: 14px;
}

.wc-block-components-totals-item__label {
    color: var(--ct-text-2);
    font-weight: 400;
}

.wc-block-components-totals-item__value {
    color: var(--color-black);
    font-weight: 600;
}

/* Grand total */
.wc-block-components-totals-footer-item,
.wc-block-components-totals-item.is-total {
    margin-top: 10px !important;
    padding-top: 16px !important;
    border-top: 1px solid var(--ct-border) !important;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
.wc-block-components-totals-item.is-total .wc-block-components-totals-item__label {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-black);
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
.wc-block-components-totals-item.is-total .wc-block-components-totals-item__value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-red);
}

/* Discount */
.wc-block-components-totals-discount .wc-block-components-totals-item__value {
    color: var(--ct-success) !important;
}

/* Coupon toggle */
.wc-block-components-totals-coupon .wc-block-components-panel__button,
.wc-block-components-totals-coupon__link {
    background: transparent !important;
    border: none !important;
    color: var(--ct-text-3) !important;
    font-size: 13px !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: color 0.2s !important;
}

.wc-block-components-totals-coupon .wc-block-components-panel__button:hover,
.wc-block-components-totals-coupon__link:hover {
    color: var(--color-red) !important;
}

/* Coupon form */
.wc-block-components-totals-coupon__form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.wc-block-components-totals-coupon__input input {
    flex: 1 !important;
    padding: 10px 12px !important;
    border: 1px solid var(--ct-border) !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    color: var(--color-black) !important;
    background: #ffffff !important;
    outline: none !important;
    transition: border-color 0.2s !important;
}

.wc-block-components-totals-coupon__input input:focus {
    border-color: var(--color-red) !important;
    box-shadow: 0 0 0 3px rgba(235,31,58,0.07) !important;
}

.wc-block-components-totals-coupon__button {
    padding: 10px 16px !important;
    background: var(--color-black) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    white-space: nowrap !important;
}

.wc-block-components-totals-coupon__button:hover {
    background: var(--color-red) !important;
}

/* Proceed to checkout */
.wc-block-cart__submit-container {
    margin-top: 20px;
}

.wc-block-cart__submit-container .wc-block-components-button,
.wc-block-cart__submit-container button[type="submit"] {
    width: 100% !important;
    padding: 15px 24px !important;
    background: var(--color-red) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    font-family: var(--font-display) !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background 0.2s, transform 0.15s !important;
    letter-spacing: 0.2px !important;
    display: block !important;
}

.wc-block-cart__submit-container .wc-block-components-button:hover,
.wc-block-cart__submit-container button[type="submit"]:hover {
    background: var(--color-red-dark) !important;
    transform: translateY(-1px) !important;
}

/* ── Notices ── */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid var(--ct-border);
    border-left: 3px solid;
    font-size: 14px;
    color: var(--color-black);
    background: #ffffff;
    margin-bottom: 24px;
    list-style: none;
}

.woocommerce-message { border-left-color: var(--ct-success); }
.woocommerce-error   { border-left-color: var(--color-red);  }
.woocommerce-info    { border-left-color: #f59e0b; }

.woocommerce-message a,
.woocommerce-error a,
.woocommerce-info a {
    color: var(--color-red);
    font-weight: 600;
}

/* Empty cart */
.woocommerce-info,
.cart-empty {
    text-align: center;
    padding: 56px 24px;
    color: var(--ct-text-2);
    border-left: 1px solid var(--ct-border);
}

.return-to-shop { margin-top: 20px; }

.return-to-shop .button {
    display: inline-block;
    padding: 12px 28px;
    background: var(--color-red);
    color: #ffffff;
    border-radius: 10px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s;
}

.return-to-shop .button:hover { background: var(--color-red-dark); }

/* ============================================
   CUSTOM CLASSIC CART TEMPLATE
   (.modern-cart-wrapper)
   ============================================ */

.modern-cart-wrapper {
    background: #ffffff;
    padding: 56px 32px 96px;
}

.modern-cart-container {
    max-width: 1120px;
    margin: 0 auto;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 40px;
    border-bottom: none;
    padding-bottom: 0;
}

.cart-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    color: var(--color-black);
    margin: 0;
    letter-spacing: -0.2px;
}

.cart-count {
    font-size: 13px;
    color: var(--ct-text-3);
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-weight: 400;
}

/* 2-column grid */
.cart-content-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 64px;
    align-items: start;
}

@media (max-width: 960px) {
    .cart-content-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* Items list */
.cart-items-section {
    border-top: 1.5px solid var(--color-black);
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Individual item row — no card, just divider */
.cart-item-card {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 20px;
    padding: 24px 0;
    border-bottom: 1px solid var(--ct-border);
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    animation: none;
    transition: none;
}

.cart-item-card:hover { box-shadow: none; }

.cart-item-image {
    width: 88px;
    height: 88px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.cart-item-card:hover .cart-item-image img { transform: scale(1.03); }
.cart-item-image a { display: block; width: 100%; height: 100%; }

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.cart-item-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--color-black);
    margin: 0;
    line-height: 1.4;
}

.cart-item-name a { color: var(--color-black); text-decoration: none; transition: color 0.2s; }
.cart-item-name a:hover { color: var(--color-red); }

.cart-item-remove {
    background: transparent;
    border: none;
    color: var(--ct-text-3);
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.cart-item-remove:hover { color: var(--color-red); background: transparent; }

.cart-item-meta {
    font-size: 13px;
    color: var(--ct-text-2);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.meta-item { display: flex; gap: 4px; align-items: center; }
.meta-label { font-weight: 600; color: var(--color-black); }

.cart-item-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
}

.cart-item-attributes p {
    margin: 0;
    font-size: 12px;
    color: var(--ct-text-2);
    background: var(--ct-surface);
    border: 1px solid var(--ct-border);
    padding: 2px 8px;
    border-radius: 4px;
}

.cart-item-attributes strong { color: var(--color-black); font-weight: 600; }

/* Price / qty / subtotal row */
.cart-item-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: none;
    margin-top: auto;
}

.cart-item-price,
.cart-item-subtotal {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.price-label,
.subtotal-label {
    font-size: 10px;
    color: var(--ct-text-3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
}

.price-value,
.subtotal-value {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-black);
}

/* Qty control */
.cart-item-quantity .quantity {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ct-border);
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.cart-item-quantity .qty {
    width: 44px;
    height: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--ct-border);
    border-right: 1px solid var(--ct-border);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-black);
    background: transparent;
    -moz-appearance: textfield;
}

.cart-item-quantity .qty::-webkit-outer-spin-button,
.cart-item-quantity .qty::-webkit-inner-spin-button { -webkit-appearance: none; }
.cart-item-quantity .qty:focus { outline: none; }

.cart-item-quantity button,
.cart-item-quantity .minus,
.cart-item-quantity .plus {
    width: 34px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--ct-text-2);
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.cart-item-quantity button:hover,
.cart-item-quantity .minus:hover,
.cart-item-quantity .plus:hover {
    background: var(--color-red);
    color: #ffffff;
}

/* Update cart */
.cart-actions {
    display: flex;
    justify-content: flex-end;
    padding: 14px 0 0;
    background: transparent;
    border: none;
    margin-top: 0;
}

.update-cart-button {
    background: transparent;
    border: none;
    color: var(--ct-text-3);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color 0.2s;
}

.update-cart-button:hover { color: var(--color-black); background: transparent; }

/* Order summary sidebar */
.cart-totals-sidebar {
    position: sticky;
    top: 24px;
}

.cart-totals-card {
    background: #ffffff;
    border: 1px solid var(--ct-border);
    border-radius: var(--ct-radius);
    padding: 28px;
    box-shadow: var(--ct-shadow);
    margin-bottom: 0;
}

.totals-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-black);
    margin: 0 0 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ct-border);
}

.totals-breakdown { display: flex; flex-direction: column; gap: 0; }

.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 9px 0;
    font-size: 14px;
    border: none;
}

.totals-label { color: var(--ct-text-2); font-weight: 400; }
.totals-value { color: var(--color-black); font-weight: 600; }

.shipping-notice { font-size: 12px; color: var(--ct-text-3); font-style: italic; }

.coupon-row .totals-label,
.coupon-row .totals-value,
.discount-value { color: var(--ct-success) !important; }

.remove-coupon { display: inline-flex; align-items: center; transition: color 0.2s; }
.remove-coupon:hover { color: var(--color-red); background: transparent; }
.remove-coupon svg { stroke: currentColor; }

.totals-divider { height: 1px; background: var(--ct-border); margin: 4px 0; }

.total-row {
    padding-top: 14px;
    border-top: 1px solid var(--ct-border);
    margin-top: 8px;
}

.total-label {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-black);
}

.total-value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--color-red);
}

/* Coupon */
.coupon-section { margin: 16px 0; }

.toggle-coupon-form {
    background: transparent;
    border: none;
    color: var(--ct-text-3);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    width: auto;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    transition: color 0.2s;
}

.toggle-coupon-form:hover { color: var(--color-red); }

.coupon-form-wrapper {
    margin-top: 10px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.apply-coupon-form { display: flex; gap: 8px; }

.coupon-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--ct-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--color-black);
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s;
}

.coupon-input:focus {
    border-color: var(--color-red);
    box-shadow: 0 0 0 3px rgba(235,31,58,0.07);
}

.coupon-input::placeholder { color: var(--ct-text-3); }

.apply-coupon-button {
    padding: 10px 16px;
    background: var(--color-black);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.apply-coupon-button:hover { background: var(--color-red); }

/* Checkout button */
.wc-proceed-to-checkout { margin-top: 20px; }

.wc-proceed-to-checkout .checkout-button {
    display: block;
    width: 100%;
    padding: 15px 24px;
    background: var(--color-red);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    letter-spacing: 0.2px;
}

.wc-proceed-to-checkout .checkout-button:hover {
    background: var(--color-red-dark);
    transform: translateY(-1px);
}

/* Continue shopping */
.continue-shopping-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--ct-text-3);
    text-decoration: none;
    transition: color 0.2s;
    background: transparent;
    border: none;
    padding: 0;
}

.continue-shopping-link:hover { color: var(--color-red); background: transparent; border: none; }
.continue-shopping-link svg { transition: transform 0.2s; }
.continue-shopping-link:hover svg { transform: translateX(-3px); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .wp-block-woocommerce-cart,
    .wc-block-cart,
    .modern-cart-wrapper {
        padding: 32px 20px 64px;
    }

    .wc-block-cart-item {
        grid-template-columns: 72px 1fr;
        gap: 14px;
    }

    .wc-block-cart-item__image {
        width: 72px !important;
        height: 72px !important;
    }

    .cart-item-card {
        grid-template-columns: 72px 1fr;
        gap: 14px;
    }

    .cart-item-image { width: 72px; height: 72px; }

    .cart-totals-sidebar,
    .wc-block-cart__sidebar {
        position: relative;
        top: 0;
    }
}
