/*
 * 파일 경로: wp-content/plugins/wcellar-my-wine-pages/assets/css/my-cellar.css
 * My Cellar plugin — luxury styling, W Cellar theme consistent.
 * Design tokens:
 *   --color-accent   : #9b0047  (theme burgundy)
 *   --color-text     : #1a1a1a
 *   --color-text-muted: rgba(26,26,26,0.6)
 *   --color-border   : #e5e5e5
 *   --font-primary   : 'Pretendard', 'Helvetica Neue', Helvetica, Arial, sans-serif
 * Burgundy used here = var(--color-accent) / #9b0047 (theme's actual value).
 */

/* ==========================================================================
   0. LOCAL TOKENS — harmonise with theme's :root values
   ========================================================================== */
.mwp-list,
.mwp-collection,
.mwp-wizard {
    --mwp-accent:        #9b0047;      /* = theme --color-accent */
    --mwp-accent-hover:  #7a0038;
    --mwp-text:          #1a1a1a;
    --mwp-text-muted:    rgba(26,26,26,.60);
    --mwp-border:        #e5e5e5;
    --mwp-border-dark:   #d0d0d0;
    --mwp-bg:            #ffffff;
    --mwp-bg-subtle:     #f8f5f0;
    --mwp-chip-bg:       #f5f1ea;
    --mwp-chip-color:    #6b5e4e;
    --mwp-radius-sm:     6px;
    --mwp-radius:        10px;
    --mwp-radius-lg:     14px;
    --mwp-font:          'Pretendard', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
    --mwp-ease:          cubic-bezier(0.22,1,0.36,1);
    --mwp-transition:    0.2s var(--mwp-ease);
}

/* ==========================================================================
   1. SHARED UTILITIES
   ========================================================================== */

/* Primary button */
.mwp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--mwp-radius-sm);
    border: 1px solid var(--mwp-border-dark);
    background: var(--mwp-bg);
    cursor: pointer;
    font-family: var(--mwp-font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    color: var(--mwp-text);
    transition: background var(--mwp-transition), color var(--mwp-transition), border-color var(--mwp-transition), box-shadow var(--mwp-transition);
    white-space: nowrap;
}
.mwp-btn:hover {
    border-color: var(--mwp-accent);
    color: var(--mwp-accent);
    text-decoration: none;
}
.mwp-btn--primary {
    background: var(--mwp-accent);
    color: #fff;
    border-color: var(--mwp-accent);
}
.mwp-btn--primary:hover {
    background: var(--mwp-accent-hover);
    border-color: var(--mwp-accent-hover);
    color: #fff;
}

/* NEW badge (inline, in collection card names) */
.mwp-new-badge,
.mwp-header-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mwp-accent);
    color: #fff;
    font-family: var(--mwp-font);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border-radius: 999px;
    padding: 3px 8px;
    letter-spacing: 0.04em;
    vertical-align: middle;
    flex-shrink: 0;
}

/* NEW flag (absolute overlay on product grid item) */
.mwp-new-flag {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 4;
    background: var(--mwp-accent);
    color: #fff;
    font-family: var(--mwp-font);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    pointer-events: none;
}

/* Empty state */
.mwp-empty {
    text-align: center;
    padding: 64px 20px;
    color: var(--mwp-text-muted);
    font-family: var(--mwp-font);
}
.mwp-empty__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--mwp-text);
    margin: 0 0 10px;
}
.mwp-empty__sub {
    font-size: 14px;
    line-height: 1.7;
    max-width: 380px;
    margin: 0 auto 24px;
}
.mwp-empty .mwp-btn--primary {
    margin-top: 4px;
}

/* ==========================================================================
   2. LIST PAGE — .mwp-list
   ========================================================================== */
.mwp-list {
    font-family: var(--mwp-font);
    color: var(--mwp-text);
    max-width: 860px;
    margin: 0 auto;
    padding: 0 0 48px;
}

/* Page head: title + CTA */
.mwp-list__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.mwp-list__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--mwp-text);
}

