/* =================================================================
   MM Conversion Stack — Gifts v3 (frontend styles)
   Estética editorial / Lady Pipa: negro, blanco, mostaza dorado,
   beige champagne. Sin verde, sin emojis, líneas finas, espacios amplios.

   Paleta:
     #000000  texto principal
     #ffffff  fondo
     #b5a242  acento mostaza (igual que botones del tema)
     #8b7d2f  acento mostaza oscuro (hover)
     #ede8df  beige champagne (fondos sutiles)
     #d5cdb7  beige medio (bordes)
     #999999  texto secundario
     #cccccc  bordes locked
   ================================================================= */

/* =================================================================
   1) GIFT BAR (en side cart, debajo de free shipping)
   ================================================================= */
.mmcs-gift-bar {
    background: #fff;
    border-top: 1px solid #ece8e0;
    padding: 18px 28px 16px;
}

@media (max-width: 600px) {
    .mmcs-gift-bar { padding: 16px 20px 14px; }
}

/* Header: label "REGALOS" + mensaje contextual */
.mmcs-gift-bar__header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}
.mmcs-gift-bar__label {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: #b5a242;
    flex-shrink: 0;
}
.mmcs-gift-bar__text {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #000;
    letter-spacing: 0.01em;
}
.mmcs-gift-bar__text strong {
    font-weight: 600;
    color: #000;
}

/* Track: línea fina con dots minimalistas */
.mmcs-gift-bar__track {
    position: relative;
    height: 1px;
    background: #e8e4dc;
    margin: 4px 6px 24px;
}
.mmcs-gift-bar__fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #b5a242;
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.mmcs-gift-bar__milestone {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}
.mmcs-gift-bar__dot {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #ccc;
    transition: all 0.3s ease;
}
.mmcs-gift-bar__milestone.is-reached .mmcs-gift-bar__dot {
    background: #b5a242;
    border-color: #b5a242;
}
.mmcs-gift-bar__milestone.is-locked .mmcs-gift-bar__dot {
    background: #fff;
    border-color: #d5cdb7;
}

/* Lista numerada (01, 02, 03) */
.mmcs-gift-bar__rules {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: gift-counter;
    border-top: 1px solid #ece8e0;
}
.mmcs-gift-rule-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #ece8e0;
    font-size: 0.8rem;
    line-height: 1.3;
}
.mmcs-gift-rule-row:last-child { border-bottom: none; }

.mmcs-gift-rule-row__num {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: #b5a242;
    width: 26px;
}

