@charset "utf-8";
/* =========================================================
   product-modern.css
   สไตล์เฉพาะหน้า "สินค้าของเรา" (?p=product)
   ทุก class ขึ้นต้นด้วย .pm- เพื่อไม่ให้กระทบหน้าอื่นของธีม
   ========================================================= */

.pm {
    --pm-navy: #001d59;
    --pm-navy-2: #003a86;
    --pm-red: #d7000b;
    --pm-red-2: #ff2d18;
    --pm-ink: #16181d;
    --pm-muted: #6b7280;
    --pm-line: #e7eaf0;
    --pm-bg: #f5f6f9;
    --pm-card: #ffffff;
    --pm-radius: 16px;
    --pm-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
    --pm-shadow-hover: 0 12px 32px rgba(16, 24, 40, .14);
    --pm-cols: 4;

    font-family: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--pm-bg);
    color: var(--pm-ink);
}

.pm *,
.pm *::before,
.pm *::after {
    box-sizing: border-box;
}

.pm-wrap {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px;
}

/* ---------------------------------------------------------
   HERO
   --------------------------------------------------------- */
.pm-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 64px 0 56px;
    background-color: var(--pm-navy);
    background-size: cover;
    background-position: center center;
    overflow: hidden;
    isolation: isolate;
}

.pm-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(120% 100% at 15% 0%, rgba(0, 58, 134, .55) 0%, rgba(0, 12, 40, .1) 60%),
        linear-gradient(180deg, rgba(0, 13, 42, calc(var(--pm-overlay, 72) * .008)) 0%, rgba(0, 13, 42, calc(var(--pm-overlay, 72) * .011)) 100%);
}

.pm-hero-inner {
    position: relative;
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 18px;
    text-align: center;
    color: #fff;
}

/* breadcrumb */
.pm-crumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-bottom: 22px;
    font-size: 14px;
    color: rgba(255, 255, 255, .62);
}

.pm-crumb a {
    color: rgba(255, 255, 255, .88) !important;
    text-decoration: none !important;
    transition: color .2s ease;
}

.pm-crumb a:hover {
    color: #fff !important;
    text-decoration: underline !important;
}

.pm-crumb i.fa-chevron-right {
    font-size: 10px;
    opacity: .6;
}

.pm-crumb-light {
    justify-content: flex-start;
    padding-top: 22px;
    margin-bottom: 10px;
    color: #8a9099;
}

.pm-crumb-light a {
    color: #40454f !important;
}

.pm-crumb-light a:hover {
    color: var(--pm-red) !important;
}

.pm-page-title {
    margin: 0 0 18px;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 600;
    color: var(--pm-ink);
}

.pm-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: .2px;
    color: #fff;
}

.pm-eyebrow i {
    color: #ffcf3f;
}

.pm-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(30px, 4.4vw, 48px);
    line-height: 1.25;
    font-weight: 600;
    color: #fff !important;
    text-shadow: 0 2px 20px rgba(0, 0, 0, .35);
}

.pm-hero-sub {
    max-width: 660px;
    margin: 0 auto;
    font-size: 17px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .84) !important;
}

/* search */
.pm-search {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 560px;
    margin: 26px auto 0;
    padding: 6px 6px 6px 18px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}

.pm-search i.pm-search-icon {
    font-size: 15px;
    color: var(--pm-muted);
}

.pm-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    color: var(--pm-ink);
}

.pm-search input::placeholder {
    color: #9aa1ad;
}

.pm-search-clear {
    display: none;
    border: 0;
    background: transparent;
    color: var(--pm-muted);
    font-size: 15px;
    padding: 8px;
    cursor: pointer;
}

.pm-search.is-filled .pm-search-clear {
    display: block;
}

.pm-search-btn {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(120deg, var(--pm-red-2) 0%, var(--pm-red) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.pm-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(215, 0, 11, .45);
}

/* badges */
.pm-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.pm-badges li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    font-size: 14.5px;
    color: rgba(255, 255, 255, .95);
}

.pm-badges i {
    color: #ffcf3f;
    font-size: 14px;
}

/* ---------------------------------------------------------
   TOOLBAR (หมวดหมู่ + เรียงลำดับ)
   --------------------------------------------------------- */
.pm-toolbar {
    z-index: 90;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--pm-line);
}

.pm-toolbar.is-sticky {
    position: sticky;
    top: 0;
}

.pm-toolbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
}

.pm-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
}

.pm-chips::-webkit-scrollbar {
    display: none;
}

.pm-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid var(--pm-line);
    border-radius: 999px;
    background: #fff;
    color: #40454f;
    font-family: inherit;
    font-size: 15px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: all .2s ease;
}

.pm-chip:hover {
    border-color: #c9ced8;
    color: var(--pm-ink);
}

