/* ============================================
   flygood_new.css — 플라이굿 메인 디자인
   2026-03-15
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #FAFAF7;
    color: #333;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Color Variables (as classes) ---------- */
/* navy: #1B2838, coral: #E8563A, gold: #C8A84E, sage: #4A9D7C, bg: #FAFAF7 */

/* ---------- Container ---------- */
.fg-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Trust Bar ---------- */
.fg-trust-bar {
    background: #1B2838;
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    padding: 8px 0;
    display: flex;
    justify-content: center;
    gap: 32px;
}
.fg-trust-bar span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.fg-trust-bar svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #C8A84E;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Header ---------- */
.fg-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #eee;
}
.fg-header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 12px 40px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Logo */
.fg-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.fg-logo-icon {
    width: 36px;
    height: 36px;
    background: #E8563A;
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
}
.fg-logo-text {
    font-size: 20px;
    font-weight: 800;
    color: #1B2838;
}

/* Search */
.fg-search {
    flex: 1;
    max-width: 700px;
    position: relative;
}
.fg-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: #999;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.fg-search input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid #e5e5e5;
    border-radius: 24px;
    background: #f8f8f6;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.fg-search input:focus {
    border-color: #E8563A;
    box-shadow: 0 0 0 3px rgba(232,86,58,0.1);
    background: #fff;
}
.fg-search input::placeholder {
    color: #aaa;
}

/* Header Actions */
.fg-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.fg-header-actions a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background 0.2s;
}
.fg-header-actions a:hover {
    background: #f0f0ee;
}
.fg-header-actions svg {
    width: 22px;
    height: 22px;
    stroke: #555;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.fg-cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #E8563A;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Tabs */
.fg-tabs {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    gap: 0;
    border-top: 1px solid #f0f0ee;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.fg-tabs::-webkit-scrollbar { display: none; }
.fg-tab {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #888;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    position: relative;
}
.fg-tab:hover {
    color: #333;
}
.fg-tab.active {
    color: #E8563A;
    font-weight: 700;
    border-bottom-color: #E8563A;
}
.fg-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #E8563A;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: top;
}


/* Countdown */
.fg-countdown {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1B2838;
    color: #fff;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 32px;
}
.fg-countdown-label {
    color: rgba(255,255,255,0.7);
    margin-right: 4px;
}
.fg-countdown-num {
    background: rgba(255,255,255,0.15);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 16px;
    min-width: 36px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.fg-countdown-sep {
    color: rgba(255,255,255,0.5);
    font-weight: 700;
}

/* 인라인 카운트다운 (핫딜 섹션 헤더) */
.fg-countdown-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
    vertical-align: middle;
}
.fg-countdown-inline .fg-countdown-label {
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 400;
}
.fg-countdown-inline .fg-countdown-num {
    font-size: 14px;
    font-weight: 700;
    color: #E8563A;
    background: none;
    min-width: 24px;
    text-align: center;
    padding: 0;
}
.fg-countdown-inline .fg-countdown-sep {
    font-size: 14px;
    color: #9CA3AF;
    font-weight: 400;
}

/* Hero Top Cards */

/* ---------- Categories ---------- */
.fg-cat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 4px;
    border-radius: 12px;
    transition: background 0.2s;
}
.fg-cat-item:hover {
    background: #f0f0ee;
}
.fg-cat-item.active {
    background: rgba(232,86,58,0.08);
}
.fg-cat-icon {
    width: 48px;
    height: 48px;
    background: #f0f0ee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: background 0.2s, transform 0.2s;
}
.fg-cat-item:hover .fg-cat-icon {
    background: #e5e5e2;
    transform: scale(1.05);
}
.fg-cat-item.active .fg-cat-icon {
    background: #E8563A;
    color: #fff;
}
.fg-cat-name {
    font-size: 11px;
    color: #666;
    text-align: center;
    white-space: nowrap;
}

/* ---------- Sections ---------- */
.fg-section {
    padding: 40px 0;
}
.fg-section-cream {
    background: #F5F0E8;
}
.fg-section-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}
.fg-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.fg-section-title {
    font-size: 22px;
    font-weight: 800;
    color: #1B2838;
}
.fg-section-title svg {
    vertical-align: middle;
    margin-right: 8px;
}
.fg-section-link {
    font-size: 14px;
    color: #E8563A;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.fg-section-link:hover {
    text-decoration: underline;
}
.fg-section-link svg {
    width: 16px;
    height: 16px;
    stroke: #E8563A;
    fill: none;
    stroke-width: 2;
}