/* Collection card list */
.mwp-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual collection card */
.mwp-card {
    position: relative;   /* anchor for .mwp-card__stamp */
    border: 1px solid var(--mwp-border);
    border-radius: var(--mwp-radius);
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--mwp-bg);
    gap: 16px;
    transition: border-color var(--mwp-transition), box-shadow var(--mwp-transition);
}

/* NEW ARRIVAL 도장 (호텔케이션 톤) — 카드 우측상단 */
.mwp-card__stamp {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 52px;
    height: 52px;
    z-index: 3;
    pointer-events: none;
    transform: rotate(-10deg);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.18));
}
.mwp-card__stamp .influencer-card__newstamp,
.mwp-card__stamp svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* 행사중 배지 (도장 톤 — 버건디) */
.mwp-onsale-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--mwp-accent);
    border: 1px solid var(--mwp-accent);
    font-family: var(--mwp-font);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border-radius: 999px;
    padding: 3px 9px;
    letter-spacing: 0.02em;
    vertical-align: middle;
    flex-shrink: 0;
}
.mwp-card:hover {
    border-color: var(--mwp-accent);
    box-shadow: 0 2px 12px rgba(155,0,71,.08);
}

/* Card clickable region */
.mwp-card__link {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mwp-card__link:hover {
    text-decoration: none;
    color: inherit;
}

/* Card name row */
.mwp-card__name {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--mwp-text);
    line-height: 1.3;
}

/* Condition chips inside the card */
.mwp-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 0;
}
.mwp-chip {
    display: inline-block;
    font-size: 12px;
    color: var(--mwp-chip-color);
    background: var(--mwp-chip-bg);
    border-radius: 999px;
    padding: 3px 10px;
    line-height: 1.4;
    white-space: nowrap;
}

/* Action buttons (edit / delete) */
.mwp-card__actions {
    display: flex;
    gap: 12px;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}
.mwp-card__actions a {
    font-size: 13px;
    color: var(--mwp-text-muted);
    text-decoration: none;
    transition: color var(--mwp-transition);
}
.mwp-card__actions a:hover {
    color: var(--mwp-accent);
}
.mwp-del {
    background: none;
    border: none;
    color: #c0392b;
    cursor: pointer;
    font-family: var(--mwp-font);
    font-size: 13px;
    padding: 0;
    line-height: 1;
    transition: color var(--mwp-transition);
}
.mwp-del:hover {
    color: #922b21;
}

/* ==========================================================================
   3. SINGLE COLLECTION PAGE — .mwp-collection
   ========================================================================== */
.mwp-collection {
    font-family: var(--mwp-font);
    color: var(--mwp-text);
    padding-bottom: 48px;
}

/* Collection head: back-link / title / edit-button */
.mwp-collection__head {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.mwp-back {
    font-size: 14px;
    color: var(--mwp-text-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--mwp-transition);
    flex-shrink: 0;
}
.mwp-back:hover {
    color: var(--mwp-accent);
    text-decoration: none;
}
.mwp-collection__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    flex: 1;
    min-width: 0;
}
/* "조건 수정" button beside title */
.mwp-collection__head .mwp-btn {
    flex-shrink: 0;
}

/* -------------------------------------------------------------------
   Product grid
   The outer container is a <div class="products columns-4 mwp-grid">.
   Each item is <div class="mwp-grid-item"> containing a theme <li>.
   content-product.php emits:
       <li class="... product-card" ...>
   We must neutralize the <li>'s own width/float so it fills the cell.
   ------------------------------------------------------------------- */
.mwp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Grid cell wrapper */
.mwp-grid-item {
    position: relative;   /* anchor for .mwp-new-flag */
    min-width: 0;
}

/*
 * Neutralise whatever width/float/margin the theme gives the <li>.
 * content-product.php outputs: <li class="... product-card" ...>
 * The generic WooCommerce selector .woocommerce ul.products > li won't
 * apply here because the parent is a <div>, not a <ul>.
 * We still zero out any float-based WooCommerce resets that might bleed in.
 */
.mwp-grid-item > li,
.mwp-grid-item > .product {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    list-style: none;
    display: flex;
    flex-direction: column;
}