.pm-chip .pm-chip-num {
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f3f7;
    font-size: 12.5px;
    color: #6b7280;
}

.pm-chip.is-active {
    background: linear-gradient(120deg, var(--pm-navy-2) 0%, var(--pm-navy) 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 29, 89, .28);
}

.pm-chip.is-active .pm-chip-num {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

.pm-sort {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--pm-muted);
    font-size: 14.5px;
}

.pm-sort select {
    height: 38px;
    padding: 0 34px 0 14px;
    border: 1px solid var(--pm-line);
    border-radius: 999px;
    background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E") no-repeat right 14px center;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    font-size: 15px;
    color: var(--pm-ink);
    cursor: pointer;
}

/* ---------------------------------------------------------
   RESULT + GRID
   --------------------------------------------------------- */
.pm-results {
    padding: 26px 0 10px;
}

.pm-results-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.pm-results-title {
    margin: 0;
    font-size: 21px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--pm-ink);
}

.pm-results-count {
    font-size: 14.5px;
    color: var(--pm-muted);
}

.pm-results-count b {
    color: var(--pm-red);
    font-weight: 600;
}

.pm-grid {
    display: grid;
    grid-template-columns: repeat(var(--pm-cols), minmax(0, 1fr));
    gap: 18px;
    padding-bottom: 8px;
}

.pm-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius);
    background: var(--pm-card);
    box-shadow: var(--pm-shadow);
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.pm-card:hover {
    transform: translateY(-5px);
    border-color: #dfe3ea;
    box-shadow: var(--pm-shadow-hover);
    color: inherit;
}

.pm-card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #eef0f4;
    overflow: hidden;
}

/* fallback สำหรับเบราว์เซอร์เก่าที่ไม่รู้จัก aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
    .pm-card-media {
        height: 0;
        padding-top: 100%;
    }
}

.pm-card-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.pm-card:hover .pm-card-media img {
    transform: scale(1.06);
}

.pm-card-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    max-width: calc(100% - 20px);
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(0, 29, 89, .82);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 10px;
    padding: 14px 14px 16px;
}

.pm-card-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 500;
    color: var(--pm-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 48px;
}

.pm-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

.pm-card-price {
    font-size: 19px;
    font-weight: 600;
    color: var(--pm-red);
    white-space: nowrap;
}

.pm-card-price.pm-ask {
    font-size: 15px;
    font-weight: 400;
    color: var(--pm-muted);
}

.pm-card-view {
    font-size: 12.5px;
    color: #9aa1ad;
    white-space: nowrap;
}

.pm-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 40px;
    border-radius: 10px;
    background: #f2f4f8;
    color: #2b3038;
    font-size: 14.5px;
    transition: background .2s ease, color .2s ease;
}

.pm-card:hover .pm-card-btn {
    background: linear-gradient(120deg, var(--pm-red-2) 0%, var(--pm-red) 100%);
    color: #fff;
}

.pm-card[hidden] {
    display: none;
}

/* ---------------------------------------------------------
   หมวดสินค้าในหน้าแรก
   --------------------------------------------------------- */
.pm-home {
    padding: 40px 0 46px;
}

.pm-sec + .pm-sec {
    margin-top: 38px;
}

.pm-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pm-line);
}

.pm-sec-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
    font-size: 23px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--pm-ink);
}

.pm-sec-title i {
    color: var(--pm-red);
    font-size: 19px;
}

.pm-sec-num {
    padding: 3px 12px;
    border-radius: 999px;
    background: #eef1f6;
    font-size: 13px;
    font-weight: 400;
    color: var(--pm-muted);
}

.pm-sec-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 18px;
    border: 1px solid var(--pm-line);
    border-radius: 999px;
    background: #fff;
    color: #2b3038 !important;
    font-size: 15px;
    text-decoration: none !important;
    transition: all .2s ease;
}

.pm-sec-link i {
    font-size: 11px;
}

.pm-sec-link:hover {
    border-color: transparent;
    background: linear-gradient(120deg, var(--pm-navy-2) 0%, var(--pm-navy) 100%);
    color: #fff !important;
}

/* empty + more */
.pm-empty {
    display: none;
    padding: 60px 20px;
    border: 1px dashed #d6dae2;
    border-radius: var(--pm-radius);
    background: #fff;
    text-align: center;
    color: var(--pm-muted);
}

.pm-empty i {
    display: block;
    margin-bottom: 12px;
    font-size: 34px;
    color: #c7ccd6;
}

.pm-empty.is-show {
    display: block;
}

.pm-more-wrap {
    display: flex;
    justify-content: center;
    padding: 30px 0 6px;
}