/* ---------- Grid Layouts ---------- */

/* ---------- Product Card ---------- */
.fg-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    border: 1px solid #f0f0ee;
}
.fg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}
.fg-card-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: #f8f8f6;
}
.fg-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.fg-card:hover .fg-card-img {
    transform: scale(1.05);
}

/* Discount Badge */
.fg-badge-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    z-index: 2;
}

/* Choice Badge */
.fg-badge-choice-old {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #1B2838;
    color: #C8A84E;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Card Info */
.fg-card-info {
    padding: 14px;
}
.fg-card-name {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 10px;
}
.fg-card-price {
    margin-bottom: 8px;
}
.fg-price-sale {
    font-size: 18px;
    font-weight: 800;
    color: #1B2838;
}
.fg-price-won {
    font-size: 13px;
    font-weight: 600;
}
.fg-price-original {
    font-size: 12px;
    color: #bbb;
    text-decoration: line-through;
    margin-left: 6px;
}

/* Ship & Free Badges */
.fg-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.fg-badge-ship {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.fg-badge-ship svg, .fg-badge-freeship svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Card Meta */
.fg-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #999;
}
.fg-card-meta svg {
    width: 12px;
    height: 12px;
    fill: #FFC107;
    stroke: none;
}
.fg-card-meta-rating {
    display: flex;
    align-items: center;
    gap: 3px;
}
.fg-card-meta-sold {
    color: #bbb;
}
.fg-card-meta-sep {
    color: #ddd;
}

/* ---------- Sort Bar ---------- */
.fg-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}
.fg-sort-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #e5e5e5;
    background: #fff;
    font-size: 13px;
    font-family: inherit;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}
.fg-sort-btn:hover {
    border-color: #E8563A;
    color: #E8563A;
}
.fg-sort-btn.active {
    background: #1B2838;
    color: #fff;
    border-color: #1B2838;
}

/* ---------- Pagination ---------- */
.fg-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 40px;
    padding: 20px 0;
}
.fg-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #e5e5e5;
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.fg-page-btn:hover {
    border-color: #E8563A;
    color: #E8563A;
}
.fg-page-btn.active {
    background: #E8563A;
    color: #fff;
    border-color: #E8563A;
    font-weight: 700;
}
.fg-page-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}
.fg-page-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}
.fg-page-arrow {
    font-size: 18px;
    font-weight: 700;
    color: #374151;
}
.fg-page-arrow:hover {
    color: #E8563A;
    background: #FEF2F0;
}

/* ---------- Notice Bar ---------- */
.fg-notice {
    background: #f8f8f6;
    border-top: 1px solid #eee;
    padding: 24px 0;
    text-align: center;
}
.fg-notice p {
    font-size: 12px;
    color: #999;
    line-height: 1.6;
}

/* ---------- Footer ---------- */
.fg-footer {
    background: #1B2838;
    color: rgba(255,255,255,0.6);
    padding: 48px 0 32px;
}
.fg-footer-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}
.fg-footer-top {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 32px;
}
.fg-footer-brand {
    flex: 1;
}
.fg-footer-brand-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.fg-footer-brand-name .fg-logo-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
    border-radius: 8px;
}
.fg-footer-brand-name span {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}
.fg-footer-desc {
    font-size: 13px;
    line-height: 1.6;
    max-width: 280px;
}
.fg-footer-links {
    display: flex;
    gap: 48px;
}
.fg-footer-col h4 {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
}
.fg-footer-col a {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
    transition: color 0.2s;
}
.fg-footer-col a:hover {
    color: #C8A84E;
}
.fg-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}
.fg-footer-copy {
    color: rgba(255,255,255,0.4);
}
.fg-footer-legal {
    display: flex;
    gap: 16px;
}
.fg-footer-legal a {
    color: rgba(255,255,255,0.4);
    transition: color 0.2s;
}
.fg-footer-legal a:hover {
    color: #C8A84E;
}

