/**
 * public/css/shop-cart.css
 * 장바구니 공통 CSS (레이아웃에 포함)
 */

/* ═══ 헤더 장바구니 뱃지 ═══ */
.header-cart-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}
.cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #ff3b3b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}


/* ═══ 미니 카트 오버레이 ═══ */
.mini-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.mini-cart-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* ═══ 미니 카트 패널 ═══ */
.mini-cart-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 90vw;
    height: 100%;
    background: #fff;
    z-index: 9999;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mini-cart-panel.active {
    right: 0;
}

.mini-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.mini-cart-header h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}
.mini-cart-header h4 span {
    font-weight: 400;
    color: #888;
    font-size: 14px;
}
.mini-cart-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 4px;
}
.mini-cart-close:hover {
    color: #222;
}

.mini-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.mini-cart-loading {
    padding: 60px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.mini-cart-empty {
    padding: 60px 20px;
    text-align: center;
    color: #999;
}
.mini-cart-empty p {
    margin-top: 12px;
    font-size: 14px;
}


/* ═══ 미니 카트 아이템 ═══ */
.mini-cart-item {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
}
.mini-cart-item:hover {
    background: #fafafa;
}
.mini-cart-item-img {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
}
.mini-cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mini-cart-item-noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 20px;
}
.mini-cart-item-info {
    flex: 1;
    min-width: 0;
}
.mini-cart-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #222;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mini-cart-item-option {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}
.mini-cart-item-price {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-top: 6px;
}
.mini-cart-item-remove {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    font-size: 18px;
    padding: 2px;
}
.mini-cart-item-remove:hover {
    color: #ff4444;
}


/* ═══ 미니 카트 푸터 ═══ */
.mini-cart-footer {
    border-top: 1px solid #eee;
    padding: 20px 24px;
    flex-shrink: 0;
}
.mini-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 16px;
}
.mini-cart-total strong {
    font-size: 20px;
    font-weight: 700;
}
.mini-cart-btn-cart,
.mini-cart-btn-checkout {
    display: block;
    width: 100%;
    padding: 13px 0;
    text-align: center;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.15s;
}
.mini-cart-btn-cart {
    border: 1px solid #ddd;
    color: #555;
    background: #fff;
    margin-bottom: 8px;
}
.mini-cart-btn-cart:hover {
    border-color: #999;
    color: #222;
}
.mini-cart-btn-checkout {
    border: none;
    color: #fff;
    background: #222;
}
.mini-cart-btn-checkout:hover {
    background: #444;
}


/* ═══ 토스트 알림 ═══ */
.shop-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: #fff;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.shop-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.shop-toast-success {
    background: #222;
}
.shop-toast-error {
    background: #e53935;
}
.shop-toast i {
    font-size: 18px;
}