.pm-more,
a.pm-more {
    display: inline-flex;
    text-decoration: none !important;
    align-items: center;
    gap: 9px;
    height: 48px;
    padding: 0 30px;
    border: 1px solid var(--pm-line);
    border-radius: 999px;
    background: #fff;
    color: var(--pm-ink);
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    box-shadow: var(--pm-shadow);
    transition: all .2s ease;
}

.pm-more:hover {
    border-color: transparent;
    background: linear-gradient(120deg, var(--pm-navy-2) 0%, var(--pm-navy) 100%);
    color: #fff;
}

/* ---------------------------------------------------------
   CTA
   --------------------------------------------------------- */
.pm-cta-section {
    padding: 46px 0 10px;
}

.pm-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    flex-wrap: wrap;
    padding: 34px 38px;
    border-radius: 22px;
    background:
        radial-gradient(60% 130% at 106% 50%, rgba(215, 0, 11, .62) 0%, rgba(215, 0, 11, 0) 62%),
        linear-gradient(120deg, var(--pm-navy-2) 0%, var(--pm-navy) 100%);
    color: #fff;
    box-shadow: 0 18px 40px rgba(0, 29, 89, .25);
}

.pm-cta h2 {
    margin: 0 0 8px;
    font-size: 25px;
    line-height: 1.4;
    font-weight: 600;
    color: #fff !important;
}

.pm-cta-text {
    margin: 0;
    max-width: 620px;
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .82) !important;
}

.pm-cta-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pm-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 50px;
    padding: 0 26px;
    border-radius: 999px;
    font-size: 16.5px;
    text-decoration: none !important;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.pm-btn:hover {
    transform: translateY(-2px);
}

.pm-btn-red {
    background: linear-gradient(120deg, var(--pm-red-2) 0%, var(--pm-red) 100%);
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(215, 0, 11, .38);
}

.pm-btn-line {
    background: #06c755;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(6, 199, 85, .34);
}

/* ---------------------------------------------------------
   MAP
   --------------------------------------------------------- */
.pm-map-section {
    padding: 46px 0 56px;
}

.pm-map-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 21px;
    font-weight: 600;
    color: var(--pm-ink);
}

.pm-map-title i {
    color: var(--pm-red);
}

.pm-map {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--pm-shadow);
    line-height: 0;
    background: #e9ecf1;
}

.pm-map iframe {
    display: block;
    width: 100%;
    border: 0;
}

/* ---------------------------------------------------------
   ADMIN BAR
   --------------------------------------------------------- */
.pm-adminbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 18px 0;
}

.pm-adminbar a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--pm-line);
    color: #2b3038 !important;
    font-size: 14.5px;
    text-decoration: none !important;
    box-shadow: var(--pm-shadow);
}

.pm-adminbar a:hover {
    border-color: var(--pm-red);
    color: var(--pm-red) !important;
}

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */
/* !important จำเป็น เพราะจำนวนคอลัมน์ถูกกำหนดเป็น inline style จากค่าในแอดมิน */
@media (max-width: 1199px) {
    .pm,
    .pm-grid {
        --pm-cols: 3 !important;
    }
}

@media (max-width: 767px) {
    .pm,
    .pm-grid {
        --pm-cols: 2 !important;
    }

    .pm-hero {
        min-height: 330px;
        padding: 46px 0 40px;
    }

    .pm-search {
        max-width: 100%;
        padding-left: 14px;
    }

    .pm-search-btn {
        padding: 0 18px;
    }

    .pm-toolbar-inner {
        gap: 8px;
        padding: 9px 12px;
    }

    .pm-chip {
        height: 34px;
        padding: 0 13px;
        font-size: 14.5px;
    }

    .pm-sort i {
        display: none;
    }

    .pm-sort select {
        height: 34px;
        max-width: 132px;
        padding: 0 28px 0 11px;
        font-size: 14px;
        background-position: right 10px center;
    }

    .pm-grid {
        gap: 12px;
    }

    .pm-home {
        padding: 26px 0 32px;
    }

    .pm-sec + .pm-sec {
        margin-top: 26px;
    }

    .pm-sec-title {
        font-size: 19px;
    }

    .pm-sec-link {
        height: 34px;
        padding: 0 14px;
        font-size: 14px;
    }

    .pm-card-body {
        padding: 12px 12px 14px;
        gap: 8px;
    }

    .pm-card-title {
        font-size: 15px;
        min-height: 45px;
    }

    .pm-card-price {
        font-size: 17px;
    }

    .pm-cta {
        padding: 26px 22px;
        border-radius: 18px;
    }

    .pm-cta h2 {
        font-size: 21px;
    }

    .pm-btn {
        height: 46px;
        font-size: 15.5px;
    }
}

@media (max-width: 340px) {
    .pm,
    .pm-grid {
        --pm-cols: 1 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pm * {
        transition: none !important;
        animation: none !important;
    }
}
