/* =====================================================
   เลิศมณี — Lerdmanee Jewelry Store — Frontend CSS
   Theme: Red × Black × Gold Luxury
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
    --red:         #c0392b;
    --red-light:   #e74c3c;
    --red-glow:    rgba(231,76,60,.35);
    --gold:        #f0c040;
    --gold-dark:   #b8860b;
    --gold-light:  #fde68a;
    --gold-glow:   rgba(240,192,64,.25);
    --bg:          #0a0a0a;
    --bg2:         #111111;
    --bg3:         #1a1a1a;
    --card-bg:     rgba(255,255,255,0.04);
    --border:      rgba(240,192,64,0.2);
    --border-hover:rgba(240,192,64,0.55);
    --text:        #f5f5f5;
    --text-muted:  #888;
    --text-soft:   #ccc;
    --radius:      14px;
    --shadow:      0 8px 32px rgba(0,0,0,0.5);
    --transition:  all 0.3s cubic-bezier(.4,0,.2,1);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Sarabun', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 16px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 3px; }

/* ===== NAVBAR ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #1a0000 0%, #2d0808 50%, #1a0000 100%);
    border-bottom: 2px solid var(--gold-dark);
    box-shadow: 0 4px 24px rgba(0,0,0,.6);
    padding: 0 24px;
}
.navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 16px;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.navbar-logo {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--gold-dark);
    object-fit: cover;
    box-shadow: 0 0 16px var(--gold-glow);
}
.navbar-title {
    display: flex;
    flex-direction: column;
}
.navbar-title .name {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}
.navbar-title .tagline {
    font-size: .72rem;
    color: rgba(240,192,64,.6);
    letter-spacing: 2px;
    text-transform: uppercase;
}
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-link {
    color: var(--gold-light);
    font-size: .92rem;
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid transparent;
    transition: var(--transition);
    font-weight: 500;
}
.nav-link:hover {
    border-color: var(--gold-dark);
    background: rgba(240,192,64,.1);
    color: var(--gold);
}
.nav-admin {
    background: linear-gradient(135deg, var(--red), var(--red-light));
    color: #fff !important;
    border-color: transparent !important;
    padding: 8px 20px;
}
.nav-admin:hover { opacity: .85; transform: translateY(-1px); }

/* ===== HERO BANNER ===== */
.hero {
    background: linear-gradient(135deg, #1a0000 0%, #0a0a0a 40%, #0d0808 100%);
    border-bottom: 1px solid var(--border);
    padding: 52px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(192,57,43,.15) 0%, transparent 70%);
    pointer-events: none;
}
.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    line-height: 1.2;
}
.hero-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 24px;
}
.hero-badges {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-badge {
    font-size: .82rem;
    padding: 6px 18px;
    border-radius: 50px;
    border: 1px solid var(--gold-dark);
    color: var(--gold);
    background: rgba(240,192,64,.08);
    letter-spacing: 1px;
}

/* ===== FILTER BAR ===== */
.filter-section {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    position: sticky;
    top: 70px;
    z-index: 900;
}
.filter-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.filter-cats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-label { color: var(--text-muted); font-size: .85rem; white-space: nowrap; }
.cat-btn {
    padding: 6px 16px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-soft);
    font-family: 'Sarabun', sans-serif;
    font-size: .88rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.cat-btn:hover, .cat-btn.active {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
    box-shadow: 0 0 12px var(--red-glow);
}
.sort-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sort-select {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 7px 14px;
    border-radius: 8px;
    font-family: 'Sarabun', sans-serif;
    font-size: .88rem;
    cursor: pointer;
}
.sort-select:focus { outline: none; border-color: var(--gold-dark); }

/* ===== MAIN CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ===== SECTION TITLE ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--gold);
}
.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--gold-dark), transparent);
}
.section-count {
    color: var(--text-muted);
    font-size: .85rem;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

/* ===== PRODUCT CARD ===== */
.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}
.product-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: 0 16px 48px rgba(0,0,0,.5), 0 0 24px var(--gold-glow);
}

