/* QR Menu - Public Stylesheet */

:root {
  --theme-color: #8b1e3f;
  --bg-color: #f8f9fa;
  --header-bg-color: #8b1e3f;
  --header-text-color: #ffffff;
  --category-bg-color: #ffffff;
  --category-active-bg-color: #8b1e3f;
  --card-default-color: #ffffff;
  --product-name-color: #1f2937;
  --description-color: #6b7280;
  --price-color: #8b1e3f;
  
  --logo-size: 50px;
  --company-short-name-size: 20px;
  --company-name-size: 13px;
  --slogan-size: 12px;
  --phone-size: 13px;
  --address-size: 12px;
  --category-size: 14px;
  --product-name-size: 16px;
  --description-size: 13px;
  --price-size: 16px;
  --product-image-size: 80px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: #333333;
  line-height: 1.4;
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 16px));
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* Fixed Header */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--header-bg-color);
  color: var(--header-text-color);
  padding: 10px 14px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.company-logo {
  width: var(--logo-size);
  height: var(--logo-size);
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.company-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.company-short-name {
  font-size: var(--company-short-name-size);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.company-name {
  font-size: var(--company-name-size);
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.slogan {
  font-size: var(--slogan-size);
  opacity: 0.8;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--header-text-color);
  text-decoration: none;
  font-size: var(--phone-size);
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 20px;
  transition: background 0.2s;
  font-weight: 500;
}

.contact-btn:active {
  background: rgba(255, 255, 255, 0.35);
}

.address-btn {
  font-size: var(--address-size);
  max-width: 140px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Category Navigation Bar */
.category-wrapper {
  position: sticky;
  top: 68px;
  z-index: 90;
  background-color: var(--bg-color);
  padding: 10px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.category-nav {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 0 16px;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.category-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  background-color: var(--category-bg-color);
  color: var(--product-name-color);
  font-size: var(--category-size);
  font-weight: 600;
  border: 1px solid rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.category-pill.active {
  background-color: var(--category-active-bg-color);
  color: #ffffff;
  border-color: var(--category-active-bg-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Menu Container */
.menu-container {
  padding: 16px;
}

.category-section {
  margin-bottom: 24px;
  scroll-margin-top: 130px;
}

.category-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--product-name-color);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--theme-color);
  display: inline-block;
}

.products-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Product Card */
.product-card {
  background-color: var(--card-default-color);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-size: var(--product-name-size);
  font-weight: 700;
  color: var(--product-name-color);
  margin-bottom: 4px;
  word-break: break-word;
}

.product-description {
  font-size: var(--description-size);
  color: var(--description-color);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.product-price {
  font-size: var(--price-size);
  font-weight: 800;
  color: var(--price-color);
  white-space: nowrap;
}

.product-image-container {
  width: var(--product-image-size);
  height: var(--product-image-size);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  background-color: #f1f5f9;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.product-image:active {
  transform: scale(1.05);
}

/* Image Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.lightbox-modal.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  color: #ffffff;
  margin-top: 12px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #ffffff;
  font-size: 28px;
  font-weight: bold;
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Secret Admin Trigger Area */
.secret-trigger {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 40px;
  z-index: 2000;
  opacity: 0;
  cursor: pointer;
  background: transparent;
  user-select: none;
}

/* Fixed Centered Bottom Navigation Bar & Copyright */
.fixed-bottom-bar {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translate(-50%, 125%);
  width: calc(100% - 24px);
  max-width: 500px;
  margin: 0 auto;
  z-index: 1000;
  background-color: var(--header-bg-color, #8b1e3f);
  color: var(--header-text-color, #ffffff);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
  border-radius: 20px;
  padding: 8px 10px calc(6px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.fixed-bottom-bar.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.bottom-social-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  gap: 2px;
}

.bottom-social-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--header-text-color, #ffffff);
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
  min-height: 44px;
  text-align: center;
  opacity: 0.9;
}

.bottom-social-item:hover,
.bottom-social-item:focus {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

.bottom-social-item:active {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0.94);
  opacity: 1;
}

.bottom-social-item svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.bottom-social-item:active svg {
  transform: scale(1.1);
}

.bottom-copyright {
  width: 100%;
  text-align: center;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 2px;
}

.bottom-copyright a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.bottom-copyright a:hover,
.bottom-copyright a:active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  text-decoration: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
