/* ============================================================================
   OLMITOS · Rediseño del sidebar de carrito (módulo sidcart)
   ----------------------------------------------------------------------------
   Diseño portado 1:1 desde el prototipo "Carrito Olmitos" (nuevo-diseno/).
   Se carga DESPUÉS de sidcart.css / sidcart-right.css en hookdisplayHeader(),
   por lo que sus reglas prevalecen. Todo vive dentro del módulo: al
   desactivarlo, este archivo deja de cargarse y el carrito vuelve al estilo
   original. No se toca el theme ni el core.

   Las reglas de layout del drawer se acotan bajo `.sb-menu-right` (el panel
   deslizante visible). El widget oculto #blockcart-wrapper (fuente del clon)
   no necesita estilo: está display:none.
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Quicksand:wght@400;500;600;700&display=swap');

:root {
    --olm-blue: #B1DDE1;
    --olm-blue-tint: #E6F4F5;
    --olm-blue-tint-2: #F3FAFB;
    --olm-teal: #3E9098;
    --olm-teal-deep: #327C84;
    --olm-ink: #5a6670;
    --olm-ink-2: #8b969e;
    --olm-ink-3: #aeb7bd;
    --olm-line: #edf0f1;
    --olm-line-2: #e3e7e9;
    --olm-radius: 16px;
}

/* ---------- drawer shell (override module defaults) ---------- */
.sb-menu-right {
    width: 100% !important;
    max-width: 456px !important;
    overflow: hidden !important;
    background: #fff;
    box-shadow: -18px 0 50px rgba(54, 98, 104, .18);
}
@media (max-width: 480px) {
    .sb-menu-right { max-width: 100% !important; }
}

.sb-menu-right #js-cart-sidcart,
.sb-menu-right .cart-preview { height: 100%; }

.sb-menu-right .sidcart-wrapper {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: none !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    font-family: 'Poppins', sans-serif;
    color: var(--olm-ink);
    -webkit-font-smoothing: antialiased;
}

/* close button (created by sidcart.js, repositioned to header top-right) */
.sb-menu-right .close-cart {
    position: absolute;
    top: 20px;
    right: 18px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 22px;
    color: var(--olm-ink-2);
    background: transparent;
    transition: .18s;
    z-index: 5;
    margin: 0;
}
.sb-menu-right .close-cart:hover { background: var(--olm-blue-tint); color: var(--olm-teal); }

/* ---------- header ---------- */
.sb-menu-right .d-head {
    padding: 22px 24px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--olm-line);
    flex: none;
}
.sb-menu-right .d-head .cart-ic {
    width: 38px; height: 38px;
    border-radius: 12px;
    background: var(--olm-blue-tint);
    display: grid; place-items: center;
    color: var(--olm-teal);
    flex: none;
}
.sb-menu-right .d-head .d-head-txt { flex: 1; min-width: 0; }
.sb-menu-right .d-head h2 {
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: #67737b;
    margin: 0;
    line-height: 1.1;
}
.sb-menu-right .d-head .count {
    font-size: 12px;
    color: var(--olm-ink-2);
    font-weight: 500;
    margin-top: 2px;
}