/* ---------- Empty State ---------- */
.fg-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.fg-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}
.fg-empty p {
    font-size: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .fg-grid-6 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .fg-trust-bar {
        font-size: 11px;
        gap: 16px;
        padding: 6px 12px;
    }

    .fg-header-inner {
        padding: 10px 16px;
    }

    .fg-logo-text {
        display: none;
    }

    .fg-search {
        max-width: none;
    }

    .fg-hero {
        padding: 32px 0 28px;
    }
    .fg-hero h1 {
        font-size: 24px;
    }
    .fg-hero-sub {
        font-size: 14px;
    }

    .fg-hero-cards {
        grid-template-columns: 1fr;
        gap: 8px;
        max-width: none;
    }
    .fg-hero-card {
        padding: 10px;
    }

    .fg-grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .fg-grid-6 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .fg-section {
        padding: 28px 0;
    }
    .fg-section-title {
        font-size: 18px;
    }

    .fg-card-info {
        padding: 10px;
    }
    .fg-card-name {
        font-size: 12px;
    }
    .fg-price-sale {
        font-size: 15px;
    }

    .fg-cat-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }
    .fg-cat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .fg-cat-name {
        font-size: 10px;
    }

    .fg-footer-top {
        flex-direction: column;
        gap: 24px;
    }
    .fg-footer-links {
        gap: 32px;
    }
    .fg-footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .fg-countdown {
        font-size: 12px;
        padding: 8px 14px;
    }
    .fg-countdown-num {
        font-size: 14px;
        min-width: 30px;
    }

    .fg-sort-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    .fg-sort-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .fg-trust-bar span:nth-child(3) {
        display: none;
    }
    .fg-grid-4, .fg-grid-6 {
        gap: 8px;
    }
    .fg-card {
        border-radius: 12px;
    }
    .fg-badge-discount {
        font-size: 11px;
        padding: 3px 7px;
    }
    .fg-page-btn {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}
