/* ---------------------------------- */
/* 1. GLOBAL & RESET STYLES */
/* ---------------------------------- */
html {
  scroll-behavior: smooth;
}
* {margin:0; padding:0; box-sizing:border-box;}
body {
    font-family:'Alice', sans-serif; 
    background:#f9f9f9e8; 
    color:#222;
    line-height: 1.6;
}
a {text-decoration: none; color: inherit; transition: color 0.3s;}
a:hover {color: #555;}

.logo {
    font-family:'Playfair Display', serif; 
    font-size:1.5rem; 
    font-weight:bold; 
    align-items: center; 
    justify-content: center;
}
.section-title {
    font-family:'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
}
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------------------------------- */
/* 2. HEADER & NAVIGATION */
/* ---------------------------------- */
header {
  display:flex; justify-content:space-between; align-items:center;
  padding:16px 16px; border-bottom:0px solid #eee;
  position:sticky; top:0; background:#fff; z-index:20;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.desktop-menu {
    display: none;
    gap: 24px;
}
.lang-switch {
    cursor:pointer; font-size:0.9rem; margin-right: 16px;
    color: #777;
}
.lang-switch:hover {
    color: #222;
}
.mobile-toggle {
    font-size: 1.5rem;
    cursor: pointer;
}
.mobile-menu {
    display: none;
    position: sticky; top: 60px; right: 16px;
    background: white; border-radius: 0px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 16px; z-index: 15;
}
.mobile-menu a {
    display: block;
    padding: 8px 12px;
    border-radius: 0px;
}
.mobile-menu a:hover {
    background: #f5f5f5;
}

@media (min-width: 768px) {
    .desktop-menu { display: flex; }
    .mobile-toggle { display: none; }
}

/* ---------------------------------- */
/* 3. HERO & STORY SECTIONS */
/* ---------------------------------- */
.hero-section {
    height: 110vh;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    text-align: center;
    color: white;
    padding: 0 16px;
}
.hero-title {
    font-size: 3rem;
    font-family: 'Playfair Display', serif;
    animation: fadeIn 2s;
}
.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 32px;
}
.hero-cta {
    padding: 12px 32px;
    background: #222;
    color: white;
    /*font-weight: bold;*/
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background 0.3s, transform 0.3s;
}
.hero-cta:hover {
    background: #444;
    transform: translateY(-2px);
}

.story-section {
    padding: 80px 0;
}
.story-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: center;
}
.story-image {
    width: 100%;
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.story-text h3 {
    font-size: 1.5rem;
    font-family: 'Playfair Display', serif;
    margin-bottom: 16px;
}
.story-text p {
    color: #666;
    line-height: 1.8;
}

@media (min-width: 1024px) {
    .story-content {
        flex-direction: row;
    }
    .story-image {
        width: 50%;
    }
    .story-text {
        width: 50%;
        padding: 0 32px;
    }
}

/* ---------------------------------- */
/* 4. COLLECTION & CAROUSEL STYLES */
/* ---------------------------------- */
.collection-section {
    padding: 0 0 16px 16px; /* กำหนดให้มีแต่ Padding ด้านล่างเท่านั้น */
    max-width: 100%;
    flex-wrap: nowrap;
    /* THE MAGIC: Auto-fit Grid for 240px min width */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1px; /* Gap ระหว่าง items */
    box-sizing: border-box;
    overflow-x: hidden;
}
.collection-group-title {
    font-size: 1.5rem;
    font-family: 'Playfair Display', serif;
    font-weight: bold;
    text-align: center;
    margin-bottom: 24px;
}

.carousel-wrapper {
    position: relative;
    /*max-width: 768px;*/
    margin: 0;
    max-width: 100%;
    overflow: visible;
}
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #FEFEFE;
    color: #777;
    width:40px; height:40px;
    padding: 0px;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 800;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s, background 0.3s;
}
.carousel-nav-btn:hover {
    opacity: 1;
    background: #FFF;
}
.carousel-nav-btn.prev { left: 8px; }
.carousel-nav-btn.next { right: 8px; }

