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

:root {
    --apple-bg: #F5F5F7;
    --apple-surface: #FFFFFF;
    --apple-dark: #1D1D1F;
    --apple-black: #000000;
    --apple-gray: #6E6E73;
    --apple-light-gray: #86868B;
    --apple-border: #D2D2D7;
    --apple-divider: rgba(0, 0, 0, 0.08);
    --apple-blue: #0071E3;
    --apple-blue-hover: #0077ED;
    --apple-orange: #B64400;
    --apple-green: #1D8348;
    --radius-card: 24px;
    --radius-pill: 980px;
    --shadow-card: 2px 4px 16px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 2px 12px 32px rgba(0, 0, 0, 0.11);
    --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.22);
    --transition-apple: 0.32s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Noto Sans Thai", sans-serif;
    background-color: var(--apple-bg);
    color: var(--apple-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 22px;
}

/* ==========================================
   APPLE GLOBAL NAVIGATION BAR
   ========================================== */
.global-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 48px;
    background: rgba(251, 251, 253, 0.82);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--apple-divider);
}

.global-nav-inner {
    max-width: 1024px;
    height: 100%;
    margin: 0 auto;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--apple-dark);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}

.nav-links a,
.nav-links button {
    background: none;
    border: none;
    color: rgba(29, 29, 31, 0.82);
    text-decoration: none;
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.18s ease;
}

.nav-links a:hover,
.nav-links button:hover {
    color: var(--apple-black);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--apple-dark);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    transition: background 0.18s ease;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.bag-badge {
    background: var(--apple-dark);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================
   APPLE RIBBON BANNER
   ========================================== */
.ribbon-bar {
    background: #FFFFFF;
    border-bottom: 1px solid var(--apple-divider);
    padding: 11px 16px;
    text-align: center;
    font-size: 12.5px;
    color: var(--apple-dark);
}

.ribbon-link {
    color: var(--apple-blue);
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 12.5px;
    margin-left: 6px;
}

.ribbon-link:hover {
    text-decoration: underline;
}

/* ==========================================
   APPLE STORE HEADER ("Store. The best way...")
   ========================================== */
.store-header {
    padding: 52px 0 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.store-headline {
    font-size: clamp(32px, 4.5vw, 48px);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.028em;
    max-width: 720px;
}

.store-headline .muted {
    color: var(--apple-gray);
    font-weight: 600;
}

.store-support-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--apple-surface);
    padding: 12px 18px;
    border-radius: 18px;
    box-shadow: var(--shadow-card);
    font-size: 12.5px;
}

/* ==========================================
   FLAGSHIP HERO BANNER (APPLE PRO SHOWCASE)
   ========================================== */
.hero-flagship {
    background: var(--apple-surface);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    margin-bottom: 48px;
}

@media (max-width: 900px) {
    .hero-flagship {
        grid-template-columns: 1fr;
    }
}

.hero-copy {
    padding: 48px 48px;
}

@media (max-width: 640px) {
    .hero-copy {
        padding: 32px 24px;
    }
}

.eyebrow-new {
    color: var(--apple-orange);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.hero-title {
    font-size: clamp(28px, 3.6vw, 44px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 14px;
}

.hero-sub {
    font-size: 16px;
    color: var(--apple-gray);
    line-height: 1.55;
    margin-bottom: 24px;
    max-width: 480px;
}

.hero-price-note {
    font-size: 14px;
    color: var(--apple-dark);
    font-weight: 500;
    margin-bottom: 20px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.btn-apple-blue {
    background: var(--apple-blue);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-pill);
    padding: 11px 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
}

.btn-apple-blue:hover {
    background: var(--apple-blue-hover);
}

.btn-apple-blue:active {
    transform: scale(0.98);
}

.btn-apple-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--apple-dark);
    border: none;
    border-radius: var(--radius-pill);
    padding: 11px 20px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s ease;
}

.btn-apple-secondary:hover {
    background: rgba(0, 0, 0, 0.09);
}

.hero-visual {
    height: 100%;
    min-height: 380px;
    background: #FBFBFD;
    position: relative;
    overflow: hidden;
}

.hero-visual img {
    width: 100%;
    height: 100%;
    max-height: 460px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.hero-flagship:hover .hero-visual img {
    transform: scale(1.025);
}

/* ==========================================
   APPLE CATEGORY PUCKS & SEARCH TOOLBAR
   ========================================== */
.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.022em;
}

.section-title .muted {
    color: var(--apple-gray);
    font-weight: 600;
}

