/*
 * Umbral · interfaz del carrito Shopify
 * Hoja externa para compatibilidad con una CSP sin 'unsafe-inline'.
 */

.cart-layout {
    display: flex;
    flex-direction: column;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 16px 80px;
    gap: 40px;
}

.cart-title {
    margin: 0 0 8px;
    padding-left: 8px;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.cart-intro {
    max-width: 660px;
    margin: 14px 0 0;
    padding-left: 8px;
    color: #686868;
    color: color-mix(in srgb, var(--text-color, #111) 68%, transparent);
    font-size: 0.92rem;
    line-height: 1.55;
}

.cart-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.cart-items-list {
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: opacity 160ms ease;
}

.cart-items-list.is-busy {
    pointer-events: none;
    opacity: 0.58;
}

.cart-item {
    position: relative;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 20px;
    padding: 26px 8px;
    border-bottom: 1px solid var(--border-color, #dedede);
}

.cart-item:first-child {
    border-top: 1px solid var(--border-color, #dedede);
}

.cart-item-img {
    width: 100px;
    height: 100px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 3px;
    background: #f3f1ed;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    gap: 7px;
}

.cart-item-name {
    color: var(--text-color, #111);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: opacity 160ms ease;
}

.cart-item-name:hover {
    opacity: 0.62;
}

.cart-item-name:focus-visible,
.continue-shopping:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

/* Solo se crea cuando Shopify devuelve una variante descriptiva real. */
.cart-item-meta {
    color: #696969;
    color: color-mix(in srgb, var(--text-color, #111) 58%, transparent);
    font-size: 0.82rem;
    line-height: 1.35;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 22px;
}

.cart-item-qty {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border-color, #d8d8d8);
    border-radius: 8px;
    background: #fff;
}

.qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-color, #111);
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 160ms ease, opacity 160ms ease;
}

.qty-btn:hover:not(:disabled) {
    background: #f1f1f1;
}

.qty-btn:focus-visible,
.cart-item-remove:focus-visible,
.checkout-btn:focus-visible,
.cart-retry-btn:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.qty-btn:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.qty-input {
    width: 38px;
    height: 36px;
    padding: 0;
    border: 0;
    border-right: 1px solid var(--border-color, #d8d8d8);
    border-left: 1px solid var(--border-color, #d8d8d8);
    background: transparent;
    color: var(--text-color, #111);
    font: inherit;
    font-size: 0.9rem;
    text-align: center;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.cart-item-price {
    min-width: 88px;
    color: var(--text-color, #111);
    font-size: 1rem;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.cart-item-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-color, #111);
    cursor: pointer;
    opacity: 0.38;
    transition: background-color 160ms ease, opacity 160ms ease;
}

.cart-item-remove:hover {
    background: #f1f1f1;
    opacity: 1;
}

.cart-remove-icon {
    display: block;
    width: 16px;
    height: 16px;
}

/* Selector de preparación */
.umbral-preparation-field {
    display: grid;
    width: min(100%, 310px);
    gap: 7px;
    margin-top: 7px;
    padding: 13px 14px 12px;
    border: none;
    background: none;
}

.umbral-preparation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.umbral-preparation-label {
    color: #1c1b18;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    line-height: 1.2;
    text-transform: uppercase;
}

.umbral-preparation-control {
    position: relative;
    display: block;
}

.umbral-preparation-control::after {
    position: absolute;
    top: 50%;
    right: 15px;
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    color: #4d493f;
    content: '';
    pointer-events: none;
    transform: translateY(-68%) rotate(45deg);
}

.umbral-preparation-select {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 42px 10px 13px;
    border: 1px solid #c9c3b8;
    border-radius: 8px;
    background: #fff;
    color: #171713;
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.3;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.umbral-preparation-select:hover:not(:disabled) {
    border-color: #8c8477;
}

.umbral-preparation-select:focus-visible {
    border-color: #171713;
    outline: none;
    box-shadow: 0 0 0 3px rgb(23 23 19 / 12%);
}

.umbral-preparation-select:disabled {
    cursor: wait;
    opacity: 0.7;
}

.cart-item-warning,
.umbral-preparation-warning {
    max-width: 520px;
    margin: 2px 0 0;
    color: #7a3d31;
    font-size: 0.76rem;
    line-height: 1.45;
}

/* Resumen */
.cart-summary {
    height: fit-content;
    padding: 24px;
    border: 1px solid var(--border-color, #dedede);
    border-radius: 10px;
    background: #fff;
}

.cart-summary[hidden],
.cart-badge[hidden],
.umbral-checkout-requirement[hidden] {
    display: none !important;
}

.summary-title {
    margin: 0 0 20px;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    color: var(--text-color, #111);
    font-size: 0.95rem;
}

.summary-row.total {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color, #dedede);
    font-size: 1.15rem;
    font-weight: 600;
}

.summary-shipping-value {
    color: #707070;
    color: color-mix(in srgb, var(--text-color, #111) 58%, transparent);
    font-size: 0.85rem;
    text-align: right;
}

.summary-note {
    margin: 12px 0 0;
    color: #6b6b6b;
    color: color-mix(in srgb, var(--text-color, #111) 62%, transparent);
    font-size: 0.8rem;
    line-height: 1.45;
}
.summary-note a {
    text-decoration: underline;
    color: #6b6b6b;
    color: color-mix(in srgb, var(--text-color, #111) 62%, transparent);
}
.umbral-checkout-requirement {
    padding: 10px 12px;
    color: #673b32;
}

.checkout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    width: 100%;
    margin-top: 24px;
    padding: 16px;

    border: 0;
    border-radius: 7px;
    background: #000;
    color: #fff;

    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;

    text-align: center;
    text-decoration: none;
    cursor: pointer;

    transition:
        background-color 160ms ease,
        color 160ms ease,
        opacity 160ms ease,
        transform 160ms ease;
}

.checkout-lock-icon {
    display: block;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    pointer-events: none;
    transition: opacity 160ms ease;
}

.checkout-text {
    display: inline-block;
}

.checkout-btn:hover:not(:disabled) {
    background: #222;
}

.checkout-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.checkout-btn:focus-visible {
    outline: 2px solid #111;
    outline-offset: 3px;
}

.checkout-btn:disabled {
    background: #d7d5d1;
    color: #77736d;
    cursor: not-allowed;
}

.checkout-btn:disabled .checkout-lock-icon {
    opacity: 0.58;
}

.checkout-btn[aria-busy="true"] {
    cursor: wait;
}

.checkout-btn[aria-busy="true"] .checkout-lock-icon {
    opacity: 0.72;
}

.continue-shopping {
    display: inline-block;
    margin-top: 16px;
    padding-bottom: 2px;
    border-bottom: 1px solid currentColor;
    color: var(--text-color, #111);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 160ms ease;
}

.continue-shopping:hover {
    opacity: 0.5;
}

/* Estados y mensajes */
.cart-loading-placeholder,
.cart-state {
    padding: 48px 12px;
    color: #707070;
    color: color-mix(in srgb, var(--text-color, #111) 56%, transparent);
    text-align: center;
}

.cart-state-title {
    margin: 0 0 8px;
    color: var(--text-color, #111);
    font-size: 1rem;
    font-weight: 600;
}

.cart-state p {
    margin: 0;
    line-height: 1.5;
}

.cart-retry-btn {
    margin-top: 18px;
    padding: 9px 15px;
    border: 1px solid #111;
    border-radius: 6px;
    background: #fff;
    color: #111;
    font: inherit;
    cursor: pointer;
}

.shopify-cart-feedback {
    margin: 0 0 16px;
    padding: 11px 13px;
    border-radius: 7px;
    background: #f1f1ef;
    color: #373633;
    font-size: 0.84rem;
    line-height: 1.45;
}

.shopify-cart-feedback:empty {
    display: none;
}

.shopify-cart-feedback.is-error {
    background: #faf0ed;
    color: #7a3d31;
}

.shopify-add-to-cart-status {
    display: block;
    margin-top: 8px;
    color: #4c4b47;
    font-size: 0.82rem;
    line-height: 1.4;
}

.shopify-add-to-cart-status:empty {
    display: none;
}

.shopify-add-to-cart-status.is-error {
    color: #7a3d31;
}

.js-add-to-cart.is-cart-disabled {
    pointer-events: none;
}

.cart-btn-layout {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 900px) {
    .cart-layout {
        padding: 60px 48px 80px;
    }

    .cart-container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 380px;
        align-items: start;
        gap: 48px;
    }

    .cart-title,
    .cart-intro {
        padding-left: 0;
    }

    .cart-title {
        font-size: 2rem;
    }

    .cart-item {
        padding-right: 0;
        padding-left: 0;
    }
}

@media (max-width: 760px) {
    .cart-item {
        grid-template-columns: 80px minmax(0, 1fr) 34px;
        align-items: start;
        gap: 14px;
        padding: 22px 4px;
    }

    .cart-item-img {
        width: 80px;
        height: 80px;
    }

    .cart-item-details {
        padding-right: 4px;
    }

    .cart-item-actions {
        grid-column: 2 / 4;
        justify-content: space-between;
        width: 100%;
        margin-top: 2px;
    }

    .cart-item-remove {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    .umbral-preparation-field {
        width: 100%;
        max-width: none;
        padding: 12px;
    }

    .cart-item-price {
        min-width: auto;
    }
}

@media (max-width: 420px) {
    .cart-layout {
        padding-right: 12px;
        padding-left: 12px;
    }

    .cart-item {
        grid-template-columns: 72px minmax(0, 1fr) 32px;
        gap: 11px;
    }

    .cart-item-img {
        width: 72px;
        height: 72px;
    }

    .cart-item-actions {
        grid-column: 1 / -1;
        padding-left: 83px;
    }

    .umbral-preparation-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}
.cart-warning-message {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 0; 
  color: #673b32;
  font-size: 14px;
}

.cart-warning-message .info-icon {
  flex-shrink: 0;
}
