

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;600;700;800&display=swap');


*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg:       #fafafa;
    --surface:  #ffffff;
    --text:     #1a1a1a;
    --muted:    #888888;
    --border:   #e8e8e8;
    --accent:   #c084fc;   
    --accent-d: #a855f7;
    --radius:   8px;
    --gap:      16px;
    --max-w:    1400px;
    --font-ui:  'Noto Sans Thai', 'Segoe UI', Tahoma, sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-synthesis: none;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
}

button::-moz-focus-inner {
    border: 0;
    padding: 0;
}

a { color: inherit; text-decoration: none; }

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}



.site-header {
    text-align: center;
    padding: 52px 24px 36px;
    border-bottom: 1px solid var(--border);
}

.site-title {
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text);
    display: inline-block;
}

.site-tagline {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}



.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--gap);
    padding: 32px clamp(12px, 4vw, 48px);
    max-width: var(--max-w);
    margin: 0 auto;
}

.gallery-item {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius);
    background: #ececec;
    cursor: pointer;
}

.gallery-item img {
    transition: transform 0.38s ease, opacity 0.3s ease;
    opacity: 0.93;
    object-fit: contain;
    background: #f6f6f6;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
    transform: scale(1.05);
    opacity: 1;
}

.gallery-item:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}



.single-view {
    max-width: 720px;
    margin: 48px auto 80px;
    padding: 0 clamp(12px, 4vw, 32px);
    text-align: center;
}

.single-view > img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius);
    background: #f0f0f0;
    max-height: 80vh;
}

.single-meta {
    margin-top: 24px;
}

.single-meta h1 {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 700;
    line-height: 1.4;
}

.single-product-code {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    font-size: 0.86rem;
    font-weight: 700;
    color: #5b21b6;
}

.single-product-note {
    margin-top: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #334155;
}

.single-real-shot {
    margin-top: 20px;
}

.single-real-shot h2 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.single-real-shot img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #f8fafc;
}

.single-real-shot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.single-real-shot-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    cursor: zoom-in;
}

.single-gallery-item {
    cursor: zoom-in;
}

.single-lb-overlay {
    position: fixed;
    inset: 0;
    z-index: 10020;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.single-lb-overlay img {
    max-width: min(94vw, 920px);
    max-height: 84vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
}

.single-lb-close {
    position: fixed;
    top: 16px;
    right: 24px;
    border: none;
    background: none;
    color: #111827;
    font-size: 2.2rem;
    cursor: pointer;
}

.single-lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #111827;
    font-size: 1.2rem;
    cursor: pointer;
}

#single-lb-prev {
    left: 14px;
}

#single-lb-next {
    right: 14px;
}

.single-lb-count {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    font-size: 0.84rem;
    font-weight: 600;
}

.category-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 16px;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.btn-back {
    display: inline-block;
    margin-top: 32px;
    padding: 11px 30px;
    border: 1.5px solid var(--text);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background 0.2s, color 0.2s;
}

.btn-back:hover,
.btn-back:focus-visible {
    background: var(--text);
    color: #fff;
    outline: none;
}



.site-footer {
    text-align: center;
    padding: 40px 24px;
    color: var(--muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}



.admin-body {
    background: var(--bg);
}

.admin-container {
    max-width: 600px;
    margin: 60px auto 80px;
    padding: 0 clamp(16px, 4vw, 24px);
}

.admin-container > h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 32px;
    letter-spacing: 0.04em;
}


.upload-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.upload-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.02em;
}

.upload-form label span { color: #e55; }

.upload-form input[type="text"],
.upload-form input[type="password"],
.upload-form textarea,
.upload-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s;
    resize: vertical;
}

.upload-form input[type="text"],
.upload-form input[type="password"],
.upload-form select,
.upload-form button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.upload-form input[type="text"],
.upload-form input[type="password"],
.upload-form select {
    min-height: 44px;
    line-height: 1.35;
}

.upload-form input[type="password"]::-ms-reveal,
.upload-form input[type="password"]::-ms-clear {
    display: none;
}

.upload-form input[type="text"]:focus,
.upload-form input[type="password"]:focus,
.upload-form textarea:focus,
.upload-form select:focus {
    outline: none;
    border-color: var(--accent);
}