.controls-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 28px;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cat-pill {
    background: var(--apple-surface);
    color: var(--apple-dark);
    border: 1px solid transparent;
    padding: 9px 18px;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.cat-pill:hover {
    border-color: var(--apple-border);
}

.cat-pill.active {
    background: var(--apple-dark);
    color: #FFFFFF;
}

.search-sort-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.apple-search {
    background: var(--apple-surface);
    border: 1px solid var(--apple-border);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    color: var(--apple-dark);
    width: 240px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.apple-search:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.apple-select {
    background: var(--apple-surface);
    border: 1px solid var(--apple-border);
    border-radius: var(--radius-pill);
    padding: 8px 14px;
    font-family: inherit;
    font-size: 13px;
    color: var(--apple-dark);
    cursor: pointer;
}

/* ==========================================
   APPLE STORE PRODUCT CARDS
   ========================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.apple-card {
    background: var(--apple-surface);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition-apple), box-shadow var(--transition-apple);
    cursor: pointer;
}

.apple-card:hover {
    transform: translateY(-4px) scale(1.008);
    box-shadow: var(--shadow-card-hover);
}

.card-eyebrow-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 20px;
    margin-bottom: 6px;
}

.card-eyebrow {
    font-size: 11px;
    font-weight: 600;
    color: var(--apple-orange);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.card-stock-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--apple-green);
}

.card-title {
    font-size: 19px;
    font-weight: 600;
    color: var(--apple-dark);
    letter-spacing: -0.018em;
    line-height: 1.25;
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 13px;
    color: var(--apple-gray);
    line-height: 1.45;
    margin-bottom: 16px;
    min-height: 38px;
}

.card-image-box {
    width: 100%;
    height: 220px;
    border-radius: 16px;
    overflow: hidden;
    background: #F5F5F7;
    margin-bottom: 18px;
}

.card-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.apple-card:hover .card-image-box img {
    transform: scale(1.04);
}

/* Apple Finish Swatches */
.finish-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.finish-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.finish-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: transform 0.15s ease;
}

.finish-dot.selected {
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2), 0 0 0 2px #FFFFFF, 0 0 0 3.5px var(--apple-blue);
}

.finish-name {
    font-size: 11.5px;
    color: var(--apple-light-gray);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--apple-divider);
}

.price-block {
    display: flex;
     flex-direction: column;
}

.price-main {
    font-size: 16px;
    font-weight: 600;
    color: var(--apple-dark);
}

.price-old {
    font-size: 11.5px;
    color: var(--apple-light-gray);
    text-decoration: line-through;
}

/* ==========================================
   APPLE DARK PRO CRAFTSMANSHIP BENTO SECTION
   ========================================== */
.dark-showcase {
    margin-top: 64px;
    background: var(--apple-black);
    color: #F5F5F7;
    border-radius: 32px;
    padding: 56px 40px;
}

@media (max-width: 640px) {
    .dark-showcase {
        padding: 36px 22px;
    }
}

.dark-bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.dark-bento-card {
    background: #1D1D1F;
    border-radius: 22px;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.dark-bento-metric {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    margin-bottom: 6px;
}

.dark-bento-title {
    font-size: 15px;
    font-weight: 600;
    color: #F5F5F7;
    margin-bottom: 6px;
}

.dark-bento-desc {
    font-size: 13px;
    color: #A1A1A6;
    line-height: 1.5;
}

/* ==========================================
   APPLE BAG (SLIDE-OVER DRAWER) & MODALS
   ========================================== */
.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 60;
    display: none;
}

.backdrop.open {
    display: block;
}

.bag-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 100%;
    max-width: 460px;
    background: #FFFFFF;
    z-index: 70;
    box-shadow: var(--shadow-modal);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}

.bag-drawer.open {
    transform: translateX(0);
}

.bag-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--apple-divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bag-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.bag-footer {
    padding: 18px 24px;
    background: #FBFBFD;
    border-top: 1px solid var(--apple-divider);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.modal-overlay.open {
    display: flex;
}

.modal-sheet {
    background: #FFFFFF;
    border-radius: 28px;
    max-width: 780px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: var(--shadow-modal);
}

/* Apple Form Inputs */
.apple-field {
    margin-bottom: 12px;
}

.apple-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--apple-gray);
    margin-bottom: 4px;
}

.apple-input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--apple-border);
    font-family: inherit;
    font-size: 14px;
    color: var(--apple-dark);
    background: #FFFFFF;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.apple-input:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: rgba(29, 29, 31, 0.92);
    backdrop-filter: blur(12px);
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Footer */
.apple-footer {
    margin-top: 64px;
    border-top: 1px solid var(--apple-border);
    padding: 32px 0 40px;
    font-size: 12px;
    color: var(--apple-gray);
}