.mmcs-gift-rule-row__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.mmcs-gift-rule-row__name {
    color: #000;
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mmcs-gift-rule-row__threshold {
    color: #999;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

.mmcs-gift-rule-row__status {
    flex-shrink: 0;
    text-align: right;
    font-size: 0.72rem;
}

/* Estados */
.mmcs-gift-rule-row__claimed {
    color: #b5a242;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.66rem;
}
.mmcs-gift-rule-row__pending {
    color: #999;
    font-style: italic;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
}
.mmcs-gift-rule-row__locked {
    color: #999;
    letter-spacing: 0.02em;
    font-size: 0.72rem;
}

.mmcs-gift-rule-row.is-locked .mmcs-gift-rule-row__num,
.mmcs-gift-rule-row.is-locked .mmcs-gift-rule-row__name { color: #999; }
.mmcs-gift-rule-row.is-locked .mmcs-gift-rule-row__threshold { color: #bbb; }

.mmcs-gift-rule-row.is-claimed .mmcs-gift-rule-row__name { color: #000; }

/* CTA "Elige tu regalo" */
.mmcs-gift-rule-row__cta {
    background: transparent;
    color: #000;
    border: none;
    border-bottom: 1px solid #b5a242;
    padding: 4px 0;
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    font-family: inherit;
    line-height: 1;
}
.mmcs-gift-rule-row__cta:hover {
    color: #b5a242;
    border-bottom-color: #8b7d2f;
}
.mmcs-gift-rule-row__cta:focus-visible {
    outline: 1px dotted #b5a242;
    outline-offset: 3px;
}

/* =================================================================
   2) POPUP modal (editorial, solo selectivos)
   ================================================================= */

.mmcs-gift-popup[hidden] { display: none; }

.mmcs-gift-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.mmcs-gift-popup.is-open { opacity: 1; }

.mmcs-gift-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 18, 14, 0.65);
    cursor: pointer;
}

.mmcs-gift-popup__dialog {
    position: relative;
    background: #fff;
    border-radius: 0;
    padding: 0;
    max-width: 680px;
    width: 100%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
    transform: translateY(24px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                opacity   0.4s ease;
    max-height: 90vh;
    overflow-y: auto;
}
.mmcs-gift-popup.is-open .mmcs-gift-popup__dialog {
    transform: translateY(0);
    opacity: 1;
}

.mmcs-gift-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    color: #000;
    cursor: pointer;
    font-family: inherit;
    z-index: 2;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}
.mmcs-gift-popup__close:hover { color: #b5a242; }

.mmcs-gift-popup__header {
    text-align: center;
    padding: 56px 40px 24px;
}

.mmcs-gift-popup__eyebrow {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    color: #b5a242;
    margin-bottom: 16px;
}

.mmcs-gift-popup__title {
    margin: 0 0 10px;
    font-size: 1.6rem;
    line-height: 1.15;
    font-weight: 300;
    color: #000;
    letter-spacing: 0.02em;
}

.mmcs-gift-popup__counter {
    margin: 0;
    font-size: 0.74rem;
    color: #666;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mmcs-gift-popup__products {
    padding: 8px 40px 28px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: #ece8e0;
    border-top: 1px solid #ece8e0;
    border-bottom: 1px solid #ece8e0;
    margin: 0 40px;
}

.mmcs-gift-popup__footnote {
    padding: 20px 40px 36px;
    margin: 0;
    font-size: 0.7rem;
    color: #999;
    text-align: center;
    line-height: 1.5;
    letter-spacing: 0.02em;
}

/* Cards de producto en el popup — estilo editorial horizontal */
.mmcs-gift-popup-product {
    background: #fff;
    border: none;
    padding: 18px 8px;
    cursor: pointer;
    transition: background 0.25s ease;
    display: flex;
    align-items: center;
    gap: 18px;
    font-family: inherit;
    text-align: left;
    width: 100%;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    position: relative;
    color: inherit;
}
.mmcs-gift-popup-product:hover {
    background: #faf8f3;
}
.mmcs-gift-popup-product:focus-visible {
    outline: 1px dotted #b5a242;
    outline-offset: -4px;
}
.mmcs-gift-popup-product.is-loading {
    opacity: 0.5;
    cursor: wait;
    pointer-events: none;
}
.mmcs-gift-popup-product.is-success {
    background: #faf8f3;
}

.mmcs-gift-popup-product__image {
    width: 84px;
    height: 84px;
    flex-shrink: 0;
    background: #f5f2ec;
    overflow: hidden;
}
.mmcs-gift-popup-product__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mmcs-gift-popup-product__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mmcs-gift-popup-product__name {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.35;
    color: #000;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mmcs-gift-popup-product__price {
    font-size: 0.76rem;
    line-height: 1.2;
    letter-spacing: 0.02em;
}
.mmcs-gift-popup-product__price del {
    color: #999;
    text-decoration: line-through;
    margin-right: 8px;
}
.mmcs-gift-popup-product__price ins {
    color: #b5a242;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.7rem;
}

.mmcs-gift-popup-product__cta {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #000;
    border-bottom: 1px solid #b5a242;
    padding: 5px 0 4px;
    transition: color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}
.mmcs-gift-popup-product:hover .mmcs-gift-popup-product__cta {
    color: #b5a242;
}

/* Mobile */
@media (max-width: 600px) {
    .mmcs-gift-popup {
        padding: 0;
        align-items: flex-end;
    }
    .mmcs-gift-popup__dialog {
        max-width: 100%;
        max-height: 94vh;
    }
    .mmcs-gift-popup__header { padding: 40px 24px 20px; }
    .mmcs-gift-popup__title { font-size: 1.3rem; }
    .mmcs-gift-popup__eyebrow { font-size: 0.58rem; }
    .mmcs-gift-popup__products { margin: 0 24px; padding: 8px 0 16px; }
    .mmcs-gift-popup__footnote { padding: 16px 24px 24px; }
    .mmcs-gift-popup-product { padding: 14px 4px; gap: 14px; }
    .mmcs-gift-popup-product__image { width: 64px; height: 64px; }
    .mmcs-gift-popup-product__name { font-size: 0.78rem; }
    .mmcs-gift-popup-product__cta { font-size: 0.58rem; }
}

/* =================================================================
   3) BADGE "REGALO" en items del carrito
   ================================================================= */
.mmcs-gift-badge {
    display: inline-block;
    background: #b5a242;
    color: #fff;
    font-size: 0.56rem;
    font-weight: 600;
    padding: 3px 9px;
    margin-left: 8px;
    letter-spacing: 0.16em;
    vertical-align: middle;
    text-transform: uppercase;
}
.mp-side-cart__item:has(.mmcs-gift-badge) {
    background: rgba(181, 162, 66, 0.04);
}
