@charset "UTF-8";

/* ===== Cart Drawer ===== */
/* Global mini-cart drawer rendered in the footer */

/* =============================================
   Cart Drawer – 右侧滑出迷你購物車抽屉
   ============================================= */

/* Overlay */
.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
.cart-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Drawer panel — 原站 300px 右側滑出 */
.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 100%;
    height: 100%;
    background: #fff;
    color: #444;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform .3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.12);
}
.cart-drawer.active {
    transform: translateX(0);
}

/* Prevent body scroll when drawer open */
body.cart-drawer-open {
    overflow: hidden;
}

/* Header — 原站 .title：300×60，左右 15px，底部分割线 */
.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: 100%;
    height: 60px;
    margin: 0;
    padding: 0 15px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}
.cart-drawer-title {
    font-size: 20px;
    font-weight: 700;
    color: #444;
    line-height: 1.3;
}
.cart-drawer-close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0;
    margin: 0;
}
.cart-drawer-close:hover {
    color: #666;
}

/* 頂部：查看購物車 + 免運提示（原站 miniCart-checkout） */
.cart-drawer-top {
    flex-shrink: 0;
    box-sizing: border-box;
    width: 100%;
    padding: 20px 15px;
    border-bottom: none;
    background-color: rgb(245, 245, 245);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.cart-drawer-top:empty {
    display: none;
}
.cart-drawer-view-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 270px;
    max-width: 100%;
    height: 34px;
    margin: 0;
    padding: 0 10px;
    text-align: center;
    background: rgb(255, 196, 0);
    color: #fff !important;
    border: none;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    transition: filter 0.15s ease;
}
.cart-drawer-view-cart:hover {
    filter: brightness(0.96);
    color: #fff !important;
}
.cart-drawer-shipping-note {
    width: 270px;
    max-width: 100%;
    margin: 8px 0 0;
    padding: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.31;
    color: rgb(145, 104, 53);
}

/* Body (scrollable) — 與上方 checkout 區塊間距 5px */
.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-top: 5px;
    background: rgb(245, 245, 245);
}

/* Mini-cart list */
.cart-drawer .woocommerce-mini-cart {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}
.cart-drawer .woocommerce-mini-cart-item {
    padding: 12px 16px;
    background: rgb(245, 245, 245);
    border-bottom: 1px dashed #d8d8d8;
}
.cart-drawer .woocommerce-mini-cart-item:last-child {
    border-bottom: none;
}
.cart-drawer-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.cart-drawer-item-thumb {
    flex-shrink: 0;
    display: block;
    width: 88px;
    height: 88px;
    border: 2px solid rgb(49, 80, 171);
    border-radius: 0;
    overflow: hidden;
    text-decoration: none;
    box-sizing: border-box;
}
.cart-drawer-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #fff;
}
.cart-drawer-item-body {
    flex: 1;
    min-width: 0;
    min-height: 88px;
    display: flex;
    flex-direction: column;
    align-self: stretch;
}
.cart-drawer-item-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #444;
    font-size: 13px;
    line-height: 1.35;
    text-decoration: underline;
    text-underline-offset: 2px;
}
span.cart-drawer-item-name {
    text-decoration: underline;
    text-underline-offset: 2px;
}
a.cart-drawer-item-name:hover {
    color: #222;
}
.cart-drawer-item-body dl.variation {
    margin: 4px 0 0;
    font-size: 11px;
    color: #888;
}
.cart-drawer-item-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    margin-top: auto;
    padding-top: 6px;
}
.cart-drawer-qty {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    border: 1px solid #d5d5d5;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}
.cart-drawer-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: rgb(49, 80, 171);
    cursor: pointer;
    transition: background 0.15s ease;
}
.cart-drawer-qty-btn .icon {
    font-size: 12px;
    line-height: 1;
}
.cart-drawer-qty-btn:hover {
    background: #f5f7fc;
}
.cart-drawer-qty-val {
    min-width: 22px;
    padding: 0 4px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    line-height: 28px;
}
.cart-drawer-qty.is-loading {
    opacity: 0.55;
    pointer-events: none;
}
.cart-drawer-remove {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0 0 0 auto;
    border: none;
    background: transparent;
    color: #666 !important;
    font-size: 0 !important;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}
.cart-drawer-remove .icon-trash {
    font-size: 18px;
    line-height: 1;
}
.cart-drawer-remove:hover {
    color: #333 !important;
}

.cart-drawer .woocommerce-mini-cart__total,
.cart-drawer .woocommerce-mini-cart__buttons {
    display: none !important;
}

/* Empty message in drawer */
.cart-drawer .woocommerce-mini-cart__empty-message {
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 48px 16px;
    margin: 0;
    background: #f8f8f8;
}

/* Mobile: 对齐原站 — 抽屉不铺满屏宽，右侧预留遇见层空隙便于点击关闭 */
@media (max-width: 768px) {
    /* 抽屉与遇见层从顶栏下方开始，不遮盖 LOGO 与顶部按钮 */
    .cart-drawer-overlay,
    .cart-drawer {
        top: calc(96px + env(safe-area-inset-top, 0));
        height: calc(100% - 96px - env(safe-area-inset-top, 0));
    }
    .cart-drawer {
        width: min(300px, 85vw);
        max-width: 300px;
        min-width: 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .cart-drawer-close {
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
@media (max-width: 480px) {
    .cart-drawer-overlay,
    .cart-drawer {
        top: calc(86px + env(safe-area-inset-top, 0));
        height: calc(100% - 86px - env(safe-area-inset-top, 0));
    }
    .cart-drawer {
        width: min(300px, calc(100vw - 60px)); /* 原站 300px，右侧留空隙透出遮罩 */
        max-width: 300px;
    }
}
