@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600&display=swap');

/* ========================= */
/* Base */
/* ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif;
}

:root {
  --primary: #d6336c;
  --secondary: #6c757d;
  --light: #f8f9fa;
  --dark: #212529;
  --border: #e9ecef;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

body {
  background: #fff;
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ========================= */
/* Top Bar */
/* ========================= */
.top-bar {
  background: linear-gradient(135deg, #fff, #f8fafc);
  border-bottom: 1px solid rgba(214,51,108,0.1);
  font-size: 13px;
  padding: 6px 0;
}

.top-bar .top-menu {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.top-bar ul {
  display: flex;
  justify-content: flex-end;
  list-style: none;
}

.top-bar li {
  margin-left: 12px;
}

.top-bar a {
  text-decoration: none;
  color: var(--secondary);
  transition: 0.2s;
}

.top-bar a:hover {
  color: var(--primary);
}

/* ========================= */
/* Header */
/* ========================= */
.main-header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid rgba(214,51,108,0.1);
  z-index: 1000;
  transition: 0.3s;
}

.main-header.scrolled {
  box-shadow: var(--shadow);
}

.header-content {
  max-width: 1200px;
  margin: auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* ========================= */
/* Logo */
/* ========================= */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo img {
  height: 36px;
  width: auto;
}

.logo-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
}

/* ========================= */
/* Search */
/* ========================= */
.search-container {
  position: relative;
}

.search-input {
  width: 0;
  opacity: 0;
  padding: 8px 14px;
  border: 2px solid transparent;
  border-radius: 20px;
  font-size: 14px;
  background: var(--light);
  transition: all 0.3s ease;
}

.search-input.active {
  width: 200px;
  opacity: 1;
  border-color: var(--primary);
  background: #fff;
  box-shadow: var(--shadow);
}

.search-btn {
  background: none;
  border: none;
  color: var(--secondary);
  font-size: 16px;
  cursor: pointer;
  margin-left: 8px;
  transition: 0.2s;
}

.search-btn:hover {
  color: var(--primary);
}

/* ========================= */
/* Navigation (Desktop) */
/* ========================= */
.main-menu ul {
  display: flex;
  list-style: none;
  gap: 6px;
}

.main-menu li {
  position: relative;
}

.main-menu a {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  font-size: 15px;
  color: var(--dark);
  border-radius: 6px;
  transition: 0.2s;
}

.main-menu a:hover {
  background: rgba(214,51,108,0.06);
  color: var(--primary);
}

/* Dropdown (Desktop) */
.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 12px;
  display: none;
  flex-direction: column;
  min-width: 220px;
  z-index: 1001;
}

.main-menu li:hover .submenu {
  display: flex;
}

.submenu a {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--secondary);
  border-radius: 4px;
}

.submenu a:hover {
  background: var(--primary);
  color: #fff;
}

/* ========================= */
/* Hamburger */
/* ========================= */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 1101;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--dark);
  margin: 4px 0;
  border-radius: 2px;
  transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ========================= */
/* Responsive Menu */
/* ========================= */
@media (max-width: 1024px) {
  .hamburger { display: flex; }

  body.menu-open {
    overflow: hidden;
  }
  body.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1098;
  }

  .main-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 80%;
    max-width: 320px;
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    padding: 80px 20px 20px;
    z-index: 1099;
    overflow-y: auto;
  }

  .main-menu.active {
    transform: translateX(0);
  }

  .main-menu ul {
    flex-direction: column;
    gap: 0;
  }

  .main-menu li {
    border-bottom: 1px solid var(--border);
  }

  .main-menu a {
    padding: 14px 0;
    font-size: 16px;
    font-weight: 500;
  }

  /* Submenu Accordion */
  .submenu {
    position: static;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    display: none;
    background: var(--light);
  }

  .main-menu li.open .submenu {
    display: flex;
  }

  .submenu a {
    padding: 12px 20px;
    font-size: 14px;
    color: var(--secondary);
  }

  .submenu a:hover {
    background: var(--primary);
    color: #fff;
  }
}
