/*
Theme Name: Rom Ngam Theme
Description: Mobile-First Theme สำหรับร้านร่มงาม
Version: 1.0.4
Author: Rom Ngam
*/

:root {
    --brand-yellow: #F5C542;
    --brand-yellow-dark: #D4A017;
    --wood-brown: #8B5A2B;
    --ink-black: #1A1A1A;
    --paper-white: #FFFBF0;
    --gray-soft: #F5F5F5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Prompt', 'Sarabun', sans-serif;
    background: var(--paper-white);
    color: var(--ink-black);
    line-height: 1.6;
    padding-bottom: 70px;
}

a { text-decoration: none; color: inherit; }

/* ===== Header ===== */
.site-header {
    background: var(--brand-yellow);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.site-header .logo { font-size: 1.25rem; font-weight: bold; }

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, var(--brand-yellow) 0%, var(--brand-yellow-dark) 100%);
    padding: 3rem 1rem;
    text-align: center;
    color: var(--ink-black);
}
.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.btn-primary {
    display: inline-block;
    background: var(--ink-black);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    margin-top: 1rem;
}

/* ===== Product Grid ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem;
}
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.product-image {
    aspect-ratio: 1;
    background: var(--gray-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 0.8rem; }
.product-info h3 { font-size: 0.9rem; margin-bottom: 0.3rem; }
.product-info .price { color: var(--wood-brown); font-weight: bold; font-size: 1.1rem; }

/* ===== Bottom Navigation ===== */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 100;
}
.bottom-nav a { text-align: center; font-size: 0.7rem; flex: 1; color: #666; position: relative; }
.bottom-nav a.active { color: var(--brand-yellow-dark); font-weight: bold; }
.bottom-nav .nav-icon { font-size: 1.5rem; display: block; margin-bottom: 2px; }

.cart-badge-nav {
    position: absolute;
    top: -6px;
    right: calc(50% - 20px);
    background: #d63638;
    color: #fff;
    border-radius: 10px;
    font-size: .58rem;
    padding: 1px 5px;
    font-weight: 700;
    line-height: 1.2;
}

/* ===== แถบปุ่มลอย ===== */
.checkout-bar,
.sticky-action-bar {
    position: fixed;
    bottom: 62px;
    left: 0;
    right: 0;
    background: white;
    padding: 0.8rem 1rem;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    z-index: 99;
}
.page-checkout-main { padding-bottom: 170px; }
.page-product-main { padding-bottom: 150px; }

/* ===== Mobile PDP ===== */
body.pdp { padding-bottom: 0; }
.pdp-main { padding-bottom: 85px; }
.pdp-appbar {
    position: sticky;
    top: 0;
    z-index: 120;
    background: var(--brand-yellow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
}
.pdp-appbar .icon-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    position: relative;
}
.pdp-appbar .search-pill {
    flex: 1;
    background: rgba(255,255,255,0.85);
    border-radius: 50px;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    color: #666;
}
.cart-badge .dot {
    position: absolute;
    top: -4px;
    right: -8px;
    background: #d63638;
    color: #fff;
    border-radius: 10px;
    font-size: 0.6rem;
    padding: 1px 5px;
}
.pdp-carousel { position: relative; aspect-ratio: 1; background: var(--gray-soft); overflow: hidden; }
.pdp-carousel .track { display: flex; height: 100%; transition: transform 0.3s ease; }
.pdp-carousel .track img { width: 100%; height: 100%; object-fit: cover; flex: 0 0 100%; }
.pdp-carousel .nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.35);
    color: #fff;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
}
.pdp-carousel .nav.prev { left: 8px; }
.pdp-carousel .nav.next { right: 8px; }
.pdp-price { font-size: 1.6rem; font-weight: 700; color: var(--wood-brown); padding: 0.75rem 1rem 0; }
.pdp-name { font-size: 1.05rem; font-weight: 600; padding: 0.25rem 1rem 0; }
.pdp-varlabel { font-size: 0.8rem; color: #666; padding: 0.2rem 1rem 0.5rem; }
.opt-group { padding: 0.4rem 1rem; }
.opt-title { font-size: 0.85rem; color: #666; margin-bottom: 0.4rem; }
.chips { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; }
.chip {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 50px;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
}
.chip.active { background: var(--ink-black); color: #fff; border-color: var(--ink-black); }
.pdp-desc {
    background: #fff;
    margin: 0.75rem 1rem;
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.9rem;
    color: #333;
}
.pdp-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0,0,0,0.12);
    z-index: 130;
}
.pdp-act {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.68rem;
    color: #444;
    cursor: pointer;
    min-width: 58px;
}
.pdp-act .ic { font-size: 1.3rem; }
.pdp-buy {
    flex: 1;
    background: var(--brand-yellow);
    border: none;
    border-radius: 50px;
    padding: 0.85rem 1rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}
.pdp-buy:disabled { opacity: 0.5; cursor: not-allowed; }
.toast {
    position: fixed;
    left: 50%;
    bottom: 95px;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.toast.show { opacity: 1; }