/* =============================================================
 * MS Product 그리드/슬라이드 — 디자인 스킨 4종
 * ============================================================= */

.mspg { position: relative; }
.mspg *, .mspg *::before, .mspg *::after { box-sizing: border-box; }

.mspg-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

/* ── 상단 필터 바 ── */
.mspg-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.mspg-filter__cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
/* 필 버튼 — 테마 버튼 스타일 완전 리셋 후 2번 시안과 동일하게 강제 */
.mspg .mspg-filter__cat {
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    font-family: inherit;
    line-height: 1.2;
    border: 1px solid #e6e6ea !important;
    background: #fff !important;
    background-image: none !important;
    color: #5b616c !important;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 999px !important;
    cursor: pointer;
    box-shadow: none !important;
    text-decoration: none;
    transition: all .18s ease;
}
.mspg .mspg-filter__cat:hover,
.mspg .mspg-filter__cat:focus,
.mspg .mspg-filter__cat:focus-visible,
.mspg .mspg-filter__cat:active {
    border-color: #cdd0d6 !important;
    background: #fff !important;
    color: #333 !important;
    outline: none !important;
    box-shadow: none !important;
}
.mspg .mspg-filter__cat.is-on,
.mspg .mspg-filter__cat.is-on:hover,
.mspg .mspg-filter__cat.is-on:focus,
.mspg .mspg-filter__cat.is-on:active {
    background: #787f8c !important;
    border-color: #787f8c !important;
    color: #fff !important;
    box-shadow: none !important;
}
/* 검색 — 연회색 소프트 인풋 + 크림슨 돋보기 (2번 시안) */
.mspg-filter__search { flex: 0 1 280px; min-width: 200px; }
.mspg .mspg-filter__input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    padding: 12px 46px 12px 20px;
    border: none !important;
    border-radius: 999px !important;
    font-size: 14px;
    color: #333;
    outline: none !important;
    box-shadow: none !important;
    background: #f2f2f4 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%23e0335f' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat right 18px center;
    transition: background .18s ease;
}
.mspg .mspg-filter__input::placeholder { color: #b3b8c2; }
.mspg .mspg-filter__input:focus { background-color: #ebebef; }
.mspg .mspg-filter__input::-webkit-search-decoration,
.mspg .mspg-filter__input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* 럭스(다크) 스킨만 톤 보정 */
.mspg--luxe .mspg-filter__cat { background: rgba(255,255,255,0.05) !important; border-color: rgba(255,255,255,0.18) !important; color: #cfc6b2 !important; }
.mspg--luxe .mspg-filter__cat.is-on { background: #c9a24b !important; border-color: #c9a24b !important; color: #171d28 !important; }
.mspg--luxe .mspg-filter__input { background-color: rgba(255,255,255,0.08); color: #f4efe4; }
.mspg--luxe .mspg-filter__input:focus { background-color: rgba(255,255,255,0.12); }

/* 빈 결과 */
.mspg-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14.5px;
    background: rgba(0,0,0,0.02);
    border-radius: 12px;
}
.mspg--luxe .mspg-empty { color: #93a1b4; background: rgba(255,255,255,0.04); }

/* ── 페이지네이션 ── */
.mspg-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 26px;
}
.mspg-pager__btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #e2e2df;
    background: #fff;
    color: #444;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s ease;
}
.mspg-pager__btn:hover:not(:disabled) { border-color: #999; transform: translateY(-1px); }
.mspg-pager__btn:disabled { opacity: 0.35; cursor: default; }
.mspg-pager__btn.is-on { background: #222; border-color: #222; color: #fff; }
.mspg-pager__dots { color: #aaa; padding: 0 2px; }
.mspg--promo .mspg-pager__btn.is-on { background: #2eaa4a; border-color: #2eaa4a; }
.mspg--soft .mspg-pager__btn { border-radius: 12px; }
.mspg--soft .mspg-pager__btn.is-on { background: #ff8a5b; border-color: #ff8a5b; }
.mspg--luxe .mspg-pager__btn { background: rgba(255,255,255,0.05); border-color: rgba(201,162,75,0.35); color: #cfc6b2; }
.mspg--luxe .mspg-pager__btn.is-on { background: #c9a24b; border-color: #c9a24b; color: #171d28; }
.mspg--minimal .mspg-pager__btn { border-radius: 2px; }
.mspg--minimal .mspg-pager__btn.is-on { background: #111; border-color: #111; }

/* ── 카드 공통 골격 ── */
.mspg-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    transition: transform .22s ease, box-shadow .22s ease;
}
.mspg-thumb {
    display: block;
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.mspg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.mspg-card:hover .mspg-thumb img { transform: scale(1.045); }
.mspg-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 7px;
    padding: 16px 14px 20px;
    flex: 1 1 auto;
}
.mspg-title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.01em;
}
.mspg-title a { color: inherit; text-decoration: none; }
.mspg-tags {
    font-size: 12.5px;
    line-height: 1.5;
    opacity: 0.75;
    word-break: keep-all;
}
.mspg-price { font-size: 14px; font-weight: 700; }
.mspg-price del { opacity: .45; font-weight: 400; margin-right: 6px; }
.mspg-badge {
    position: absolute;
    top: 0; left: 0;
    z-index: 3;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.02em;
    padding: 7px 11px;
}
.mspg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-decoration: none;
    padding: 9px 22px;
    transition: filter .18s ease, transform .18s ease, background .18s ease;
}
.mspg-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.mspg-btn i { font-style: normal; font-size: 15px; line-height: 1; }

/* =============================================================
 * 스킨 1 — 프로모 그린 (첨부 시안: 배지·해시태그·GO SHOP)
 * ============================================================= */
.mspg--promo .mspg-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(40, 80, 50, 0.08);
}
.mspg--promo .mspg-card:hover { box-shadow: 0 14px 30px -10px rgba(40, 80, 50, 0.22); }
.mspg--promo .mspg-thumb { background: #f3f7f1; }
.mspg--promo .mspg-badge {
    background: #2eaa4a;
    color: #fff;
    border-radius: 10px 0 10px 0;
}
.mspg--promo .mspg-title { color: #1d2b22; }
.mspg--promo .mspg-tags { color: #56715f; }
.mspg--promo .mspg-price { color: #1d2b22; }
.mspg--promo .mspg-btn {
    background: #2eaa4a;
    color: #fff !important;
    border-radius: 999px;
    box-shadow: 0 6px 16px -6px rgba(46, 170, 74, 0.55);
}

/* =============================================================
 * 스킨 2 — 미니멀 화이트
 * ============================================================= */
.mspg--minimal .mspg-card {
    background: #fff;
    border: 1px solid #e8e8e6;
    border-radius: 2px;
}
.mspg--minimal .mspg-card:hover {
    border-color: #111;
    transform: translateY(-3px);
}
.mspg--minimal .mspg-thumb { background: #fafaf8; }
.mspg--minimal .mspg-body { align-items: flex-start; text-align: left; }
.mspg--minimal .mspg-title { color: #111; font-weight: 700; }
.mspg--minimal .mspg-tags { color: #999; }
.mspg--minimal .mspg-price { color: #111; }
.mspg--minimal .mspg-badge {
    background: #111;
    color: #fff;
}
.mspg--minimal .mspg-btn {
    background: transparent;
    color: #111 !important;
    padding: 8px 0;
    border-bottom: 2px solid #111;
}

/* =============================================================
 * 스킨 3 — 럭스 다크 (네이비 × 골드)
 * ============================================================= */
.mspg--luxe .mspg-card {
    background: linear-gradient(170deg, #222d3d, #17202d);
    border: 1px solid rgba(201, 162, 75, 0.25);
    border-radius: 14px;
    box-shadow: 0 16px 36px -16px rgba(6, 10, 16, 0.7);
}
.mspg--luxe .mspg-card:hover {
    border-color: rgba(201, 162, 75, 0.6);
    box-shadow: 0 22px 46px -16px rgba(6, 10, 16, 0.85), 0 0 24px -8px rgba(201, 162, 75, 0.3);
}
.mspg--luxe .mspg-thumb { background: #0f1620; }
.mspg--luxe .mspg-title { color: #f4efe4; font-family: "Georgia", "Noto Serif KR", serif; }
.mspg--luxe .mspg-tags { color: #93a1b4; }
.mspg--luxe .mspg-price { color: #e2c37c; }
.mspg--luxe .mspg-badge {
    background: linear-gradient(135deg, #c9a24b, #a9822f);
    color: #171d28;
    border-radius: 14px 0 10px 0;
}
.mspg--luxe .mspg-btn {
    background: transparent;
    color: #e2c37c !important;
    border: 1px solid rgba(201, 162, 75, 0.6);
    border-radius: 999px;
}
.mspg--luxe .mspg-btn:hover { background: rgba(201, 162, 75, 0.14); }

/* =============================================================
 * 스킨 4 — 소프트 파스텔 (라운드 × 코랄)
 * ============================================================= */
.mspg--soft .mspg-card {
    background: #fffdf9;
    border-radius: 22px;
    box-shadow: 0 8px 26px -10px rgba(190, 150, 120, 0.28);
}
.mspg--soft .mspg-card:hover { transform: translateY(-5px); box-shadow: 0 18px 40px -12px rgba(190, 150, 120, 0.4); }
.mspg--soft .mspg-thumb { background: #f8f1e9; border-radius: 22px 22px 0 0; }
.mspg--soft .mspg-title { color: #4a3b32; }
.mspg--soft .mspg-tags { color: #a08d7e; }
.mspg--soft .mspg-price { color: #4a3b32; }
.mspg--soft .mspg-badge {
    background: #ff8a5b;
    color: #fff;
    border-radius: 22px 0 16px 0;
}
.mspg--soft .mspg-btn {
    background: #ff8a5b;
    color: #fff !important;
    border-radius: 999px;
    box-shadow: 0 8px 18px -8px rgba(255, 138, 91, 0.65);
}

/* =============================================================
 * 슬라이더
 * ============================================================= */
/* 슬라이더 폭은 그대로 — 화살표는 컨테이너 바깥에 배치 */
.mspg--slider { padding: 0 6px 38px; }
.mspg--slider .swiper { overflow: hidden; padding: 6px; }
.mspg--slider .swiper-slide { height: auto; display: flex; }
.mspg--slider .swiper-slide .mspg-card { width: 100%; }

/* 기존 MS 캐러셀과 동일한 화살표 스타일 (흰 원 + 블루 화살표) */
.mspg-nav {
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; line-height: 1;
    font-weight: 600;
    color: #2B73E0;
    cursor: pointer;
    z-index: 10;
    user-select: none;
    transition: all 0.3s ease;
}
.mspg-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 14px rgba(0,0,0,0.16);
}
.mspg-nav--prev { left: -58px; }
.mspg-nav--next { right: -58px; }
/* 바깥 공간이 부족한 화면에서는 가장자리에 살짝 걸치도록 폴백 */
@media (max-width: 1400px) {
    .mspg-nav--prev { left: -14px; }
    .mspg-nav--next { right: -14px; }
}
/* 스킨별 화살표 컬러 (원형·그림자는 동일 유지) */
.mspg--promo .mspg-nav { color: #2eaa4a; }
.mspg--soft .mspg-nav { color: #ff8a5b; }
.mspg--luxe .mspg-nav { background: rgba(30,40,55,0.92); color: #e2c37c; }
.mspg--luxe .mspg-nav:hover { background: rgba(40,52,70,1); }

.mspg-pagination { text-align: center; margin-top: 14px; }
.mspg-pagination .swiper-pagination-bullet { margin: 0 4px; opacity: .35; }
.mspg-pagination .swiper-pagination-bullet-active { opacity: 1; background: #2eaa4a; }
.mspg--luxe .mspg-pagination .swiper-pagination-bullet-active { background: #c9a24b; }
.mspg--soft .mspg-pagination .swiper-pagination-bullet-active { background: #ff8a5b; }
.mspg--minimal .mspg-pagination .swiper-pagination-bullet-active { background: #111; }

/* 반응형 그리드 (Elementor 컨트롤이 우선하지만 기본 안전값) */
@media (max-width: 1024px) {
    .mspg-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 600px) {
    .mspg-grid { grid-template-columns: repeat(1, minmax(0,1fr)); }
    .mspg-nav { display: none; }
}

/* ── 장바구니 담기 버튼 (2026-08-28 추가) ───────────────── */
.mspg-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 18px;
    border-radius: 10px;
    background: #e0335f;
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
}
.mspg-cart-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.07);
    box-shadow: 0 6px 16px rgba(224, 51, 95, 0.28);
}
.mspg-cart-btn svg { flex-shrink: 0; }
/* 담기는 중 / 완료 상태 (WooCommerce ajax 클래스) */
.mspg-cart-btn.loading { opacity: .7; pointer-events: none; }
.mspg-cart-btn.added::after {
    content: "✓";
    margin-left: 4px;
    font-weight: 800;
}
/* GO SHOP 링크가 있으면 두 버튼이 세로로 쌓이도록 */
.mspg-body { display: flex; flex-direction: column; }
