/* === Cesta / lista de deseos === */

/* Badge "✓" en cards / photos cuando la foto ya está en la cesta.
   Funciona en cualquier elemento con [data-photo-id] que reciba la
   clase .in-cart vía JS (escuchando el evento cart:change). */
.cart-badge {
    position: absolute;
    top: 0.5rem; right: 0.5rem;
    width: 1.4rem; height: 1.4rem;
    background: rgba(201,169,110,0.9); color: #fff;
    border-radius: 50%;
    display: none;
    align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 600; line-height: 1;
    z-index: 5;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    pointer-events: none;
}
.in-cart > .cart-badge { display: flex; }

/* Botón cesta en la nav.
   Ahora es un <a>, así hereda automáticamente el color/peso/letra
   del resto de enlaces del nav (.nav a). Solo añadimos el flex + el badge. */
.cart-nav-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
}
.cart-nav-btn .badge {
    background: #c9a96e; color: #fff;
    min-width: 1.3rem; height: 1.3rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.65rem; font-weight: 600;
    letter-spacing: 0; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
}
.cart-nav-btn .badge.zero { display: none; }

/* Panel modal de la cesta. */
.cart-panel {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(0, 0, 0, 0.6);
    display: none; align-items: flex-start; justify-content: flex-end;
    opacity: 0; transition: opacity 0.25s ease;
}
.cart-panel.open { display: flex; opacity: 1; }
.cart-panel-inner {
    background: var(--panel-bg, #1b1a18); color: var(--fg, #e9e4d8);
    width: 100%; max-width: 480px; height: 100%;
    box-shadow: -20px 0 60px rgba(0,0,0,0.4);
    display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform 0.3s ease;
}
.cart-panel.open .cart-panel-inner { transform: none; }
.cart-panel-header {
    padding: 1.5rem 1.8rem 1rem;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--line, #2c2a26);
}
.cart-panel-header h2 {
    font-family: 'Cormorant Garamond', serif; font-weight: 400;
    font-size: 1.6rem; letter-spacing: 0.05em;
}
.cart-panel-close {
    background: none; border: 0; cursor: pointer;
    font-size: 1.8rem; line-height: 1; color: var(--muted, #8a8780);
}
.cart-panel-close:hover { color: var(--fg, #e9e4d8); }
.cart-items {
    flex: 1; overflow-y: auto;
    padding: 0.8rem 1.8rem;
}
.cart-item {
    display: flex; gap: 1rem; align-items: center;
    padding: 0.8rem 0; border-bottom: 1px solid var(--line, #2c2a26);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item img {
    width: 60px; height: 60px; object-fit: cover;
    background: #1a1a1a; flex-shrink: 0;
    user-select: none; -webkit-user-drag: none;
}
.cart-item .data { flex: 1; min-width: 0; }
.cart-item .title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    line-height: 1.2;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cart-item .title.empty { font-style: italic; color: var(--muted, #8a8780); }
.cart-item .file {
    font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase;
    color: var(--muted, #8a8780); margin-top: 0.2rem;
}
.cart-item .remove {
    background: none; border: 0; cursor: pointer;
    color: #b08080; font-size: 1.2rem; padding: 0 0.4rem;
}
.cart-item .remove:hover { color: #d04545; }
.cart-empty {
    text-align: center; padding: 4rem 1rem;
    color: var(--muted, #8a8780); font-size: 0.9rem; letter-spacing: 0.1em;
}
.cart-panel-footer {
    padding: 1.2rem 1.8rem 1.5rem;
    border-top: 1px solid var(--line, #2c2a26);
    display: flex; gap: 0.6rem; flex-direction: column;
}
.cart-panel-footer a.send,
.cart-panel-footer button.clear {
    font-family: inherit; cursor: pointer; text-decoration: none;
    padding: 0.9rem 1.2rem;
    font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
    text-align: center;
    transition: all 0.2s;
}
.cart-panel-footer a.send {
    background: var(--fg, #e9e4d8); color: var(--on-fg, #171614); border: 0;
}
.cart-panel-footer a.send.disabled {
    background: var(--btn-disabled-bg, #3a3833); color: var(--muted, #8a8780); pointer-events: none;
}
.cart-panel-footer button.clear {
    background: none; color: var(--muted, #97928a); border: 1px solid var(--btn-disabled-bg, #3a3833);
}
.cart-panel-footer button.clear:hover { color: var(--fg, #e9e4d8); }
