/* Carrito offcanvas + skeleton de carga.
   Portado de los bloques inline que DTS tiene dentro de header-user.phtml, a un
   archivo propio para no inflar el header. Los prefijos .dts- se renombraron a .kmma-. */

/* Skeleton: cart offcanvas */
.cart-oc-skeleton { padding: 1rem 0; }
.cart-oc-skel-item {
    display: flex; gap: .85rem;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}
.skel-img {
    width: 70px; height: 70px; flex-shrink: 0;
    background: linear-gradient(90deg, #eee 0%, #f5f5f5 50%, #eee 100%);
    background-size: 200% 100%;
    animation: skel-shimmer 1.4s infinite linear;
}
.cart-oc-skel-item .skel-info { flex: 1; display: flex; flex-direction: column; gap: .4rem; padding-top: .3rem; }
.skel-line {
    height: 10px; border-radius: 3px;
    background: linear-gradient(90deg, #eee 0%, #f5f5f5 50%, #eee 100%);
    background-size: 200% 100%;
    animation: skel-shimmer 1.4s infinite linear;
}
.skel-line--lg { width: 85%; }
.skel-line--md { width: 60%; }
.skel-line--sm { width: 35%; }
.cart-oc-skel-totals { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .55rem; border-top: 1px solid #f0f0f0; margin-top: .5rem; }
@keyframes skel-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================
 *  Offcanvas Carrito (DTS B&W)
 * ============================ */
.cart-oc-shell { width: 400px !important; max-width: 100vw; border-left: 1px solid #e5e5e5; }
@media (max-width: 480px) { .cart-oc-shell { width: 100vw !important; } }
.cart-oc-shell__header {
    border-bottom: 1px solid #e5e5e5;
    padding: 1rem 1.25rem;
}
.cart-oc-shell__header h5 {
    font-weight: 700;
    letter-spacing: -.3px;
    color: #000;
}
.cart-oc-shell__body { display: flex; flex-direction: column; }
.cart-oc {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Empty state */
.cart-oc--empty .cart-oc__empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6c757d;
}
.cart-oc__empty i { font-size: 3rem; color: #ccc; margin-bottom: 1rem; }
.cart-oc__empty-title { font-size: 1.1rem; font-weight: 700; color: #000; margin-bottom: .5rem; }
.cart-oc__empty-text { font-size: .85rem; margin-bottom: 1.25rem; }

/* Banner cupón */
.cart-oc__banner {
    padding: .55rem 1rem;
    background: #fafafa;
    border-bottom: 1px solid #e5e5e5;
    font-size: .8rem;
    color: #000;
}
.cart-oc__banner i { margin-right: .35rem; color: #6c757d; }

/* Barra envío gratis */
.cart-oc__shipping {
    padding: .75rem 1.25rem;
    background: #fafafa;
    border-bottom: 1px solid #e5e5e5;
}
.cart-oc__shipping-msg {
    font-size: .82rem;
    color: #333;
    text-align: center;
    margin-bottom: .5rem;
}
.cart-oc__shipping-msg--ok { color: #1a7c3a; }
.cart-oc__shipping-msg i { margin-right: .35rem; }
.cart-oc__progress {
    height: 4px;
    background: #e5e5e5;
    overflow: hidden;
}
.cart-oc__progress-bar {
    height: 100%;
    background: #000;
    transition: width .4s ease;
}

/* Items */
.cart-oc__items { flex: 1; overflow-y: auto; padding: .25rem 0; min-height: 120px; }
.cart-oc__item {
    display: flex;
    gap: .75rem;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}
.cart-oc__item-img {
    width: 70px; height: 70px;
    flex-shrink: 0;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.cart-oc__item-img img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 4px; }
.cart-oc__item-info { flex: 1; min-width: 0; padding-right: 1.5rem; }
.cart-oc__item-name {
    font-size: .85rem; font-weight: 500; color: #000;
    line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.cart-oc__item-meta { font-size: .7rem; color: #6c757d; margin-top: .15rem; }
.cart-oc__item-promo {
    display: inline-block;
    background: #1a1a1a; color: #fff;
    font-size: .65rem; padding: .1rem .4rem;
    border-radius: 2px; margin-top: .25rem;
    text-transform: uppercase; letter-spacing: .5px;
}
.cart-oc__item-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: .45rem; gap: .5rem;
}
.cart-oc__qty {
    display: flex; align-items: center;
    border: 1px solid #e5e5e5;
}
.cart-oc__qty-btn {
    width: 26px; height: 26px;
    border: 0; background: transparent;
    font-size: .9rem; color: #000;
    cursor: pointer; line-height: 1;
}
.cart-oc__qty-btn:hover { background: #fafafa; }
.cart-oc__qty-input {
    width: 32px; height: 26px;
    border: 0; border-left: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5;
    text-align: center; font-size: .8rem;
    -moz-appearance: textfield;
}
.cart-oc__qty-input::-webkit-outer-spin-button,
.cart-oc__qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cart-oc__item-price { text-align: right; font-size: .85rem; }
.cart-oc__item-price-old {
    display: block; font-size: .7rem; color: #999;
    text-decoration: line-through;
}
.cart-oc__item-price-now { font-weight: 700; color: #000; }
.cart-oc__remove {
    position: absolute; top: .5rem; right: .85rem;
    width: 22px; height: 22px;
    border: 0; background: transparent;
    color: #999; font-size: .9rem; cursor: pointer;
    transition: color .15s ease;
}
.cart-oc__remove:hover { color: #000; }

/* Cross-sell carrusel */
.cart-oc__related {
    background: #fafafa;
    padding: .85rem 1.25rem;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
}
.cart-oc__related-title {
    font-size: .7rem; text-transform: uppercase; letter-spacing: 1px;
    color: #6c757d; font-weight: 600; margin-bottom: .6rem;
}
.cart-oc__related-carousel { position: relative; min-height: 64px; }
.cart-oc__related-slide {
    display: flex; align-items: center; gap: .75rem;
    background: #fff; border: 1px solid #e5e5e5; padding: .5rem;
    position: relative;
}
.cart-oc__related-slide[hidden] { display: none; }
.cart-oc__related-img { width: 54px; height: 54px; flex-shrink: 0; display: block; background: #fafafa; overflow: hidden; }
.cart-oc__related-img img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.cart-oc__related-info { flex: 1; min-width: 0; padding-right: 2rem; }
.cart-oc__related-name {
    display: block; font-size: .78rem; color: #000;
    text-decoration: none; font-weight: 500;
    line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.cart-oc__related-name:hover { color: #000; text-decoration: underline; }
.cart-oc__related-price { font-size: .85rem; font-weight: 700; color: #000; margin-top: .15rem; }
.cart-oc__related-add {
    position: absolute; top: 50%; right: .5rem; transform: translateY(-50%);
    width: 32px; height: 32px; border-radius: 50%;
    background: #000; color: #fff; border: 0;
    font-size: 1.1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s ease;
}
.cart-oc__related-add:hover { background: #333; }
.cart-oc__related-dots {
    display: flex; justify-content: center; gap: .35rem; margin-top: .6rem;
}
.cart-oc__related-dot {
    width: 6px; height: 6px; border-radius: 50%;
    border: 0; background: #ccc; cursor: pointer; padding: 0;
}
.cart-oc__related-dot.is-active { background: #000; }

/* Gift */
.cart-oc__gift {
    display: flex; align-items: center; gap: .5rem;
    padding: .7rem 1.25rem;
    border-top: 1px solid #e5e5e5;
    cursor: pointer;
    font-size: .82rem; color: #000;
    user-select: none;
}
.cart-oc__gift input { margin: 0; accent-color: #000; }
.cart-oc__gift i { color: #6c757d; }

/* Totales */
.cart-oc__totals {
    padding: .85rem 1.25rem .25rem;
    border-top: 1px solid #e5e5e5;
}
.cart-oc__totals-row {
    display: flex; justify-content: space-between;
    font-size: .85rem; color: #555;
    padding: .15rem 0;
}
.cart-oc__totals-row--discount { color: #1a7c3a; }
.cart-oc__totals-row--total {
    font-size: 1rem; font-weight: 700; color: #000;
    border-top: 1px solid #f0f0f0; margin-top: .35rem; padding-top: .5rem;
}
.cart-oc__quote {
    display: flex; align-items: center; gap: .75rem;
    padding: .25rem 0;
}
.cart-oc__quote i { font-size: 1.5rem; color: #8B5CF6; }
.cart-oc__quote strong { display: block; color: #000; font-size: .9rem; }
.cart-oc__quote small { color: #6c757d; font-size: .75rem; }

/* CTAs */
.cart-oc__ctas {
    display: flex; flex-direction: column; gap: .5rem;
    padding: .85rem 1.25rem 1.25rem;
}
.cart-oc__cta-primary,
.cart-oc__cta-secondary {
    display: block; text-align: center;
    padding: .85rem 1rem;
    font-size: .85rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.cart-oc__cta-primary { background: #000; color: #fff; border: 1px solid #000; }
.cart-oc__cta-primary:hover { background: #333; color: #fff; border-color: #333; }
.cart-oc__cta-secondary { background: #fff; color: #000; border: 1px solid #000; }
.cart-oc__cta-secondary:hover { background: #fafafa; color: #000; }