.carousel-container {
    display: flex;
    overflow-x: scroll;
    gap: 12px;
    scroll-snap-type: x mandatory;
    padding-bottom: 16px;
    margin: 48px 48px; /* Space for navigation buttons */
}

/* Hide scrollbar but allow scrolling */
.carousel-container::-webkit-scrollbar { display: none; }
.carousel-container {-ms-overflow-style: none; scrollbar-width: none;} 

.carousel-item {
    flex-shrink: 0;
    width: 320px; /* Default: 1/2 on mobile with some space */
    max-width: 95%;
    margin-right: 0px;
    margin-left: 0px;
    /*scroll-snap-align: start;*/
    border-radius: 2px;
    background: #f9f9f9e8;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: box-shadow 0.3s;
    transition:transform 0.3s; position:relative;
    box-sizing: border-box;
}
.carousel-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.carousel-item-content {
    padding-top: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
    transition:transform 0.3s; position:relative;
    /*margin: 0 60px;
    flex-wrap: wrap;
    justify-content: center; /* ให้ item อยู่กลาง */
    gap: 12px;
    margin: 0 auto;
    max-width: 100vw;  /* จำกัดไม่ให้เกินหน้าจอ */
    overflow-x: hidden; /* ตัด scroll bar ออก */
}
.carousel-item-content:hover {transform:translateY(-5px);}

@media (min-width: 640px) {
    .carousel-item { width: 45%; } /* 2 per row */
}
@media (min-width: 1024px) {
    .carousel-item { 
        /*flex: 0 0 320px;*/ /*width: calc(25% - 12px);*/ 
        flex: 0 1 320px; /* ขยายได้หดได้ โดยเริ่มจาก 320px */
        max-width: 320px; /* สูงสุดไม่เกิน 320px */
        box-sizing: border-box;
        border-radius: 2px;
    } 
    /*.carousel-item { width: 22%; }*/ /* 4 per row */
    .carousel-container { 
        margin: 0 60px; 
        display: flex;
        flex-wrap: nowrap;
        justify-content: center; /* ให้ item อยู่กลาง */
        gap: 12px;
        margin: 0 auto;
        max-width: 100vw;  /* จำกัดไม่ให้เกินหน้าจอ */
        overflow-x: hidden; /* ตัด scroll bar ออก */
    } 
    /*.carousel-container { margin: 0 60px; }*/
}

/* Product Image & Interactions */
.image-container {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
    margin-bottom: 0px;
    border-radius: 2px;
    cursor: pointer;
}
.product-image {
    width: 100%; height: 100%;
    object-fit: cover;
    position: absolute; top: 0; left: 0;
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}
.product-image.hidden {
    opacity: 0;
    visibility: hidden;
    display: none;
}
.product-image:not(.hidden) {
    visibility: visible;
    display: block;
}
.nav-btn {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    color: #888; background: rgba(255,255,255,0.5);
    border: none; border-radius: 50%;
    width: 32px; height: 32px;
    font-size: 1.25rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.3s;
}
.nav-btn:hover { background: rgba(255,255,255,0.8); }
.nav-btn.prev { left: 8px; }
.nav-btn.next { right: 8px; }

