/* =============================================================
   Mini Cart (slide-out bag drawer)
   Everything is prefixed `mc-` so it can't clash with the older
   `.cart-drawer-*` styles that live inside product/show.blade.php.
   ============================================================= */

html.mc-lock,
html.mc-lock body {
    overflow: hidden !important;
}

/* ---------- Backdrop ---------- */
.mc-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    z-index: 10040;
}

.mc-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
}

/* ---------- Drawer shell ---------- */
.mc-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(440px, 100vw);
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #111;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.14);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.38s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s linear 0.38s;
    z-index: 10050;
    outline: none;
}

.mc-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.38s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.mc-drawer *,
.mc-drawer *::before,
.mc-drawer *::after {
    box-sizing: border-box;
}

.mc-drawer button {
    font-family: inherit;
}

.mc-serif {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
}

/* ---------- Header ---------- */
.mc-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 26px 30px 24px;
    background: #fff;
}

.mc-title {
    margin: 0;
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0.2px;
    color: #111;
}

.mc-title .mc-dot {
    margin: 0 4px;
}

.mc-close {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: #eaf0f3;
    color: #5b7686;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.mc-close:hover {
    background: #dbe5ea;
    color: #2c4351;
}

/* ---------- Returns banner ---------- */
.mc-banner {
    flex: 0 0 auto;
    background: #000;
    color: #fff;
    text-align: center;
    padding: 9px 16px;
    font-size: 14px;
    letter-spacing: 0.2px;
}

/* ---------- Progress (free shipping / free gift) ---------- */
.mc-progress {
    padding: 22px 30px 20px;
    background: #fff;
    border-bottom: 1px solid #ececec;
}

.mc-progress[hidden] {
    display: none;
}

.mc-progress-msg {
    margin: 0 0 18px;
    text-align: center;
    font-size: 13.5px;
    line-height: 1.9;
    color: #222;
}

.mc-progress-msg strong {
    font-weight: 700;
}

.mc-progress-wrap {
    position: relative;
    /* right padding = half a node, so the last node sits fully inside */
    padding: 0 14px 0 0;
}

.mc-track {
    position: relative;
    height: 6px;
    border-radius: 99px;
    background: #e6e6e6;
    margin: 11px 0;
}