/* Image */
.card-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: var(--bg3);
}
.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.product-card:hover .card-img { transform: scale(1.07); }
.card-img-wrap .no-img {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 3rem;
}

/* Badges */
.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .5px;
    z-index: 2;
}
.badge-new {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #000;
    animation: pulse-gold 2s infinite;
}
.badge-sale {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff;
    animation: pulse-red 2s infinite;
}
.badge-promo {
    background: linear-gradient(135deg, #6c3483, #9b59b6);
    color: #fff;
}
@keyframes pulse-gold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240,192,64,.5); }
    50%       { box-shadow: 0 0 0 6px rgba(240,192,64,0); }
}
@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,.5); }
    50%       { box-shadow: 0 0 0 6px rgba(231,76,60,0); }
}

/* Sold overlay */
.sold-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.sold-overlay span {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    border: 3px solid #fff;
    padding: 8px 24px;
    border-radius: 8px;
    letter-spacing: 3px;
    transform: rotate(-15deg);
}

/* Card body */
.card-body {
    padding: 16px;
}
.card-category {
    font-size: .78rem;
    color: var(--gold-dark);
    margin-bottom: 4px;
    font-weight: 600;
    letter-spacing: .5px;
}
.card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.card-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold);
}
.stock {
    font-size: .72rem;
    padding: 2px 10px;
    border-radius: 50px;
    font-weight: 600;
}
.stock.available { background: rgba(46,204,113,.15); border: 1px solid rgba(46,204,113,.4); color: #2ecc71; }
.stock.sold      { background: rgba(231,76,60,.15); border: 1px solid rgba(231,76,60,.4); color: #e74c3c; }
.stock.reserved  { background: rgba(243,156,18,.15); border: 1px solid rgba(243,156,18,.4); color: #f39c12; }

.btn-detail {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--red), var(--red-light));
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    width: 100%;
}
.btn-detail:hover {
    opacity: .88;
    box-shadow: 0 4px 16px var(--red-glow);
    transform: translateY(-1px);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
    grid-column: 1/-1;
}
.empty-state .icon { font-size: 4rem; margin-bottom: 16px; opacity: .4; }
.empty-state h3 { font-size: 1.2rem; color: var(--text-soft); }

/* ===== PRODUCT DETAIL PAGE ===== */
.product-detail { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }

/* Gallery */
.gallery-main {
    position: relative;
    aspect-ratio: 1/1;
    background: var(--bg3);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.gallery-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg3);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--gold); box-shadow: 0 0 12px var(--gold-glow); }

/* Product Info */
.product-info-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.product-info-cat { color: var(--gold-dark); font-size: .85rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }
.product-info-name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--text);
    line-height: 1.3;
}
.product-info-code { color: var(--text-muted); font-size: .85rem; }
.product-info-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold);
}
.product-info-table {
    width: 100%;
    border-collapse: collapse;
}
.product-info-table td {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
    font-size: .92rem;
}
.product-info-table td:first-child { color: var(--text-muted); width: 120px; }
.product-info-table td:last-child  { color: var(--text); font-weight: 500; }
.product-desc { color: var(--text-soft); font-size: .95rem; line-height: 1.8; }

