/* Mriella Side Cart Drawer */

/* ── Drawer Container ─────────────────────────────────────────────────── */

.mriella-drawer {
    position: fixed;
    inset: 0;
    z-index: 999999;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s 0.4s;
}

.mriella-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
    transition: visibility 0s 0s;
}

/* ── Backdrop ──────────────────────────────────────────────────────────── */

.mriella-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mriella-drawer.is-open .mriella-drawer-backdrop {
    opacity: 1;
}

/* ── Panel ──────────────────────────────────────────────────────────────── */

.mriella-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s ease-out;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.mriella-drawer.is-open .mriella-drawer-panel {
    transform: translateX(0);
}

body.mriella-drawer-open {
    overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.mriella-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.mriella-drawer-title {
    font-family: Montserrat, sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #000;
}

.mriella-drawer-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #000;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mriella-drawer-close:hover {
    opacity: 0.6;
}

/* ── Body (scrollable) ──────────────────────────────────────────────────── */

.mriella-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    -webkit-overflow-scrolling: touch;
}

/* ── Cart Items ─────────────────────────────────────────────────────────── */

.sc-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
}

.sc-item:first-child {
    padding-top: 0;
}

.sc-item:last-child {
    border-bottom: none;
}

.sc-item-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

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

.sc-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sc-item-name {
    font-family: Montserrat, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #000;
    line-height: 1.3;
}

.sc-item-meta {
    font-family: Montserrat, sans-serif;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.sc-item-meta dt {
    display: inline;
    font-weight: 500;
}

.sc-item-meta dd {
    display: inline;
    margin: 0 8px 0 0;
}

.sc-item-meta p {
    margin: 0;
}

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

.sc-item-qty {
    display: flex;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    overflow: hidden;
}

.sc-qty-btn {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    padding: 0;
    font-family: Montserrat, sans-serif;
}

.sc-qty-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sc-qty-value {
    font-family: Montserrat, sans-serif;
    font-size: 13px;
    font-weight: 500;
    min-width: 24px;
    text-align: center;
}

.sc-item-price {
    font-family: Montserrat, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

.sc-item-remove {
    position: absolute;
    top: 16px;
    right: 0;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0 0 0 8px;
}

.sc-item:first-child .sc-item-remove {
    top: 0;
}

.sc-item-remove:hover {
    color: #000;
}

/* ── Upsells ────────────────────────────────────────────────────────────── */

.sc-upsells {
    margin-top: 16px;
    padding-top: 16px;
}

.sc-upsells-title {
    font-family: Montserrat, sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px;
    color: #000;
}

.sc-upsell-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.sc-upsell-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

.sc-upsell-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sc-upsell-info {
    flex: 1;
    min-width: 0;
}

.sc-upsell-name {
    display: block;
    font-family: Montserrat, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #000;
}

.sc-upsell-price {
    display: block;
    font-family: Montserrat, sans-serif;
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

.sc-upsell-add {
    flex-shrink: 0;
    background: none;
    border: 1px solid #000;
    border-radius: 6px;
    padding: 6px 12px;
    font-family: Montserrat, sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: #000;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.sc-upsell-add:hover {
    background: #000;
    color: #fff;
}

.sc-upsell-add.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.mriella-drawer-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 16px 24px 24px;
    flex-shrink: 0;
}

/* Coupons */

.sc-coupons-area {
    margin-bottom: 12px;
}

.sc-coupon-form {
    display: flex;
    gap: 8px;
}

.sc-coupon-form input {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    padding: 4px 10px;
    font-family: Montserrat, sans-serif;
    font-size: 11px;
    background: #fff;
    outline: none;
}

.sc-coupon-form input:focus {
    border-color: #000;
}

.sc-coupon-form button {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    padding: 4px 10px;
    font-family: Montserrat, sans-serif;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    color: #000;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.sc-coupon-form button:hover {
    background: #000;
    color: #fff;
}

.sc-coupon-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.sc-coupon-badges:empty {
    margin-bottom: 0;
}

.sc-coupon-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1edeb;
    border-radius: 20px;
    padding: 4px 10px;
    font-family: Montserrat, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #000;
}

.sc-coupon-badge-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: #666;
    padding: 0;
}

.sc-coupon-badge-remove:hover {
    color: #000;
}

.sc-coupon-msg {
    font-family: Montserrat, sans-serif;
    font-size: 12px;
    margin-top: 6px;
}

.sc-coupon-msg:empty {
    display: none;
}

.sc-coupon-msg.sc-msg-success {
    color: #2e7d32;
}

.sc-coupon-msg.sc-msg-error {
    color: #c62828;
}

/* Subtotal */

.sc-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-top: 4px;
}

.sc-subtotal-label {
    font-family: Montserrat, sans-serif;
    font-size: 14px;
    color: #000;
}

.sc-subtotal-value {
    font-family: Montserrat, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #000;
}

/* Buttons */

.sc-checkout-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: Montserrat, sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
    box-sizing: border-box;
}

.sc-checkout-btn:hover {
    opacity: 0.85;
    color: #fff;
}

.sc-continue-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: none;
    border: none;
    font-family: Montserrat, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sc-continue-btn:hover {
    color: #000;
}

/* ── Empty State ────────────────────────────────────────────────────────── */

.sc-empty-state {
    text-align: center;
    padding: 40px 0;
}

.sc-empty-title {
    font-family: Montserrat, sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #000;
}

.sc-empty-subtitle {
    font-family: Montserrat, sans-serif;
    font-size: 13px;
    color: #666;
    margin: 0 0 24px;
}

.sc-piccolo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    text-align: center;
    max-width: 240px;
    margin: 0 auto;
}

.sc-piccolo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sc-piccolo-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
}

.sc-piccolo-color {
    display: none;
}

.sc-piccolo-btn {
    width: 100%;
    padding: 6px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: Montserrat, sans-serif;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.sc-piccolo-btn:hover {
    opacity: 0.85;
}

.sc-piccolo-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Loading state ──────────────────────────────────────────────────────── */

.sc-loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.15s;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .mriella-drawer-panel {
        width: 100%;
    }
}