.mc-track-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-radius: 99px;
    background: #000;
    transition: width 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.mc-node {
    position: absolute;
    top: 50%;
    width: 28px;
    height: 28px;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #d4d4d4;
    color: #b5b5b5;
    font-size: 12px;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.mc-node.is-reached {
    background: #000;
    border-color: #000;
    color: #fff;
}

.mc-node-labels {
    position: relative;
    height: 30px;
    margin-top: 2px;
    font-size: 10.5px;
    line-height: 1.25;
    color: #555;
}

.mc-node-label {
    position: absolute;
    top: 0;
    width: 70px;
    text-align: center;
}

.mc-node-label.is-ship {
    transform: translateX(-50%);
}

.mc-node-label.is-gift {
    right: -6px;
}

/* ---------- Scrolling item list ---------- */
.mc-main {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #ececec;
}

.mc-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mc-items {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.mc-item {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 20px;
    padding: 22px 30px;
    border-bottom: 1px solid #ececec;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mc-item.is-leaving {
    opacity: 0;
    transform: translateX(24px);
}

.mc-item-img {
    display: block;
    width: 96px;
    height: 112px;
    background: #f4f1ec;
    overflow: hidden;
}

.mc-item-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mc-item-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mc-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.mc-item-name {
    margin: 0;
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    color: #111;
}

.mc-item-name a {
    color: inherit;
    text-decoration: none;
}

.mc-item-name a:hover {
    text-decoration: underline;
}

.mc-remove {
    flex: 0 0 auto;
    padding: 2px 0 2px 4px;
    border: 0;
    background: none;
    color: #8c8c8c;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.mc-remove:hover {
    color: #c0392b;
}

.mc-item-meta {
    margin-top: 6px;
    font-size: 13px;
    color: #8a8a8a;
}

.mc-item-bottom {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* quantity stepper */
.mc-qty {
    display: inline-flex;
    align-items: stretch;
    height: 34px;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.mc-qty button {
    width: 30px;
    border: 0;
    background: #fff;
    color: #555;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mc-qty button:hover:not(:disabled) {
    background: #f3f3f3;
}

.mc-qty button:disabled {
    color: #c8c8c8;
    cursor: not-allowed;
}

.mc-qty input {
    width: 46px;
    border: 0;
    border-left: 1px solid #dcdcdc;
    border-right: 1px solid #dcdcdc;
    background: #fff;
    text-align: center;
    font-size: 14px;
    color: #111;
    padding: 0;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

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

.mc-qty input:focus {
    background: #fafafa;
}

.mc-price {
    font-size: 15px;
    font-weight: 500;
    color: #111;
    white-space: nowrap;
}

/* free gift line */
.mc-gift-price {
    margin-top: 10px;
    text-align: right;
    line-height: 1.5;
}

.mc-gift-price .mc-was {
    color: #9a9a9a;
    text-decoration: line-through;
    margin-right: 8px;
    font-size: 15px;
}

.mc-gift-price .mc-now {
    font-size: 15px;
    font-weight: 500;
}

.mc-gift-price .mc-save {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: #b08a5b;
}

.mc-tag-row {
    text-align: right;
    margin-top: 4px;
}

.mc-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    border-radius: 4px;
    background: #f1f1f1;
    color: #444;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    white-space: nowrap;
}

.mc-tag i {
    font-size: 10px;
}

/* ---------- Empty state ---------- */
.mc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 0 auto;
    padding: 60px 30px;
    text-align: center;
}

.mc-empty-icon {
    font-size: 38px;
    color: #cfcfcf;
    margin-bottom: 10px;
}

.mc-empty h3 {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 20px;
    font-weight: 500;
}

.mc-empty p {
    margin: 0 0 18px;
    color: #777;
    font-size: 13.5px;
}

.mc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 28px;
    border: 1px solid #000;
    border-radius: 3px;
    background: #000;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.mc-btn:hover {
    background: #222;
    color: #fff;
}

.mc-link-btn {
    margin-top: 14px;
    border: 0;
    background: none;
    color: #8a8a8a;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.mc-link-btn:hover {
    color: #333;
}

/* ---------- Undo toast ---------- */
.mc-toast {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 6px;
    background: #111;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 3;
}

.mc-toast.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.mc-toast span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mc-toast button {
    flex: 0 0 auto;
    border: 0;
    background: none;
    color: #e8c58f;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
}

/* ---------- Footer ---------- */
.mc-footer {
    position: relative;
    flex: 0 0 auto;
    padding: 20px 30px 22px;
    background: #fff;
    border-top: 1px solid #ececec;
    box-shadow: 0 -10px 18px -14px rgba(0, 0, 0, 0.18);
}

.mc-footer[hidden] {
    display: none;
}

.mc-protect {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mc-protect-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
}

.mc-protect-text {
    flex: 1 1 auto;
    min-width: 0;
}

.mc-protect-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.mc-protect-title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 17px;
    font-weight: 500;
}

.mc-protect-price {
    font-weight: 700;
    font-size: 15px;
}

.mc-protect-desc {
    margin: 2px 0 0;
    max-width: 230px;
    font-size: 12.5px;
    line-height: 1.4;
    color: #8a8a8a;
}

/* switch */
.mc-switch {
    position: relative;
    flex: 0 0 auto;
    width: 50px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 99px;
    background: #d9dde1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mc-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.mc-switch[aria-checked="true"] {
    background: #000;
}

.mc-switch[aria-checked="true"]::after {
    transform: translateX(24px);
}

.mc-switch:focus-visible,
.mc-close:focus-visible,
.mc-remove:focus-visible,
.mc-qty button:focus-visible,
.mc-btn:focus-visible,
.mc-checkout:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.mc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mc-discounts {
    margin-top: 18px;
    font-size: 15px;
}

.mc-discounts[hidden] {
    display: none;
}

.mc-discounts-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mc-subtotal {
    margin-top: 18px;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 21px;
    font-weight: 500;
}

.mc-checkout {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 17px 20px;
    border: 0;
    border-radius: 4px;
    background: #000;
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease;
}

.mc-checkout:hover {
    background: #262626;
    color: #fff;
}

.mc-pay {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.mc-pay img {
    height: 22px;
    width: auto;
    max-width: 44px;
    object-fit: contain;
    border-radius: 3px;
}

.mc-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
    .mc-header,
    .mc-progress,
    .mc-item,
    .mc-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .mc-item {
        grid-template-columns: 80px 1fr;
        gap: 16px;
    }

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

    .mc-pay img {
        height: 20px;
    }
}

/* Short screens: tighten the pinned header/footer so the list keeps room */
@media (max-height: 760px) {
    .mc-header {
        padding-top: 16px;
        padding-bottom: 14px;
    }

    .mc-progress {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .mc-progress-msg {
        margin-bottom: 12px;
        line-height: 1.6;
    }

    .mc-footer {
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .mc-discounts,
    .mc-subtotal {
        margin-top: 12px;
    }

    .mc-checkout {
        margin-top: 12px;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .mc-pay {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mc-drawer,
    .mc-backdrop,
    .mc-track-fill,
    .mc-item,
    .mc-toast,
    .mc-switch,
    .mc-switch::after {
        transition-duration: 0.01ms !important;
    }
}