/* Product Details */
.product-card-title {
    font-size: 1.125rem;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    margin-bottom: 8px;
}
.rating-stars {
    color: #FFC72C;
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.rating-count {
    font-size: 0.75rem;
    color: #777;
    margin-left: 4px;
}
.price-display {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 16px;
}
.product-description {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 16px;
    height: 40px; /* fixed height for consistency */
    overflow: hidden;
}

/* DISABLED STATES */

/* การ์ดสินค้าที่ทั้งกลิ่นหมดสต็อก */
.product-disabled {
  opacity: 0.4;
  filter: grayscale(1);
  pointer-events: none; /* ป้องกัน hover/คลิกทั้งหมด */
  position: relative;
}

.product-disabled::after {
  content: attr(data-out-of-stock-label);
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Alice', sans-serif;
}

/* ปุ่มไซส์ที่หมดสต็อก */
.size-btn.disabled {
  opacity: 0.3;
  background: #f5f5f5;
  color: #aaa;
  border-color: #ccc;
  cursor: not-allowed;
  pointer-events: none; /* ห้ามกด */
}

/* ปุ่ม Add to Cart ปิดการใช้งาน */
.add-to-cart-btn.disabled {
  background: #999;
  cursor: not-allowed;
}
.add-to-cart-btn.disabled:hover {
  background: #999;
  cursor: not-allowed;
}


/* Size Selector */
.size-btn-group {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}
.size-btn {
    padding: 4px 12px;
    font-size: 0.875rem;
    border: 1px solid #999;
    background: white;
    color: #999;
    border-radius: 4px; /* Pill shape */
    cursor: pointer;
    transition: all 0.2s;
}
.size-btn.active {
    border: 1px solid #222;
    font-weight: 700;
    background: #f7f7f7;
    color: #222;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.size-btn:not(.active):hover {
    background: #eee;
}

/* Add to Cart Button */
.add-to-cart-btn {
    margin-top: auto; /* Push to bottom */
    margin-bottom: 20px;
    width: 80%;
    padding: 10px 16px;
    background: #222;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}
.add-to-cart-btn:hover {
    background: #444;
}

/* ---------------------------------- */
/* 5. REVIEWS & SHOP STYLES */
/* ---------------------------------- */
.reviews-section {
    padding: 80px 0;
    background: #FCFCFC;
}
.review-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    max-width: 900px;
    margin: 0 auto;
}
@media (min-width: 1024px) {
    .review-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.review-form-card {
    background: white;
    padding: 32px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.review-form-card h3 {
    font-size: 1.5rem;
    font-family: 'Playfair Display', serif;
    margin-bottom: 24px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #444;
    margin-bottom: 4px;
}
.form-group input, .form-group select, .form-group textarea {
    display: block;
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: #444;
    outline: none;
    box-shadow: 0 0 0 1px #444;
}
.rating-input {
    display: flex;
    gap: 4px;
    font-size: 1.5rem;
    cursor: pointer;
}
.rating-input i { color: #FFC72C; }
.review-submit-btn {
    width: 100%;
    padding: 10px 16px;
    background: #222;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 24px;
}
.review-submit-btn:hover { background: #444; }
.review-message {
    margin-top: 16px;
    text-align: center;
    font-size: 0.875rem;
}

.sample-reviews-list h3 {
    font-size: 1.5rem;
    font-family: 'Playfair Display', serif;
    margin-bottom: 16px;
}
.review-card {
    background: white;
    padding: 24px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-top: 4px solid #222;
    margin-bottom: 16px;
}
.review-card p { margin-bottom: 8px; }
.review-name { font-weight: bold; font-size: 1.125rem; }
.review-date { font-size: 0.875rem; color: #777; }
.review-fragrance { font-size: 0.875rem; font-weight: 500; color: #555; }
.review-text { font-style: italic; color: #444; }

.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}
@media (min-width: 640px) {
    .shop-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
    .shop-grid { grid-template-columns: repeat(5, 1fr); }
}
.shop-item { text-align: center; }
.shop-item img {
    width: 100%;
    height: auto;
    border-radius: 2px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.shop-item h3 {
    font-size: 1.125rem;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    margin-bottom: 8px;
}

/* ---------------------------------- */
/* 6. UTILITY & ANIMATION */
/* ---------------------------------- */
.fade-in { opacity: 0; transition: opacity 0.9s ease-out, transform 0.9s ease-out; }
.fade-up { transform: translateY(40px); }
.fade-left { transform: translateX(-40px); }
.fade-right { transform: translateX(40px); }
.fade-in.visible { opacity: 1; transform: translateX(0) translateY(0); }

.messenger-float {
    position: fixed; bottom: 20px; right: 20px;
    background: linear-gradient(45deg, #379cfa, #093982); color: white;
    /*#0084FF #A33AFF*/
    font-size: 28px; width: 55px; height: 55px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease; z-index: 999;
}
.messenger-float:hover {
    transform: scale(1.1); box-shadow: 0 6px 18px rgba(0,0,0,0.3);
    color: white;
}

/* ---------------------------------- */
/* 7. FOOTER */
/* ---------------------------------- */
footer {
    background: #222;
    color: #ccc;
    padding: 48px 0;
    margin-top: 48px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}
@media (min-width: 768px) {
    .footer-grid { grid-template-columns: repeat(4, 1fr); }
}
.footer-grid h4 {
    color: white;
    font-family: 'Playfair Display', serif;
    margin-bottom: 16px;
}
.social-links { display: flex; gap: 16px; }
.social-links a { color: #ccc; transition: all 0.3s ease; }
.social-links a i { font-size: 28px; }
.social-links a.s-facebook i { font-size: 32px; }
.social-links a.s-instagram i { font-size: 32px; }

/* hover ของ social ทั้งหมด (คงเดิม) */
.social-links a.s-facebook:hover {
  background: linear-gradient(225deg, #00c6ff, #0072ff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.social-links a.s-instagram:hover {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.social-links a.s-tiktok:hover {
  background: linear-gradient(45deg, #69C9D0, #EE1D52);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.social-links a.s-line:hover { color: #30F257; }
.social-links a.s-youtube:hover {
  background: linear-gradient(225deg, #E62117, #ff0000);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.social-links a.s-mail:hover {
  background: linear-gradient(225deg, #FBBC04, #FFE587);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.footer-grid ul { list-style: none; padding: 0; }
.footer-grid ul li { margin-bottom: 8px; }
.footer-grid ul li a { font-size: 0.875rem; transition: color 0.3s; }
.footer-grid ul li a:hover { color: white; }
.copyright {
    text-align: center;
    margin-top: 32px;
    font-size: 0.75rem;
    color: #555;
}

/* ✅ เพิ่มสไตล์ counter ตะกร้า (เล็กน้อย) */
.cart-icon #cart-count{
  position:absolute; top:-8px; right:-10px;
  background:#ff0000; color:#fff; font-size:12px;
  border-radius:50%; padding:2px 6px; line-height:1;
}


/* 🛒 CART POPUP */
.cart-popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.cart-popup {
  width: 90%;
  max-width: 480px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cart-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111;
  color: #fff;
  padding: 16px 20px;
}
.close-cart {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #fff;
  cursor: pointer;
}
.cart-items {
  max-height: 380px;
  overflow-y: auto;
  padding: 16px;
}
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
  padding: 10px 0;
}
.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}
.cart-item-info {
  flex: 1;
  margin-left: 10px;
}
.cart-item-info h4 {
  margin: 0;
  font-size: 0.95rem;
}
.cart-item-info p {
  margin: 2px 0;
  color: #555;
  font-size: 0.8rem;
}
.cart-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cart-qty button {
  border: none;
  background: #ddd;
  color: #111;
  font-weight: bold;
  padding: 3px 7px;
  border-radius: 3px;
  cursor: pointer;
}
.cart-qty button:hover {
  background: #bbb;
}
.remove-item {
  border: none;
  background: none;
  color: #c00;
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: 6px;
}
.cart-footer {
  border-top: 1px solid #eee;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-total {
  font-weight: bold;
  font-size: 1rem;
}
.checkout-btn {
  background: #111;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 10px 18px;
  cursor: pointer;
}
.checkout-btn:hover {
  background: #333;
}