/* Ensure the product card fills the cell height uniformly */
.mwp-grid-item > li.product-card,
.mwp-grid-item > .product-card {
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

/* -------------------------------------------------------------------
   Collection toolbar (sort) + infinite scroll loading
   ------------------------------------------------------------------- */
.mwp-collection__toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 0 0 18px;
}
/* 컴팩트 정렬 드롭다운 (쇼핑몰 .plp-sort 패턴과 동일한 UX, My Cellar 라이트 테마 색).
   기존 와이드 <select> 대체 — 작은 "라벨 ▾" 버튼 → 클릭 시 목록 팝오버. */
.mwp-sortdd {
    position: relative;
    flex-shrink: 0;
}
.mwp-sortdd__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mwp-font);
    font-size: 14px;
    color: var(--mwp-text);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 2px;
    line-height: 1.2;
    transition: color var(--mwp-transition);
}
.mwp-sortdd__toggle:hover,
.mwp-sortdd__toggle:focus { color: var(--mwp-accent); outline: none; }
.mwp-sortdd__arrow { transition: transform 0.2s ease; }
.mwp-sortdd__toggle[aria-expanded="true"] .mwp-sortdd__arrow { transform: rotate(180deg); }
.mwp-sortdd__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 150px;
    padding: 6px 0;
    background: #fff;
    border: 1px solid var(--mwp-border-dark);
    border-radius: var(--mwp-radius-sm);
    box-shadow: 0 8px 28px rgba(0,0,0,.10);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    z-index: 60;
}
.mwp-sortdd.is-open .mwp-sortdd__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.mwp-sortdd__option {
    display: block;
    width: 100%;
    padding: 9px 16px;
    font-family: var(--mwp-font);
    font-size: 14px;
    color: var(--mwp-text-muted);
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--mwp-transition), background var(--mwp-transition);
}
.mwp-sortdd__option:hover { color: var(--mwp-text); background: var(--mwp-bg-subtle); }
.mwp-sortdd__option.is-active { color: var(--mwp-accent); font-weight: 600; }

/* Infinite-scroll region: sentinel + loading row */
.mwp-infinite {
    width: 100%;
}
.mwp-sentinel {
    width: 100%;
    height: 1px;
}
.mwp-loading-row {
    text-align: center;
    padding: 22px 0 6px;
}
.mwp-loading-row[hidden] {
    display: none;
}
.mwp-loading-row .mwp-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--mwp-text-muted);
    font-size: 14px;
    letter-spacing: 0.02em;
}
.mwp-loading-row .mwp-loading::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid var(--mwp-border-dark);
    border-top-color: var(--mwp-accent);
    border-radius: 50%;
    animation: mwp-spin 0.7s linear infinite;
}
@keyframes mwp-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .mwp-collection__toolbar {
        justify-content: flex-start;
    }
    .mwp-sort {
        flex: 1;
    }
}

/* ==========================================================================
   4. WIZARD — .mwp-wizard
   ========================================================================== */
.mwp-wizard {
    max-width: 640px;
    margin: 0 auto;
    font-family: var(--mwp-font);
    color: var(--mwp-text);
    padding-bottom: 80px; /* room for sticky nav on mobile */
}

/* Progress bar area */
.mwp-wizard__progress {
    margin-bottom: 10px;
}
.mwp-wizard__step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--mwp-text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 6px;
}
.mwp-wizard__bar {
    height: 3px;
    background: var(--mwp-border);
    border-radius: 4px;
    overflow: hidden;
}
.mwp-wizard__bar i {
    display: block;
    height: 100%;
    background: var(--mwp-accent);
    border-radius: 4px;
    transition: width 0.3s var(--mwp-ease);
}

/* Stage container */
.mwp-wizard__stage {
    min-height: 120px;
}

/* Question heading */
.mwp-wizard__q {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    margin: 28px 0 20px;
    color: var(--mwp-text);
    letter-spacing: -0.01em;
}

/* Choice chips container */
.mwp-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}
.mwp-choices-box {
    margin-bottom: 4px;
}