.upload-form input[type="file"] {
    padding: 8px 0;
    font-size: 0.9rem;
    font-family: inherit;
}

.upload-form small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 400;
}

.upload-form button {
    align-self: flex-start;
    padding: 12px 36px;
    background: var(--text);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: opacity 0.2s;
    line-height: 1.2;
}

.upload-form button:hover {
    opacity: 0.78;
}


.upload-msg {
    margin-bottom: 28px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.upload-msg--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.upload-msg--error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.admin-container > p {
    margin-top: 28px;
    font-size: 0.88rem;
    color: var(--muted);
}

.admin-container > p a:hover { text-decoration: underline; }

.admin-container--auth {
    max-width: 480px;
}

.admin-login-page {
    background:
        radial-gradient(1200px 480px at 50% -220px, #efe4ff 0%, transparent 70%),
        var(--bg);
}

.admin-login-page .admin-container--auth {
    margin-top: 72px;
    padding: clamp(20px, 3vw, 28px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(26, 26, 26, 0.08);
    max-width: 460px;
}

.admin-login-page .admin-container--auth > h1 {
    margin-bottom: 24px;
    line-height: 1.2;
}

.admin-login-page .upload-form button {
    display: inline-flex;
    align-items: center;
    width: 100%;
    justify-content: center;
}

.admin-help-text {
    margin-top: 22px;
    color: var(--muted);
    font-size: 0.82rem;
}



@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 16px 10px;
    }

    .site-header { padding: 36px 16px 24px; }
}




.bulk-wrap {
    max-width: 780px;
    margin: 0 auto;
    padding: 52px clamp(16px, 4vw, 40px) 80px;
}

.bulk-header { margin-bottom: 36px; }
.bulk-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.bulk-header p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.9rem;
}


.bulk-controls { display: flex; flex-direction: column; gap: 20px; }

.control-row { display: flex; align-items: center; gap: 14px; }
.ctrl-label  { font-size: 0.88rem; font-weight: 700; white-space: nowrap; }
.ctrl-select {
    flex: 1;
    max-width: 280px;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s;
}
.ctrl-select:focus { outline: none; border-color: var(--accent); }


.drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 24px;
    border: 2px dashed var(--border);
    border-radius: calc(var(--radius) * 2);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
}
.drop-zone:hover,
.drop-zone:focus-visible { border-color: var(--accent); background: #fdf4ff; }
.drop-zone.is-dragover   { border-color: var(--accent-d); background: #f5e8ff; }
.drop-zone svg           { color: var(--accent); flex-shrink: 0; }
.drop-zone p             { margin: 0; font-size: 0.95rem; line-height: 1.6; }
.drop-zone p span        { color: var(--accent-d); font-weight: 700; }
.drop-hint               { font-size: 0.78rem !important; color: var(--muted); }

.file-count-msg {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    min-height: 1.4em;
}


.btn-upload {
    align-self: flex-start;
    padding: 13px 40px;
    background: var(--text);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-upload:hover:not(:disabled) { opacity: 0.76; }
.btn-upload:disabled { opacity: 0.35; cursor: not-allowed; }


.progress-section { margin-top: 32px; }
.progress-track {
    width: 100%;
    height: 10px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-d) 100%);
    border-radius: 999px;
    transition: width 0.25s ease;
}
.progress-text {
    margin-top: 10px;
    font-size: 0.88rem;
    color: var(--muted);
}


.file-list-section { margin-top: 32px; }
.file-list-heading {
    font-size: 0.88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    color: var(--muted);
}
.file-list {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.file-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.file-item:last-child { border-bottom: none; }

.fi-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.fi-size { color: var(--muted); white-space: nowrap; }
.fi-status { white-space: nowrap; font-weight: 600; min-width: 120px; text-align: right; }

.file-item--pending   { background: var(--surface); }
.file-item--uploading { background: #fdf4ff; }
.file-item--done      { background: #f0fdf4; }
.file-item--done .fi-status   { color: #166534; }
.file-item--error     { background: #fff1f2; }
.file-item--error .fi-status  { color: #9f1239; }


.bulk-back {
    margin-top: 40px;
    font-size: 0.88rem;
    color: var(--muted);
}
.bulk-back a:hover { text-decoration: underline; }

@media (max-width: 500px) {
    .file-item { grid-template-columns: 1fr auto; }
    .fi-size   { display: none; }
}


.manage-wrap {
    max-width: none;
    width: 100%;
    padding-left: clamp(12px, 2.6vw, 44px);
    padding-right: clamp(12px, 2.6vw, 44px);
}

.manage-top-nav {
    margin-bottom: 12px;
}

.manage-order-form {
    margin-bottom: 20px;
}

.manage-order-form--inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    align-items: start;
    touch-action: pan-y;
}

@media (min-width: 1280px) {
    .manage-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 640px) {
    .manage-wrap {
        padding-left: 12px;
        padding-right: 12px;
    }

    .manage-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

.manage-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    align-self: start;
    touch-action: pan-y;
}

.manage-card.is-dragging {
    opacity: 0.6;
    transform: scale(0.98);
}

.manage-card.is-chosen {
    box-shadow: 0 0 0 2px #c084fc;
}

.manage-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: #f5f5f5;
}

.manage-check-wrap {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
}

.manage-check {
    width: 16px;
    height: 16px;
}

.manage-meta {
    padding: 10px 12px 6px;
}

.manage-meta p {
    margin: 6px 0;
    font-size: 0.85rem;
    line-height: 1.4;
}

.manage-meta small {
    color: var(--muted);
}

.manage-meta-chip {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f5f3ff;
    color: #5b21b6;
    font-size: 0.75rem;
    font-weight: 700;
}

.manage-meta-note {
    margin-top: 8px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 8px;
}

.manage-real-shot-wrap {
    margin-top: 10px;
}

.manage-real-shot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 6px;
}

.manage-real-shot-wrap small {
    display: inline-block;
    color: #64748b;
    margin-bottom: 6px;
}

.manage-real-shot {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.manage-real-shot-delete-list {
    display: grid;
    gap: 8px;
}

.manage-real-shot-delete-list small {
    color: #64748b;
}

.manage-real-shot-delete-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: center;
    gap: 8px;
}

.manage-order-tip {
    color: #64748b;
}

.manage-real-shot-delete-item img {
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    cursor: grab;
}

.btn-edit-meta {
    margin: 0 12px 10px;
    width: calc(100% - 24px);
}

.edit-meta-form {
    margin: 0 12px 10px;
    padding: 10px;
    border: 1px dashed #d4d4d8;
    border-radius: 10px;
    background: #fafafa;
    display: grid;
    gap: 10px;
}

.edit-meta-form label {
    display: grid;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #1f2937;
}

.edit-meta-form input,
.edit-meta-form textarea {
    width: 100%;
    border: 1px solid #d4d4d8;
    border-radius: 8px;
    background: #fff;
    padding: 9px 10px;
    font-size: 0.84rem;
    font-family: inherit;
    color: var(--text);
}

.edit-meta-form textarea {
    resize: vertical;
    min-height: 76px;
}

.btn-upload--small {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.84rem;
}

.delete-form {
    padding: 0 12px 12px;
}

.btn-delete {
    width: 100%;
    border: 1px solid #ef4444;
    background: #fff;
    color: #b91c1c;
    border-radius: 8px;
    font-weight: 700;
    padding: 10px 12px;
    cursor: pointer;
}

.btn-delete:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-delete--light {
    border-color: #d4d4d8;
    color: #27272a;
}

.btn-delete--link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
}

.manage-cleanup-box {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    padding: 16px;
    margin-bottom: 24px;
}

.manage-checkline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-delete:hover {
    background: #fff1f2;
}


.dashboard-wrap {
    max-width: 1100px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.dashboard-stat-card {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    padding: 14px;
}

.dashboard-stat-card h2 {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 4px;
}

.dashboard-stat-card p {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.dashboard-card {
    display: block;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    background: #fff;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-card h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.dashboard-card p {
    color: var(--muted);
    font-size: 0.86rem;
}

.dashboard-card:hover {
    transform: translateY(-1px);
    border-color: #d8b4fe;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}