/* Contact buttons */
.contact-buttons { display: flex; flex-direction: column; gap: 12px; }
.btn-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius);
    background: #06C755;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
}
.btn-line:hover { background: #05a847; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(6,199,85,.3); }
.btn-facebook {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius);
    background: #1877F2;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
}
.btn-facebook:hover { background: #1565d8; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(24,119,242,.3); }
.contact-note { font-size: .82rem; color: var(--text-muted); text-align: center; }

/* Video embed */
.video-wrap {
    margin-top: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
    border: 1px solid var(--border);
}
.video-wrap iframe { width: 100%; height: 100%; border: none; }

/* Back btn */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: .9rem;
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border);
    transition: var(--transition);
    margin-bottom: 24px;
}
.btn-back:hover { color: var(--gold); border-color: var(--gold-dark); }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at top, #2d0808 0%, #0a0a0a 70%);
    padding: 24px;
}
.login-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow), 0 0 60px rgba(192,57,43,.1);
}
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo img { width: 90px; height: 90px; border-radius: 50%; border: 3px solid var(--gold-dark); margin: 0 auto 12px; box-shadow: 0 0 24px var(--gold-glow); }
.login-logo h2 {
    font-family: 'Playfair Display', serif;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.6rem;
}
.login-logo p { color: var(--text-muted); font-size: .85rem; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; color: var(--text-soft); font-size: .88rem; margin-bottom: 8px; font-weight: 500; }
.form-input {
    width: 100%;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text);
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}
.form-input:focus { outline: none; border-color: var(--red); background: rgba(192,57,43,.08); }
.btn-login {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--red), var(--red-light));
    color: #fff;
    font-family: 'Sarabun', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.btn-login:hover { opacity: .88; box-shadow: 0 8px 24px var(--red-glow); transform: translateY(-1px); }
.alert-error {
    background: rgba(231,76,60,.15);
    border: 1px solid rgba(231,76,60,.4);
    border-radius: 8px;
    padding: 12px 16px;
    color: #e74c3c;
    font-size: .9rem;
    margin-bottom: 20px;
}

/* ===== FOOTER ===== */
.site-footer {
    margin-top: 80px;
    padding: 40px 24px 24px;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}
.footer-contact {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.footer-contact a { color: var(--text-muted); font-size: .9rem; transition: var(--transition); }
.footer-contact a:hover { color: var(--gold); }
.footer-copy { color: rgba(255,255,255,.2); font-size: .78rem; margin-top: 16px; }

/* ===== TOAST NOTIFICATION ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 24px;
    color: var(--text);
    z-index: 9999;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(16px);
    transition: all .3s ease;
    max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: rgba(46,204,113,.4); }
.toast.error   { border-color: rgba(231,76,60,.4); }

/* ===== CARD SHARE BUTTON ===== */
.card-share-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 1;
    transition: all .22s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.card-share-btn:hover {
    background: rgba(240,192,64,.92);
    color: #000;
    transform: scale(1.14);
    box-shadow: 0 4px 18px rgba(240,192,64,.45);
}
.card-share-btn.copied {
    background: rgba(46,204,113,.92);
    color: #fff;
}

/* ===== INDEX SHARE TOAST ===== */
.index-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #1a3a52, #2980b9);
    color: #fff;
    font-family: 'Sarabun', sans-serif;
    font-size: .92rem;
    font-weight: 600;
    padding: 11px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,.45);
    opacity: 0;
    pointer-events: none;
    transition: all .32s cubic-bezier(.4,0,.2,1);
    z-index: 9999;
    white-space: nowrap;
}
.index-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .product-detail-grid { grid-template-columns: 1fr; gap: 28px; }
    .filter-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 600px) {
    .navbar-inner { padding: 0; }
    .navbar-title .tagline { display: none; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .login-box { padding: 28px 20px; }
}
@media (max-width: 380px) {
    .product-grid { grid-template-columns: 1fr; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.product-card { animation: fadeInUp .4s ease both; }
.product-card:nth-child(2) { animation-delay: .05s; }
.product-card:nth-child(3) { animation-delay: .1s; }
.product-card:nth-child(4) { animation-delay: .15s; }
.product-card:nth-child(5) { animation-delay: .2s; }
.product-card:nth-child(6) { animation-delay: .25s; }

/* gold shimmer */
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position:  200% center; }
}
.gold-shimmer {
    background: linear-gradient(90deg, var(--gold-dark) 0%, var(--gold) 40%, var(--gold-light) 50%, var(--gold) 60%, var(--gold-dark) 100%);
    background-size: 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}