/* Individual choice chip */
.mwp-choice {
    display: inline-flex;
    align-items: center;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid var(--mwp-border-dark);
    background: var(--mwp-bg);
    cursor: pointer;
    font-family: var(--mwp-font);
    font-size: 14px;
    font-weight: 400;
    color: var(--mwp-text);
    transition: background var(--mwp-transition), color var(--mwp-transition), border-color var(--mwp-transition);
    line-height: 1;
}
.mwp-choice:hover {
    border-color: var(--mwp-accent);
    color: var(--mwp-accent);
}
.mwp-choice.is-on {
    background: var(--mwp-accent);
    color: #fff;
    border-color: var(--mwp-accent);
}

/* Search input (grape/region autocomplete) */
.mwp-search,
.mwp-search-input,
.mwp-name-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--mwp-border-dark);
    border-radius: var(--mwp-radius-sm);
    font-family: var(--mwp-font);
    font-size: 15px;
    color: var(--mwp-text);
    background: var(--mwp-bg);
    transition: border-color var(--mwp-transition), box-shadow var(--mwp-transition);
    box-sizing: border-box;
    margin-bottom: 14px;
    outline: none;
}
.mwp-search:focus,
.mwp-name-input:focus {
    border-color: var(--mwp-accent);
    box-shadow: 0 0 0 3px rgba(155,0,71,.10);
}
.mwp-search::placeholder,
.mwp-name-input::placeholder {
    color: var(--mwp-text-muted);
}

/* Price range inputs */
.mwp-price {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.mwp-price input[type="number"] {
    width: 130px;
    padding: 10px 14px;
    border: 1px solid var(--mwp-border-dark);
    border-radius: var(--mwp-radius-sm);
    font-family: var(--mwp-font);
    font-size: 15px;
    color: var(--mwp-text);
    background: var(--mwp-bg);
    transition: border-color var(--mwp-transition), box-shadow var(--mwp-transition);
    outline: none;
    box-sizing: border-box;
}
.mwp-price input[type="number"]:focus {
    border-color: var(--mwp-accent);
    box-shadow: 0 0 0 3px rgba(155,0,71,.10);
}

/* Preview summary */
.mwp-preview {
    margin-top: 18px;
    color: var(--mwp-text-muted);
    font-size: 14px;
    line-height: 1.6;
}
.mwp-preview b {
    color: var(--mwp-accent);
    font-size: 16px;
    font-weight: 600;
}

/* Helper note */
.mwp-note {
    color: var(--mwp-text-muted);
    font-size: 13px;
    line-height: 1.6;
    margin: 10px 0;
}

/* Wizard nav bar */
.mwp-wizard__nav {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 32px;
}
.mwp-wizard__prev {
    margin-right: auto; /* push prev to far left */
}
.mwp-wizard__skip {
    color: var(--mwp-text-muted);
    border-color: var(--mwp-border);
    font-size: 13px;
}
.mwp-wizard__skip:hover {
    color: var(--mwp-text);
    border-color: var(--mwp-border-dark);
}
.mwp-wizard__next {
    min-width: 100px;
}

/* ==========================================================================
   5. NAV HEADER BADGE — .mwp-header-item / .mwp-header-link
   ========================================================================== */
.mwp-header-item {
    /* inherits menu-item layout from theme nav */
}
.mwp-header-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}
.mwp-header-link:hover {
    text-decoration: none;
}
/* The badge is already styled in the shared block above (.mwp-header-badge).
   Add a slight vertical offset so it sits neatly beside the link text. */
.mwp-header-link .mwp-header-badge {
    position: relative;
    top: -1px;
    font-size: 9px;
    padding: 2px 6px;
}

/* ==========================================================================
   6. RESPONSIVE — mobile-first breakpoints
   ========================================================================== */