/* --- 수정 2: 히어로 좌우 분할 + 미니카드 --- */
.fg-hero { background: #fff; border-bottom: 1px solid #F3F4F6; padding: 0; }
.fg-hero-inner {
    max-width: 1600px; margin: 0 auto; padding: 36px 40px 32px;
    display: flex; align-items: center; gap: 48px;
}
.fg-hero-text { flex: 1 1 320px; min-width: 280px; }
.fg-today-badge {
    background: #1A1A1A; color: #fff; padding: 4px 14px; border-radius: 4px;
    font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    display: inline-block; margin-right: 10px;
}
.fg-today-date { font-size: 12px; color: #9CA3AF; font-weight: 400; }
.fg-hero-deals { display: flex; gap: 12px; flex: 1 1 420px; justify-content: flex-end; }
.fg-mini-card {
    width: 160px; background: #FAFAFA; border: 1px solid #F0F0F0; border-radius: 10px;
    padding: 12px 10px; transition: all 0.3s ease; cursor: pointer; flex-shrink: 0;
}
.fg-mini-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.fg-mini-card-img {
    width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; margin-bottom: 8px;
    background: #F5F3EE;
}
.fg-mini-card-discount {
    position: absolute; top: 4px; left: 4px; padding: 1px 6px; border-radius: 3px;
    font-weight: 700; font-size: 11px; font-variant-numeric: tabular-nums;
}
.fg-mini-card-discount.first { background: #1A1A1A; color: #fff; }
.fg-mini-card-discount.other { background: #E5E5E5; color: #6B7280; }
.fg-mini-card-imgwrap { position: relative; }
.fg-mini-card .name {
    font-size: 11px; line-height: 1.35; color: #6B7280; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 30px;
}
.fg-mini-card .price { font-size: 15px; font-weight: 800; color: #1A1A1A; margin-top: 6px; }
.fg-mini-card .price-won { font-size: 10px; color: #9CA3AF; }
.fg-mini-card .price-orig { font-size: 10px; color: #9CA3AF; text-decoration: line-through; display: block; }

/* --- 수정 3: 카테고리 가운데 정렬 + wrap --- */
.fg-categories { padding: 14px 0 6px; background: #fff; }
.fg-categories-inner { max-width: 1600px; margin: 0 auto; padding: 0 16px; }
.fg-cat-grid {
    display: flex; gap: 4px; justify-content: center; flex-wrap: wrap;
    max-width: none;
}

/* --- 수정 4: 배송 뱃지 색상 수정 --- */
.fg-badge-ship.fg-ship-global { color: #7C3AED; background: #F5F3FF; }
.fg-badge-ship.fg-ship-kr { color: #2563EB; background: #EFF6FF; }
.fg-badge-freeship { color: #4A9D7C; background: #ECFDF5; }

/* --- 수정 5: 그리드 확실하게 --- */
.fg-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.fg-grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }

/* --- 수정 6: 정렬 바 개선 --- */
.fg-sort-bar {
    display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap;
}
.fg-sort-count { font-size: 14px; color: #6B7280; margin-right: 8px; white-space: nowrap; }

/* --- 천원마켓 카테고리 필터 칩 --- */
.fg-filter-chips {
    display: flex;
    flex-flow: column wrap;
    gap: 6px;
    max-height: 82px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: calc(100% + 32px);
    align-content: flex-start;
}
.fg-filter-chips::-webkit-scrollbar { display: none; }
.fg-chip {
    flex: 0 0 auto;
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid #E5E7EB;
    background: #fff;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    height: 30px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
}
.fg-chip:hover { border-color: #E8563A; color: #E8563A; }
.fg-chip.active { background: #1B2838; color: #fff; border-color: #1B2838; }

/* --- 히어로 모바일 반응형 --- */
@media (max-width: 768px) {
    .fg-hero-inner { flex-direction: column; padding: 24px 16px 20px; gap: 20px; }
    .fg-hero-deals { justify-content: center; width: 100%; }
    .fg-mini-card { width: 120px; }
    .fg-grid-4, .fg-grid-6 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 480px) {
    .fg-mini-card { width: 100px; padding: 8px; }
    .fg-mini-card .name { font-size: 10px; min-height: 27px; }
    .fg-mini-card .price { font-size: 13px; }
}

/* --- fix2 수정 1: 할인율 뱃지 새 스타일 --- */
.fg-badge-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #E8563A;
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    z-index: 2;
    line-height: 1;
}
.fg-badge-discount.fg-high-discount {
    background: #1B2838;
    color: #C8A84E;
}

/* fix2: Choice 뱃지 */
.fg-badge-choice {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #1B2838;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    z-index: 2;
}

/* --- fix2 수정 2: 카테고리 보강 --- */
.fg-categories {
    padding: 16px 0 8px;
    background: #fff;
}
.fg-cat-grid {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 20px;
    max-width: 1600px;
    margin: 0 auto;
}
.fg-cat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #F5F3EE;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.fg-cat-name {
    font-size: 11px;
    color: #6B7280;
    font-weight: 500;
    white-space: nowrap;
}

/* --- fix2 수정 3: 히어로 h1 36px, 미니카드 보강 --- */
.fg-hero-text h1 {
    font-size: 36px;
    font-weight: 800;
    color: #1A1A1A;
    letter-spacing: -1.5px;
    margin: 10px 0;
    line-height: 1.2;
}
.fg-hero-text .fg-hero-sub {
    font-size: 15px;
    color: #9CA3AF;
    margin-bottom: 20px;
}
.fg-mini-card img, .fg-mini-card-img {
    aspect-ratio: 1/1;
    object-fit: cover;
}
.fg-mini-card .name, .fg-mini-card .mini-name {
    min-height: 34px;
}
.fg-mini-card .price, .fg-mini-card .mini-price {
    font-size: 17px;
    font-weight: 800;
    color: #1A1A1A;
    margin-top: 8px;
}
.fg-mini-card .mini-original, .fg-mini-card .price-orig {
    font-size: 11px;
    color: #9CA3AF;
    text-decoration: line-through;
}
.fg-mini-card .mini-discount {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: #E8563A;
    margin-bottom: 6px;
}

/* --- fix2 수정 4: 탭 패딩 보강 --- */
.fg-tab {
    padding: 12px 24px;
}

/* --- fix2 수정 5: 5열 그리드 --- */
.fg-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
@media (max-width: 768px) {
    .fg-grid-5 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* --- fix3 수정 1: 히어로 TOP6 미니카드 (2행 3열 그리드) --- */
.fg-hero-deals {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    flex: 0 0 480px;
    justify-content: flex-end;
}
.fg-mini-card {
    width: auto;
}

/* --- fix3 수정 2: 카테고리 active 스타일 --- */
.fg-cat-item.active .fg-cat-icon {
    background: #1B2838;
    color: #fff;
}
.fg-cat-item.active .fg-cat-name {
    color: #1B2838;
    font-weight: 700;
}

/* --- fix3 수정 3: fg-grid-5 → 6열 통일 --- */
.fg-grid-5 {
    grid-template-columns: repeat(6, 1fr);
}

/* --- fix3 수정 4: 히어로 모바일 (TOP6 그리드 유지) --- */
@media (max-width: 768px) {
    .fg-hero-deals {
        grid-template-columns: repeat(3, 1fr);
        flex: none;
        width: 100%;
        justify-content: center;
    }
    .fg-mini-card {
        width: auto;
    }
}
@media (max-width: 480px) {
    .fg-hero-deals {
        gap: 6px;
    }
    .fg-mini-card {
        padding: 6px;
    }
}

/* --- fix3 추가1: 카테고리 2줄 그리드 레이아웃 --- */
.fg-cat-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 12px 8px;
    justify-items: center;
    padding: 16px 20px;
    max-width: 1600px;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .fg-cat-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px 4px;
    }
}

/* --- fix3 긴급: 히어로 1행 6열 + 카테고리 2줄 --- */
.fg-hero-deals {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 10px;
    flex: 0 0 auto;
}
.fg-mini-card {
    width: 130px !important;
    flex-shrink: 0;
}
.fg-cat-grid {
    grid-template-columns: repeat(13, 1fr) !important;
}
@media (max-width: 768px) {
    .fg-hero-deals {
        flex-wrap: wrap;
        justify-content: center !important;
    }
    .fg-mini-card {
        width: 100px !important;
    }
    .fg-cat-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

/* --- item_new.php 상품 상세 --- */
a.fg-card { text-decoration: none; color: inherit; display: block; }
a.fg-mini-card { text-decoration: none; color: inherit; }

.fg-detail-top-bar {
    display: flex; align-items: center; padding: 12px 16px; gap: 12px;
    border-bottom: 1px solid #f0f0ee;
    position: sticky; top: 0; background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 50; max-width: 1600px; margin: 0 auto;
}
.fg-detail-top-bar a { color: #1B2838; }

.fg-detail-gallery { max-width: 560px; margin: 0 auto; }
.fg-detail-main-img {
    width: 100%; position: relative;
    aspect-ratio: 1/1; overflow: hidden;
}
.fg-detail-main-img img {
    width: 100%; height: 100%; object-fit: contain; background: #f9f9f9;
}
.fg-detail-thumbs {
    display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.fg-thumb {
    width: 56px; height: 56px; border-radius: 8px; object-fit: cover;
    border: 2px solid transparent; cursor: pointer; flex-shrink: 0;
    transition: border-color 0.2s;
}
.fg-thumb.active { border-color: #1B2838; }
.fg-thumb:hover { border-color: #aaa; }

.fg-detail-info { padding: 20px 16px; max-width: 560px; margin: 0 auto; }

.fg-detail-price-block {
    background: #FAFAF7; border-radius: 10px; padding: 14px 16px; margin-bottom: 16px;
}
.fg-detail-sale-price {
    font-size: 28px; font-weight: 800; color: #1B2838;
    font-variant-numeric: tabular-nums; letter-spacing: -1px;
}
.fg-detail-original-price {
    font-size: 14px; color: #9CA3AF; text-decoration: line-through; margin-left: 8px;
}
.fg-detail-label {
    font-size: 13px; font-weight: 600; color: #1B2838; display: block; margin-bottom: 8px;
}
.fg-detail-sku { margin-bottom: 20px; }
.fg-sku-options { display: flex; gap: 8px; flex-wrap: wrap; }
.fg-sku-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px; border-radius: 8px; border: 1px solid #e5e5e5;
    background: #fff; cursor: pointer; font-size: 13px; font-family: inherit;
    transition: all 0.2s; text-align: left;
}
.fg-sku-img { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.fg-sku-label { flex: 1; }
.fg-sku-diff { font-size: 11px; color: #E8563A; font-weight: 600; white-space: nowrap; }
.fg-sku-btn:hover { border-color: #1B2838; }
.fg-sku-btn.active { border: 2px solid #1B2838; background: #F0F4F8; font-weight: 600; }
.fg-sku-price { font-size: 11px; color: #9CA3AF; margin-top: 2px; }

.fg-detail-qty { margin-bottom: 20px; }
.fg-qty-control { display: flex; align-items: center; }
.fg-qty-control button {
    width: 32px; height: 32px; border: 1px solid #e5e5e5;
    background: #fff; cursor: pointer; font-size: 16px; font-family: inherit;
    transition: background 0.2s;
}
.fg-qty-control button:hover { background: #f0f0ee; }
.fg-qty-control button:first-child { border-radius: 8px 0 0 8px; }
.fg-qty-control button:last-child { border-radius: 0 8px 8px 0; }
.fg-qty-control span {
    width: 40px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-top: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
    font-weight: 600; font-size: 14px;
}

.fg-detail-cta {
    display: flex; gap: 10px; padding: 16px 0;
    position: sticky; bottom: 0; background: #fff;
    border-top: 1px solid #f0f0ee;
}
.fg-cta-wish {
    width: 48px; height: 48px; border-radius: 10px; border: 1px solid #e5e5e5;
    background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s; flex-shrink: 0;
}
.fg-cta-wish:hover { background: #FFF0F0; }
.fg-cta-wish svg { stroke: #E8563A; }
.fg-cta-cart {
    flex: 1; height: 48px; border-radius: 10px; border: none;
    background: #1B2838; color: #fff; font-weight: 700; font-size: 15px;
    cursor: pointer; font-family: inherit; transition: opacity 0.2s;
}
.fg-cta-cart:hover { opacity: 0.9; }
.fg-cta-buy {
    flex: 2; height: 48px; border-radius: 10px; border: none;
    background: #E8563A; color: #fff; font-weight: 700; font-size: 15px;
    cursor: pointer; font-family: inherit;
    box-shadow: 0 4px 16px rgba(232,86,58,0.25);
    transition: opacity 0.2s;
}
.fg-cta-buy:hover { opacity: 0.9; }

.fg-detail-tabs { margin-top: 20px; }
.fg-tabs-nav { display: flex; border-bottom: 1px solid #e5e5e5; }
.fg-tab-btn {
    flex: 1; padding: 12px 0; border: none; background: none;
    font-size: 13px; font-weight: 400; color: #9CA3AF; cursor: pointer;
    border-bottom: 2px solid transparent; font-family: inherit;
    transition: color 0.2s;
}
.fg-tab-btn.active { font-weight: 700; color: #1B2838; border-bottom-color: #1B2838; }
.fg-tab-btn:hover { color: #555; }

.fg-tab-content { padding: 16px 0; }
.fg-detail-html img { max-width: 100%; height: auto; }
.fg-detail-html { font-size: 14px; line-height: 1.6; color: #333; }
.fg-empty-tab { text-align: center; padding: 40px 20px; color: #9CA3AF; font-size: 14px; }

.fg-shipping-info { padding: 16px 0; font-size: 13px; color: #6B7280; line-height: 1.8; }
.fg-shipping-info h4 { font-size: 14px; color: #1B2838; margin: 12px 0 6px; font-weight: 600; }
.fg-shipping-info p { margin: 0 0 4px; }

/* PC: 이미지 좌 + 정보 우 */
@media (min-width: 960px) {
    .fg-detail-layout {
        display: flex; max-width: 1200px; margin: 0 auto; gap: 40px; padding: 20px;
    }
    .fg-detail-gallery { flex: 0 0 480px; max-width: 480px; }
    .fg-detail-info { flex: 1; padding: 0; max-width: none; }
}

/* --- fix: detail layout 1600px 통일 --- */
@media (min-width: 960px) {
    .fg-detail-layout {
        max-width: 1600px;
        padding: 20px 40px;
    }
    .fg-detail-gallery {
        flex: 0 0 560px;
        max-width: 560px;
    }
    .fg-detail-cta {
        max-width: 1600px;
    }
}

/* --- fix: detail 갤러리/정보 비율 조정 --- */
@media (min-width: 960px) {
    .fg-detail-gallery {
        flex: 0 0 640px;
        max-width: 640px;
    }
    .fg-detail-info {
        max-width: 560px;
    }
    .fg-detail-cta {
        max-width: 560px;
    }
}

/* --- fix: detail layout 중앙 정렬 --- */
@media (min-width: 960px) {
    .fg-detail-layout { justify-content: center; }
}

/* --- fix: detail layout 1280px --- */
@media (min-width: 960px) {
    .fg-detail-layout { max-width: 1280px; }
}

/* --- fix: 탭/상세설명 전체 폭 --- */
.fg-detail-bottom {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
}

/* --- fix: detail-bottom 1280px 통일 --- */
.fg-detail-bottom {
    max-width: 1280px;
    margin: 20px auto 0;
    padding: 0 40px;
}

/* --- 간편결제 로고 --- */
.fg-payment-methods {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid #F3F4F6;
    margin-top: 12px;
}
.fg-payment-label {
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
    white-space: nowrap;
}
.fg-payment-logos {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.fg-payment-logos img {
    height: 24px;
    object-fit: contain;
}

/* --- 회원혜택 --- */
.fg-detail-benefits {
    padding: 12px 0;
    border-top: 1px solid #F3F4F6;
    font-size: 13px;
    color: #374151;
}
.fg-benefit-row {
    display: flex;
    gap: 12px;
    line-height: 2;
}
.fg-benefit-label {
    color: #6B7280;
    font-weight: 500;
    min-width: 60px;
}

/* --- SKU 옵션 스크롤 (10개 넘을 때) --- */
.fg-sku-options {
    max-height: 200px !important;
    overflow-y: auto !important;
}

/* ================================================================
   모바일 반응형 통합 오버라이드 (2026-03-17)
   — 기존 scattered media queries 위에 최종 덮어쓰기
   ================================================================ */

@media (max-width: 768px) {
    /* === 전체 컨테이너 === */
    .fg-container, .fg-section, .fg-categories-inner {
        max-width: 100% !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }

    /* === 신뢰 바 === */
    .fg-trust-bar {
        padding: 6px 16px !important;
        font-size: 11px !important;
        justify-content: center !important;
    }
    .fg-trust-bar span:nth-child(3) { display: none !important; }

    /* === 헤더 === */
    .fg-header-inner {
        padding: 8px 16px !important;
        gap: 8px !important;
    }
    .fg-logo-text { font-size: 16px !important; }
    .fg-search-bar, .fg-search { flex: 1 !important; }
    .fg-search input { height: 36px !important; font-size: 14px !important; }

    /* === 네비게이션 === */
    .fg-nav { padding: 0 16px !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
    .fg-nav a, .fg-tab { font-size: 13px !important; padding: 10px 12px !important; white-space: nowrap !important; }

    /* === 히어로 === */
    .fg-hero { padding: 0 !important; }
    .fg-hero-inner {
        flex-direction: column !important;
        padding: 20px 16px !important;
        gap: 16px !important;
        max-width: 100% !important;
        align-items: center !important;
    }
    .fg-hero-text {
        text-align: center !important;
        min-width: 0 !important;
        flex: none !important;
        width: 100% !important;
    }
    .fg-hero-text h1 { font-size: 22px !important; letter-spacing: -0.5px !important; }
    .fg-hero-sub { font-size: 13px !important; }

    .fg-hero-deals {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        width: 100% !important;
        flex: none !important;
        justify-content: center !important;
    }
    .fg-mini-card {
        width: auto !important;
        padding: 8px !important;
        flex-shrink: 1 !important;
    }
    .fg-mini-card-img, .fg-mini-card img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1/1 !important;
    }
    .fg-mini-card .name { font-size: 11px !important; min-height: 28px !important; }
    .fg-mini-card .price, .fg-mini-card .mini-price { font-size: 13px !important; }
    .fg-mini-card .price-orig, .fg-mini-card .mini-original { font-size: 10px !important; }
    .fg-mini-card-discount { font-size: 10px !important; padding: 1px 4px !important; }

    /* === 카테고리 === */
    .fg-categories { padding: 10px 0 6px !important; }
    .fg-cat-grid {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 8px 4px !important;
        padding: 8px 16px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        justify-items: center !important;
        overflow: visible !important;
    }
    .fg-cat-icon { width: 40px !important; height: 40px !important; font-size: 18px !important; border-radius: 12px !important; }
    .fg-cat-icon svg { width: 18px !important; height: 18px !important; }
    .fg-cat-name { font-size: 10px !important; }
    .fg-cat-item { min-width: 0 !important; }

    /* === 상품 그리드 === */
    .fg-grid-6, .fg-grid-5, .fg-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* === 상품 카드 === */
    .fg-card { border-radius: 10px !important; overflow: hidden !important; }
    .fg-card-info { padding: 8px !important; }
    .fg-card-name { font-size: 12px !important; -webkit-line-clamp: 2 !important; }
    .fg-price-sale { font-size: 15px !important; }
    .fg-price-original { font-size: 11px !important; }
    .fg-card-meta { font-size: 11px !important; }
    .fg-badge-discount { font-size: 11px !important; padding: 3px 7px !important; top: 6px !important; left: 6px !important; }
    .fg-badge-choice { font-size: 10px !important; padding: 2px 6px !important; top: 6px !important; right: 6px !important; }

    /* === 섹션 === */
    .fg-section { padding: 20px 0 !important; }
    .fg-section-header { padding: 0 !important; margin-bottom: 12px !important; }
    .fg-section-title { font-size: 16px !important; }

    /* === 정렬 바: 텍스트 링크 + 구분자 스타일 === */
    .fg-sort-bar {
        display: flex !important;
        align-items: center !important;
        gap: 0 !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 0 !important;
        margin-bottom: 12px !important;
    }
    .fg-sort-count {
        font-size: 13px !important;
        color: #6B7280 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        margin-right: 12px !important;
        font-weight: 500 !important;
    }
    .fg-sort-btn {
        padding: 4px 0 !important;
        border: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        font-size: 13px !important;
        color: #9CA3AF !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    .fg-sort-btn + .fg-sort-btn::before {
        content: '' !important;
        display: inline-block !important;
        width: 1px !important;
        height: 12px !important;
        background: #D1D5DB !important;
        margin: 0 10px !important;
        vertical-align: middle !important;
    }
    .fg-sort-btn:hover {
        color: #374151 !important;
        border: none !important;
        background: transparent !important;
    }
    .fg-sort-btn.active {
        color: #1B2838 !important;
        font-weight: 700 !important;
        background: transparent !important;
        border: none !important;
    }

    /* === 카운트다운 === */
    .fg-countdown { font-size: 12px !important; padding: 8px 12px !important; }
    .fg-countdown-num { font-size: 14px !important; min-width: 28px !important; }

    /* === 페이지네이션 === */
    .fg-pagination { display: flex !important; justify-content: center !important; align-items: center !important; gap: 4px !important; }
    .fg-page-btn { min-width: 36px !important; height: 36px !important; font-size: 14px !important; }
    .fg-page-arrow { font-size: 20px !important; min-width: 32px !important; }

    /* === 푸터 === */
    .fg-footer { padding: 24px 16px !important; }
    .fg-footer-top { flex-direction: column !important; gap: 20px !important; }
    .fg-footer-links { gap: 24px !important; }
    .fg-footer-bottom { flex-direction: column !important; gap: 12px !important; text-align: center !important; }

    /* === item_new.php 상세 === */
    .fg-detail-top-bar { padding: 8px 16px !important; }
    .fg-detail-layout {
        flex-direction: column !important;
        max-width: 100% !important;
        padding: 0 !important;
        gap: 0 !important;
    }
    .fg-detail-gallery {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }
    .fg-detail-info {
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px !important;
        flex: none !important;
    }
    .fg-detail-sale-price { font-size: 24px !important; }
    .fg-detail-original-price { font-size: 13px !important; }
    .fg-detail-bottom {
        max-width: 100% !important;
        padding: 0 16px !important;
    }
    .fg-detail-cta {
        max-width: 100% !important;
        padding: 12px 16px !important;
        gap: 8px !important;
    }
    .fg-sku-options { max-height: 150px !important; }
    .fg-sku-btn { padding: 6px 10px !important; font-size: 12px !important; }
    .fg-sku-img { width: 28px !important; height: 28px !important; }
    .fg-detail-html img { max-width: 100% !important; height: auto !important; }
    .fg-admin-tools { font-size: 11px !important; }
}

@media (max-width: 480px) {
    .fg-hero-text h1 { font-size: 20px !important; }
    .fg-hero-deals { gap: 6px !important; }
    .fg-mini-card { padding: 6px !important; }
    .fg-mini-card .name { font-size: 10px !important; }
    .fg-mini-card .price, .fg-mini-card .mini-price { font-size: 12px !important; }
    .fg-grid-6, .fg-grid-5, .fg-grid-4 { gap: 8px !important; }
    .fg-card-info { padding: 6px !important; }
    .fg-card-name { font-size: 11px !important; }
    .fg-price-sale { font-size: 14px !important; }
}
