/* Hallmark · component: cart drawer · theme: existing Anúnciate Hoy · tone: restrained, clear
 * pre-emit critique: P5 H5 E4 S5 R5 V4 · states: default hover focus active disabled loading error success */
@import url('./tokens.css');
.ah-cart-drawer {
    --cd-paper: var(--ah-dashboard-color-paper);
    --cd-surface: var(--ah-dashboard-color-paper-2);
    --cd-ink: var(--ah-dashboard-color-ink);
    --cd-muted: var(--ah-dashboard-color-muted);
    --cd-line: var(--ah-dashboard-color-rule);
    --cd-accent: var(--ah-dashboard-color-accent);
    --cd-accent-soft: var(--ah-dashboard-color-accent-soft);
    --cd-success: var(--ah-dashboard-color-success);
    --cd-success-soft: var(--ah-dashboard-color-success-soft);
    --cd-shadow: oklch(.2 .012 258 / .16);
    --cd-backdrop: oklch(.2 .012 258 / .42);
    position: fixed;
    inset: 0 0 0 auto;
    width: min(480px,100%);
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--cd-surface);
    color: var(--cd-ink);
    box-shadow: -16px 0 64px var(--cd-shadow);
    font-family: var(--ah-dashboard-font-body);
    font-size: 14px;
    line-height: 1.5;
    overflow: clip;
    transform: translateX(100%);
    transition: transform 240ms var(--ease-out);
    z-index: 2147483000;
}
.ah-cart-drawer.is-open {
    transform: translateX(0);
}
.ah-cart-drawer::backdrop {
    background: var(--cd-backdrop);
}
html.ah-cart-is-open,html.ah-cart-is-open body {
    overflow: clip;
}
.ah-cart-drawer * {
    box-sizing: border-box;
    min-width: 0;
}
.ah-cart-drawer [hidden] {
    display: none!important;
}
.ah-cart-drawer button,.ah-cart-drawer input {
    font: inherit;
}
.ah-cart-drawer button {
    cursor: pointer;
}
.ah-cart-drawer a {
    text-decoration: none;
}
.ah-cart-drawer :focus-visible {
    outline: 3px solid var(--ah-dashboard-color-focus);
    outline-offset: 3px;
}
.ahcd-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.ahcd-head {
    padding: 28px 28px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.ahcd-head h2 {
    font: 700 27px/1.2 var(--ah-dashboard-font-display);
    letter-spacing: -.8px;
    margin: 10px 0 0;
    color: var(--cd-ink);
}
.ahcd-head h2 span {
    font-size: 14px;
    letter-spacing: 0;
    color: var(--cd-muted);
    margin-left: 10px;
}
.ahcd-added {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--cd-muted);
}
.ahcd-added.is-added {
    color: var(--cd-success);
}
.ahcd-intro {
    margin: 0;
    padding: 0 28px 24px;
    color: var(--cd-muted);
    font-size: 13px;
    border-bottom: 1px solid var(--cd-line);
}
.ahcd-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--cd-line);
    border-radius: 50%;
    background: var(--cd-surface);
    color: var(--cd-muted);
    padding: 0;
}
.ahcd-icon:hover {
    background: var(--cd-paper);
    color: var(--cd-ink);
}
.ahcd-remove {
    border-color: transparent;
    width: 30px;
    height: 30px;
    font-size: 14px;
}
.ahcd-remove:hover {
    background: var(--cd-accent-soft);
    color: var(--cd-accent);
}
.ahcd-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.ahcd-form {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.ahcd-items {
    padding: 24px 28px;
    flex: 1;
    background: var(--cd-paper);
}
.ahcd-item {
    border: 1px solid var(--cd-line);
    border-radius: 12px;
    background: var(--cd-surface);
    padding: 16px;
    margin-bottom: 16px;
}
.ahcd-item-top {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.ahcd-photo {
    width: 80px;
    flex-shrink: 0;
}
.ahcd-photo img {
    width: 80px;
    height: 94px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.ahcd-item-info {
    flex: 1;
}
.ahcd-type {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--cd-muted);
    margin-bottom: 6px;
}
.ahcd-name {
    display: block;
    font: 700 14px/1.4 var(--ah-dashboard-font-display);
    color: var(--cd-ink);
    overflow-wrap: anywhere;
}
.ahcd-name:hover {
    color: var(--cd-accent);
}
.ahcd-item-info p {
    font-size: 11px;
    line-height: 1.5;
    color: var(--cd-muted);
    margin: 7px 0;
}
.ahcd-price {
    font: 700 15px/1.5 var(--ah-dashboard-font-display);
    font-variant-numeric: tabular-nums;
}
.ahcd-price small {
    font: 400 10px var(--ah-dashboard-font-body);
    color: var(--cd-muted);
}
.ahcd-dates {
    border-top: 1px solid var(--cd-line);
    padding-top: 14px;
    margin-top: 14px;
    display: grid;
    grid-template-columns: minmax(0,1fr) 12px minmax(0,1fr);
    gap: 8px;
    align-items: center;
}
.ahcd-dates label {
    margin: 0;
    font-size: 10px;
    font-weight: 600;
    color: var(--cd-muted);
}
.ahcd-dates>span {
    margin-top: 18px;
    color: var(--cd-muted);
}
.ahcd-dates input {
    appearance: none;
    display: block;
    width: 100%;
    height: 40px;
    min-height: 40px;
    padding: 7px 8px;
    margin: 5px 0 0;
    border: 1px solid var(--cd-line);
    border-radius: 6px;
    background: var(--cd-surface);
    color: var(--cd-ink);
    font-size: 11px;
}
.ahcd-item-note {
    margin: 10px 0 0;
    color: var(--cd-muted);
    font-size: 10px;
}
.ahcd-help {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 4px 4px 0;
    color: var(--cd-muted);
    font-size: 11px;
    line-height: 1.6;
}
.ahcd-help>i {
    color: var(--cd-accent);
    font-size: 18px;
    margin-top: 2px;
}
.ahcd-help p {
    margin: 0;
}
.ahcd-help strong {
    color: var(--cd-ink);
    font-weight: 600;
}
.ahcd-footer {
    position: sticky;
    bottom: 0;
    background: var(--cd-surface);
    padding: 22px 28px max(20px,env(safe-area-inset-bottom));
    border-top: 1px solid var(--cd-line);
    z-index: 2;
}
.ahcd-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.ahcd-subtotal span {
    font-weight: 600;
    font-size: 13px;
}
.ahcd-subtotal small {
    display: block;
    color: var(--cd-muted);
    font-size: 10px;
    margin-top: 3px;
}
.ahcd-subtotal strong {
    font: 700 25px/1.25 var(--ah-dashboard-font-display);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.7px;
}
.ahcd-footnote {
    font-size: 10px;
    line-height: 1.6;
    color: var(--cd-muted);
    margin: 12px 0 16px;
}
.ahcd-btn {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 48px;
    border-radius: 8px;
    padding: 12px 18px;
    border: 1px solid var(--cd-line);
    background: var(--cd-surface);
    color: var(--cd-ink);
    font-weight: 700;
    white-space: nowrap;
}
.ahcd-btn--primary {
    background: var(--cd-accent);
    border-color: var(--cd-accent);
    color: var(--cd-surface);
}
.ahcd-btn--primary:hover {
    filter: brightness(.94);
}
.ahcd-btn:active {
    transform: translateY(1px);
}
.ah-cart-drawer button:disabled {
    opacity: .5;
    cursor: wait;
}
.ahcd-footer-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}
.ahcd-footer-links button,.ahcd-footer-links a {
    border: 0;
    background: none;
    color: var(--cd-muted);
    font-size: 10px;
    padding: 3px 0;
    white-space: nowrap;
}
.ahcd-footer-links button:hover,.ahcd-footer-links a:hover {
    color: var(--cd-ink);
}
.ahcd-empty {
    padding: 64px 32px;
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 16px;
}
.ahcd-empty-icon {
    display: grid;
    place-items: center;
    background: var(--cd-accent-soft);
    color: var(--cd-accent);
    height: 64px;
    width: 64px;
    border-radius: 50%;
    font-size: 25px;
}
.ahcd-empty h3 {
    font: 700 23px/1.3 var(--ah-dashboard-font-display);
    margin: 8px 0 0;
    color: var(--cd-ink);
}
.ahcd-empty p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--cd-muted);
    margin: 0 0 8px;
}
.ahcd-loading {
    padding: 44px 28px;
    display: grid;
    gap: 16px;
}
.ahcd-skeleton {
    background: var(--cd-paper);
    height: 128px;
    border-radius: 12px;
    animation: ahcd-load 1s var(--ease-in-out) infinite alternate;
}
.ahcd-error {
    padding: 12px 18px;
    margin: 0 20px 16px;
    color: var(--cd-accent);
    background: var(--cd-accent-soft);
    border-radius: 8px;
    font-size: 12px;
}
.ahcd-error button {
    background: none;
    border: 0;
    text-decoration: underline;
    color: inherit;
    margin-left: 8px;
}
.ahcd-content[aria-busy=true] {
    pointer-events: none;
    opacity: .7;
}
@keyframes ahcd-load {
    to {
        opacity: .5;
    }
}
@media(max-width:500px) {
    .ahcd-head {
        padding: 22px 20px 8px;
    }
    .ahcd-intro {
        padding: 0 20px 20px;
    }
    .ahcd-items {
        padding: 18px 16px;
    }
    .ahcd-footer {
        padding: 18px 20px max(20px,env(safe-area-inset-bottom));
    }
    .ahcd-item {
        padding: 14px;
    }
    .ahcd-dates input {
        font-size: 11px;
        padding: 6px;
    }
    .ahcd-subtotal strong {
        font-size: 23px;
    }
    .ahcd-head h2 {
        font-size: 25px;
    }
}
@media(prefers-reduced-motion:reduce) {
    .ah-cart-drawer {
        transition: none;
    }
    .ahcd-skeleton {
        animation: none;
    }
}
.ahcd-help p {
    font-size: 11px;
    line-height: 1.7;
}
@media(pointer:coarse) {
    .ahcd-dates input {
        min-height: 44px;
        height: 44px;
    }
}
.ahcd-item.is-just-added {
    border-color: var(--cd-accent);
}
.ahcd-new {
    display: inline-flex;
    margin-bottom: 12px;
    border-radius: 4px;
    padding: 3px 7px;
    background: var(--cd-success-soft);
    color: var(--cd-success);
    font-size: 10px;
    font-weight: 700;
}