/* ---------- free shipping bar ---------- */
.sb-menu-right .ship {
    margin: 16px 20px 4px;
    background: linear-gradient(180deg, var(--olm-blue-tint-2), #fff);
    border: 1px solid var(--olm-blue-tint);
    border-radius: 14px;
    padding: 13px 16px;
    flex: none;
}
.sb-menu-right .ship.done { background: linear-gradient(180deg, #eef9f1, #fff); border-color: #d6efdd; }
.sb-menu-right .ship-row {
    display: flex; align-items: center; gap: 9px;
    font-size: 12.5px; color: var(--olm-ink); font-weight: 500; line-height: 1.35;
}
.sb-menu-right .ship-row b { color: var(--olm-teal-deep); font-weight: 700; }
.sb-menu-right .ship.done .ship-row b { color: #3a9b58; }
.sb-menu-right .ship-ic { flex: none; color: var(--olm-teal); display: grid; }
.sb-menu-right .ship.done .ship-ic { color: #3a9b58; }
.sb-menu-right .ship .bar {
    height: 7px; border-radius: 99px; background: #e9eff0; margin-top: 10px; overflow: hidden;
}
.sb-menu-right .ship .bar > i {
    display: block; height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--olm-blue), var(--olm-teal));
    transition: width .5s cubic-bezier(.22, 1, .36, 1);
}
.sb-menu-right .ship.done .bar > i { background: linear-gradient(90deg, #7fd09a, #3a9b58); }

/* ---------- items list ---------- */
.sb-menu-right .items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 20px 12px;
    margin: 0;
    list-style: none;
}
.sb-menu-right .items::-webkit-scrollbar { width: 8px; }
.sb-menu-right .items::-webkit-scrollbar-thumb { background: #e2e7e9; border-radius: 99px; }

.sb-menu-right .cart-product-line {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    margin: 0;
    border-bottom: 1px solid var(--olm-line);
    position: relative;
    list-style: none;
}
.sb-menu-right .cart-product-line .thumb {
    width: 84px; height: 84px;
    border-radius: 14px;
    flex: none;
    overflow: hidden;
    border: 1px solid var(--olm-line-2);
    background: var(--olm-blue-tint-2);
    display: block;
}
.sb-menu-right .cart-product-line .thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.sb-menu-right .it-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-menu-right .it-name {
    font-size: 14px; font-weight: 600; color: #67737b;
    line-height: 1.3; margin: 0 0 6px; padding-right: 30px;
    text-decoration: none; display: block;
}
.sb-menu-right .it-name:hover { color: var(--olm-teal); }

.sb-menu-right .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.sb-menu-right .chip {
    font-size: 11px; font-weight: 500; color: #76828a;
    background: #f4f7f7; border: 1px solid var(--olm-line-2);
    border-radius: 99px; padding: 3px 9px;
    display: inline-flex; align-items: center; gap: 5px;
}
.sb-menu-right .chip .chip-k { color: #9aa3aa; }
.sb-menu-right .chip .dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .12);
    flex: none; display: inline-block;
}

.sb-menu-right .it-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-top: auto;
}

/* stepper (keeps module JS hook classes) */
.sb-menu-right .stepper {
    display: inline-flex; align-items: center;
    background: var(--olm-blue-tint-2);
    border: 1px solid var(--olm-blue-tint);
    border-radius: 99px;
    padding: 2px 3px; /* alto más fino sin cambiar el ancho */
}
.sb-menu-right .stepper .quantity-button-sidcart {
    width: 26px; height: 22px;
    border-radius: 99px;
    display: grid; place-items: center;
    color: var(--olm-teal);
    font-size: 17px; line-height: 1;
    cursor: pointer; user-select: none;
    transition: .15s;
}
.sb-menu-right .stepper .quantity-button-sidcart:hover { background: var(--olm-blue); color: #fff; }
.sb-menu-right .stepper .product-qty-input {
    border: none; background: transparent; box-shadow: none; outline: none;
    width: 30px; min-width: 30px;
    /* el theme fuerza height/line-height:40px en los input → lo anulamos */
    height: 22px !important; line-height: 22px !important; min-height: 0 !important;
    padding: 0; margin: 0;
    text-align: center; font-size: 13px; font-weight: 600; color: #67737b;
    -moz-appearance: textfield;
}
.sb-menu-right .stepper .product-qty-input::-webkit-outer-spin-button,
.sb-menu-right .stepper .product-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.sb-menu-right .it-price {
    font-size: 15px; font-weight: 700; color: #5a6670; white-space: nowrap; text-align: right;
}
.sb-menu-right .it-price small {
    display: block; font-size: 10.5px; font-weight: 500; color: var(--olm-ink-3); text-align: right;
}

/* remove (trash) — top-right of the line */
.sb-menu-right .cart-product-line .remove-from-cart {
    position: absolute; top: 14px; right: 0;
    width: 30px; height: 30px;
    border-radius: 9px;
    display: grid; place-items: center;
    color: var(--olm-ink-3);
    transition: .16s;
}
.sb-menu-right .cart-product-line .remove-from-cart:hover { background: #fdecec; color: #e06363; }

/* ---------- empty state ---------- */
.sb-menu-right .empty {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; padding: 40px; gap: 6px;
}
.sb-menu-right .empty .e-ic {
    width: 84px; height: 84px; border-radius: 24px;
    background: var(--olm-blue-tint);
    display: grid; place-items: center;
    color: var(--olm-teal); margin-bottom: 10px;
}
.sb-menu-right .empty h3 { font-family: 'Quicksand', sans-serif; font-weight: 600; color: #67737b; margin: 0; font-size: 19px; }
.sb-menu-right .empty p { font-size: 13px; color: var(--olm-ink-2); margin: 0 0 14px; max-width: 240px; line-height: 1.5; }

/* ---------- footer ---------- */
.sb-menu-right .foot {
    border-top: 1px solid var(--olm-line);
    padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
    background: #fff;
    flex: none;
}
.sb-menu-right .sumrow {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12.5px; color: var(--olm-ink-2); margin-bottom: 6px;
}
.sb-menu-right .sumrow .ship-free { color: #3a9b58; font-weight: 600; }
.sb-menu-right .totrow {
    display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 14px;
}
.sb-menu-right .totrow .lbl { font-family: 'Quicksand', sans-serif; font-weight: 600; font-size: 16px; color: #67737b; }
.sb-menu-right .totrow .amt { font-size: 24px; font-weight: 700; color: #4f5b64; }
.sb-menu-right .totrow .amt small { font-size: 11px; font-weight: 500; color: var(--olm-ink-3); margin-left: 4px; }

.sb-menu-right .cta {
    width: 100%; height: 52px; border-radius: 14px;
    background: #b1dde1; color: #2c6e74; /* azul de marca + texto legible sobre claro */
    font-weight: 600; font-size: 15px; letter-spacing: .03em;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    text-decoration: none; border: none; cursor: pointer;
    transition: .18s; box-shadow: 0 8px 20px rgba(132, 190, 196, .45);
}
.sb-menu-right .cta:hover {
    background: #9ed4d9; color: #245f66;
    transform: translateY(-1px); box-shadow: 0 12px 26px rgba(132, 190, 196, .5);
}
.sb-menu-right .cta:active { transform: translateY(0); }

.sb-menu-right .ghost-btn {
    width: 100%; height: 46px; border-radius: 14px;
    background: #fff; border: 1.5px solid var(--olm-blue); color: var(--olm-teal);
    font-weight: 600; font-size: 13.5px; letter-spacing: .03em;
    margin-top: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: .18s;
}
.sb-menu-right .ghost-btn:hover { background: var(--olm-blue-tint); color: var(--olm-teal); }

.sb-menu-right .trust {
    display: flex; align-items: center; justify-content: center; gap: 18px;
    margin-top: 14px; color: var(--olm-ink-3); font-size: 10.5px; font-weight: 500;
}
.sb-menu-right .trust span { display: flex; align-items: center; gap: 5px; }