/* Tablet: 3 cols */
@media (max-width: 1024px) {
    .mwp-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Small tablet / large phone: 2 cols */
@media (max-width: 768px) {
    .mwp-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .mwp-collection__head {
        gap: 12px;
    }
    .mwp-wizard {
        padding-bottom: 88px;
    }
    .mwp-wizard__q {
        font-size: 18px;
    }
}

/* Mobile: 2 cols grid, stacked card, sticky wizard nav */
@media (max-width: 600px) {

    /* Grid stays at 2 cols on mobile (boss spec) */
    .mwp-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Collection head stacks */
    .mwp-collection__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .mwp-collection__title {
        font-size: 18px;
    }

    /* List page */
    .mwp-list__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .mwp-list__head .mwp-btn--primary {
        width: 100%;
        justify-content: center;
    }

    /* Collection cards stack vertically */
    .mwp-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 18px;
    }
    .mwp-card__actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* Wizard nav becomes sticky bottom bar */
    .mwp-wizard__nav {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid var(--mwp-border);
        padding: 12px 16px;
        margin: 0 -16px;    /* bleed to container edge */
        z-index: 20;
        gap: 8px;
    }
    /* Full-width next button on mobile */
    .mwp-wizard__next {
        flex: 1;
        justify-content: center;
    }
    .mwp-wizard__skip {
        font-size: 12px;
        padding: 10px 12px;
    }

    /* Price inputs stack */
    .mwp-price {
        flex-direction: column;
        gap: 10px;
    }
    .mwp-price input[type="number"] {
        width: 100%;
    }

    /* NEW flag slightly smaller on 2-col grid */
    .mwp-new-flag {
        font-size: 9px;
        padding: 2px 6px;
    }

    /* Empty state padding reduction */
    .mwp-empty {
        padding: 40px 16px;
    }
}

