/**
 * Heartbit – Cart Styles
 * Estilo: tarjeta limpia, fondo gris, sin tabla
 */

/* ============================================================
   Wrap y layout
   ============================================================ */
.hb-cart-wrap {
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 0;
    background: transparent;
}

.hb-cart-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.hb-cart-count {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
    margin: 0;
}

.hb-cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

/* ============================================================
   Sidebar derecha — sticky
   ============================================================ */
.hb-cart-sidebar {
    position: sticky;
    top: 100px;
}

/* ============================================================
   Sin cabecera de tabla
   ============================================================ */
.hb-cart-header {
    display: none;
}

/* ============================================================
   Tarjeta por producto
   ============================================================ */
.hb-cart-row {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    background: #f5f5f5;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: relative;
    border-bottom: 1px solid #efefef;
}

/* ============================================================
   Imagen
   ============================================================ */
.hb-cart-row__img {
    flex: 0 0 clamp( 140px, 18vw, 260px );
    width: clamp( 140px, 18vw, 260px );
    border-radius: 12px;
    overflow: hidden;
    background: #f5f5f5;
}

.hb-cart-row__img a,
.hb-cart-row__img img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* ============================================================
   Columna de info — crece
   ============================================================ */
.hb-cart-row__product {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.hb-cart-row__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Nombre */
.hb-cart-row__name a {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
    line-height: 1.3;
    display: block;
}

.hb-cart-row__name a:hover { color: #555; }

/* Descripción corta */
.hb-cart-row__excerpt {
    font-size: 13px;
    color: #aaa;
    line-height: 1.5;
    margin: 0;
}

/* Referencia / SKU */
.hb-cart-row__sku {
    font-size: 12px;
    color: #aaa;
    letter-spacing: 0.02em;
}

/* Meta variaciones (talla, color...) */
.hb-cart-row__product dl.variation {
    margin: 4px 0 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 8px;
    font-size: 13px;
}

.hb-cart-row__product dl.variation dt {
    font-weight: 600;
    color: #555;
}

.hb-cart-row__product dl.variation dd {
    color: #333;
    margin: 0;
}

/* Campos personalizados */
.hb-cart-row__custom-meta {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 8px;
    font-size: 13px;
}

.hb-cart-row__custom-meta li {
    display: contents;
}

.hb-meta-label {
    font-weight: 600;
    color: #555;
}

.hb-meta-value {
    color: #333;
}

/* Cantidad */
.hb-cart-row__qty-inline {
    font-size: 13px;
    color: #aaa;
}

/* Botón eliminar — esquina superior derecha */
.hb-cart-remove {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 50%;
    color: #999;
    text-decoration: none;
    font-size: 16px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.hb-cart-remove:hover {
    background: #fde8e8;
    color: #b32d2e;
}

/* ============================================================
   Bloque inferior de la tarjeta: cantidad + precio
   ============================================================ */
.hb-cart-row__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    width: 100%;
    /* dentro de .hb-cart-row__info */
}

.hb-cart-row__footer .quantity input {
    width: 52px;
    text-align: center;
    padding: 7px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fafafa;
}

.hb-cart-row__subtotal {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

/* Ocultar columnas que ya no usamos como columna separada */
.hb-cart-row__price { display: none; }

/* ============================================================
   Acciones — cupón + actualizar
   ============================================================ */
.hb-cart-actions {
    display: none; /* Movido al topbar — ver .hb-cart-topbar */
}

.hb-cart-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.hb-cart-coupon {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 220px;
}

.hb-cart-coupon input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 13px;
    background: #fafafa;
}

.hb-btn-coupon,
.hb-btn-update {
    padding: 10px 20px;
    font-size: 13px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
}

.hb-btn-coupon {
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #555;
}

.hb-btn-update {
    background: #1a1a1a;
    border: 1px solid #1a1a1a;
    color: #fff;
}

.hb-btn-coupon:hover { background: #f5f5f5; }
.hb-btn-update:hover { background: #333; }

/* ============================================================
   Card de totales (Order summary)
   ============================================================ */
/* Override WooCommerce — fuerza ancho 100% en el sidebar */
.woocommerce .cart-collaterals .cart_totals,
.woocommerce-page .cart-collaterals .cart_totals {
    width: 100% !important;
    float: none !important;
}

.hb-cart-sidebar .cart_totals {
    background: #f5f5f5;
    border-radius: 16px;
    padding: 24px;
}

.hb-cart-sidebar .cart_totals h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px;
    padding: 0;
    border: none;
}

.hb-cart-sidebar .shop_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.hb-cart-sidebar .shop_table th,
.hb-cart-sidebar .shop_table td {
    padding: 8px 0;
    border: none;
    vertical-align: middle;
}

.hb-cart-sidebar .shop_table th {
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
    width: 50%;
}

.hb-cart-sidebar .shop_table td {
    text-align: right;
    font-weight: 700;
    color: #1a1a1a;
    font-size: 15px;
}

.hb-cart-sidebar .order-total th,
.hb-cart-sidebar .order-total td {
    font-size: 16px;
    padding-top: 16px;
}

.hb-cart-sidebar .wc-proceed-to-checkout {
    margin-top: 20px;
}

/* Botón checkout — pill rojo */
.hb-cart-sidebar .checkout-button {
    display: block;
    width: 100%;
    padding: 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: #d0021b;
    color: #fff !important;
    border-radius: 50px;
    text-decoration: none;
    transition: background 0.2s;
    border: none;
}

.hb-cart-sidebar .checkout-button:hover {
    background: #a80016;
}

.hb-cart-sidebar .cart-collaterals {
    margin-bottom: 2%;
}
.hb-cart-sidebar .woocommerce-form-coupon-toggle,
.hb-cart-sidebar .coupon {
    margin-top: 12px;
}

/* ============================================================
   Responsive — Tablet (600–1024px)
   ============================================================ */
@media ( max-width: 1024px ) {
    .hb-cart-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hb-cart-sidebar {
        position: static;
    }
}

/* ============================================================
   Responsive — Móvil (< 600px)
   ============================================================ */
@media ( max-width: 600px ) {
    .hb-cart-row {
        flex-direction: column;
        gap: 16px;
    }

    .hb-cart-row__img {
        width: 100%;
        flex: none;
        max-height: 240px;
    }

    .hb-cart-row__img img {
        aspect-ratio: 4 / 3;
        object-fit: cover;
    }

    .hb-cart-remove {
        top: 12px;
        right: 12px;
    }

    .hb-cart-coupon {
        width: 100%;
        min-width: 0;
        flex-direction: column;
    }
}