/* Very small phones: keep 2 col but tighten */
@media (max-width: 380px) {
    .mwp-grid {
        gap: 8px;
    }
    .mwp-choice {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* ===== 그룹(A/B) 기능 ===== */
.mwp-wizard__groups { margin-bottom: 10px; min-height: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mwp-groups-label { color: var(--mwp-text-muted, #8a7d6b); font-size: 13px; }
.mwp-group-badge { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; border: 1px solid var(--mwp-border-dark, #cbbfa9); }
.mwp-group-badge--done { background: var(--mwp-accent, #9b0047); color: #fff; border-color: var(--mwp-accent, #9b0047); }
.mwp-group-badge--active { background: #fff; color: var(--mwp-accent, #9b0047); border-style: dashed; }

/* 완료/저장 화면 */
.mwp-finish__groups { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 20px; }
.mwp-finish__group-row { display: flex; justify-content: space-between; align-items: center; gap: 12px;
    border: 1px solid var(--mwp-border, #e7e2d9); border-radius: 10px; padding: 12px 16px; background: #fff; }
.mwp-finish__group-letter { font-weight: 700; color: var(--mwp-accent, #9b0047); margin-right: 6px; }
.mwp-finish__group-summary { color: var(--mwp-text, #3a3128); font-size: 14px; }
.mwp-finish__group-del { color: #a33; border-color: #e3c9c9; background: #fff; padding: 6px 12px; font-size: 13px; }
.mwp-finish__add-group { width: 100%; border-style: dashed; margin-bottom: 22px; }
.mwp-finish__name-label { display: block; font-size: 14px; color: var(--mwp-text-muted, #8a7d6b); margin-bottom: 8px; }
.mwp-finish__save { width: 100%; padding: 14px; font-size: 16px; margin-top: 18px; }

/* 가격 단계 입력 */
.mwp-price-row { display: flex; align-items: center; gap: 12px; }
.mwp-price-input { width: 130px; padding: 10px 12px; border: 1px solid var(--mwp-border-dark, #cbbfa9); border-radius: 8px; font-size: 15px; }
.mwp-price-sep { color: var(--mwp-text-muted, #8a7d6b); }
.mwp-extra-section { margin-bottom: 18px; }
.mwp-extra-section h4 { margin: 0 0 8px; font-size: 14px; color: var(--mwp-text, #3a3128); }
.mwp-loading { color: var(--mwp-text-muted, #8a7d6b); font-size: 14px; padding: 8px 0; }

/* 컬렉션 헤더의 그룹 요약 칩 */
.mwp-collection__groups { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 18px; }
.mwp-collection__groups .mwp-chip { background: #f5f1ea; }

/* 그룹 수정/삭제 액션 묶음 */
.mwp-finish__group-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.mwp-finish__group-edit { color: var(--mwp-accent, #9b0047); border-color: #e3cdd6; background: #fff; padding: 6px 12px; font-size: 13px; }
.mwp-finish__group-edit:hover { background: var(--mwp-accent, #9b0047); color: #fff; border-color: var(--mwp-accent, #9b0047); }

/* 지역 단계 "기타 지역 ▾" 펼치기 */
.mwp-region-other-toggle { border-style: dashed; }
.mwp-region-other-toggle.is-open { background: var(--mwp-bg-subtle, #f8f5f0); border-style: solid; }
.mwp-region-other-expand { width: 100%; margin-top: 8px; padding: 10px 12px;
    border: 1px dashed var(--mwp-border-dark, #cbbfa9); border-radius: 10px; background: var(--mwp-bg-subtle, #f8f5f0); }
.mwp-region-other-expand[hidden] { display: none; }

@media (max-width: 600px) {
    .mwp-finish__group-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .mwp-finish__group-actions { width: 100%; justify-content: flex-end; }
    .mwp-price-input { width: 100%; }
    .mwp-price-row { flex-direction: column; align-items: stretch; }
}

/* -----------------------------------------------------------------------
 * 마이계정 좌측 메뉴 'My Cellar' 항목 앞 골드 아이콘(아치형 셀러+와인병 SVG)
 * WooCommerce 가 라벨을 esc_html 하므로 SVG 는 ::before 배경으로 주입.
 * 엔드포인트 'my-cellar' → li 클래스 ...--my-cellar
 * --------------------------------------------------------------------- */
.woocommerce-MyAccount-navigation-link--my-cellar > a {
    display: inline-flex;
    align-items: center;
    gap: .5em;
}
.woocommerce-MyAccount-navigation-link--my-cellar > a::before {
    content: "";
    display: inline-block;
    flex: 0 0 auto;
    width: 1.15em;
    height: 1.15em;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTQuNSAyMVYxMWE3LjUgNy41IDAgMCAxIDE1IDB2MTAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0M1QTU3MiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48cGF0aCBkPSJNMy4zIDIxaDE3LjQiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0M1QTU3MiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPjxwYXRoIGQ9Ik0xMSA1LjVoMnY0YzEuNS41IDIuMiAxLjUgMi4yIDNWMjBoLTYuNFYxMi41YzAtMS41LjctMi41IDIuMi0zeiIgZmlsbD0iI0M1QTU3MiIvPjwvc3ZnPgo=");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* 컬렉션 페이지 '할인 중' 토글 (정렬 왼쪽). 켜면 해당 컬렉션서 세일 상품만 표시 */
.mwp-discount-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin-right: auto;          /* 토글은 왼쪽, 정렬은 오른쪽 끝으로 */
    user-select: none;
    font-family: var(--mwp-font);
}
.mwp-discount-toggle .mwp-discount-cb { position: absolute; opacity: 0; width: 0; height: 0; }
.mwp-discount-toggle__box {
    position: relative;
    width: 38px; height: 22px;
    border-radius: 999px;
    background: var(--mwp-border-dark, #d0d0d0);
    transition: background var(--mwp-transition);
    flex: 0 0 auto;
}
.mwp-discount-toggle__box::after {
    content: "";
    position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform var(--mwp-transition);
}
.mwp-discount-toggle .mwp-discount-cb:checked + .mwp-discount-toggle__box {
    background: var(--mwp-accent, #9b0047);
}
.mwp-discount-toggle .mwp-discount-cb:checked + .mwp-discount-toggle__box::after {
    transform: translateX(16px);
}
.mwp-discount-toggle .mwp-discount-cb:focus-visible + .mwp-discount-toggle__box {
    box-shadow: 0 0 0 3px rgba(155,0,71,.18);
}
.mwp-discount-toggle__label {
    font-size: 14px;
    color: var(--mwp-text, #1a1a1a);
}
.mwp-discount-toggle__count {
    display: inline-block;
    margin-left: 2px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--mwp-bg-subtle, #f8f5f0);
    color: var(--mwp-accent, #9b0047);
    font-size: 12px;
    font-weight: 600;
}
