/* 
CSS Color Variables - Easy Theme Management
===========================================
MAIN THEME COLORS - Change these for overall theme:
*/
:root {
  --primary-color: black;
  --secondary-color: rgb(251, 217, 233); /* Custom light pink: R=251, G=217, B=233 */
  --primary-hover: #333; /* Darker version of primary for hover effects */
  --secondary-hover: rgb(241, 197, 213); /* Darker version of secondary for hover */
  --original-green-dark: #1f7a8c; /* Keep original for non-menu elements */
  --original-green-light: #e0f2f1; /* Keep original for non-menu elements */
}

/* 
DROPDOWN MENU COLOR CUSTOMIZATION
==================================
Customize dropdown menu colors separately:
*/
:root {
  --dropdown-background: white;
  --dropdown-border: var(--primary-color);
  --dropdown-item-text: #333;
  --dropdown-item-hover-bg: var(--primary-color);
  --dropdown-item-hover-text: white;
  --dropdown-item-active-bg: var(--primary-hover);
  --dropdown-shadow: rgba(0, 0, 0, 0.15);
}

/* 
ABOUT US SECTION CUSTOMIZATION
==============================
Fine-tune the About Us section appearance:

ULTRA COMPACT SETTINGS (for minimal spacing):
- aboutus-section-padding: 8px;     (Very tight section padding)
- aboutus-text-margin: 2px;         (Minimal gap between text and button)
- aboutus-button-padding: 1px 3px;  (Tiny button)
- aboutus-button-gap: 1px;          (No gap between text and arrows)
- aboutus-button-font-size: 10px;   (Tiny text)
*/
:root {
    --aboutus-section-padding: 8px;
  --aboutus-text-margin: 2px;
  --aboutus-button-padding: 1px 3px;
  --aboutus-content-margin: 3px;
  --aboutus-content-padding: 8px 10px 5px 10px;
  --aboutus-button-gap: 1px;           /* Minimal space between text and arrows */
  --aboutus-button-font-size: 10px;    /* Very small text */
  --aboutus-section-margin: 15px;      /* Space below entire About Us section */
  --aboutus-full-margin: 8px;          /* Space above expanded content */
  --aboutus-full-padding: 8px;         /* Padding above expanded content */
  --aboutus-content-margin: 8px;       /* Space below paragraphs in full content */
}

/* Reset some defaults */
* { box-sizing: border-box; margin:0; padding:0; }

body {
  font-family: Arial, sans-serif;
  background:#f9f9f9;
  color:#333;
}

/* Header */
header {
  display:flex;
  justify-content:center;
  align-items:center;
  padding:12px 20px;
  background:black;
  color:white;
}
header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: bold;
}
header nav a {
  color:white; margin-left:15px; text-decoration:none; font-weight:bold; cursor:pointer;
}
header nav .btn-post {
  background:#ff6600; padding:6px 12px; font-weight:bold;
}
.logo-img {
  height: 2.2em; /* Adjust as needed */
  width: auto;
  object-fit: contain;
  display: block;
  max-width: 100%;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .logo-img {
    height: 1.5em;
    max-height: 40px;
  }
  
  header {
    padding: 8px 15px;
  }

  /* ===== MOBILE RESPONSIVE OVERRIDES ===== */
  
  /* Mobile Grid - Single Column */
  .items-grid { 
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 10px;
    max-width: 400px;
  }

  /* Mobile Cards - Optimized */
  .item-card {
    min-height: 280px;
    max-width: 100%;
  }

  .item-card img {
    width: 85%;
    max-width: 280px;
    margin: 12px auto 8px;
  }

  /* Mobile Typography */
  .item-title {
    font-size: 15px !important;
    margin: 8px 12px 6px !important;
  }
  
  .item-price {
    font-size: 16px !important;
    margin: 0 12px 6px !important;
  }
  
  .item-desc {
    font-size: 13px !important;
    margin: 0 12px 12px !important;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .item-actions {
    padding: 0 12px 12px !important;
    gap: 6px;
  }
}

/* ===== TABLET RESPONSIVE (769px - 1024px) ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  .items-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    max-width: 1000px;
  }
  
  .item-card img {
    width: 88%;
    max-width: 260px;
  }
}

/* ===== DESKTOP RESPONSIVE (1025px - 1440px) ===== */
@media (min-width: 1025px) and (max-width: 1440px) {
  .items-grid {
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 18px;
    max-width: 1200px;
  }
  
  .item-card img {
    width: 85%;
    max-width: 300px;
  }
}

/* ===== LARGE DESKTOP (1441px+) ===== */
@media (min-width: 1441px) {
  .items-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    max-width: 1400px;
  }
  
  .item-card img {
    width: 82%;
    max-width: 340px;
  }
  
  .item-title {
    font-size: 17px;
  }
  
  .item-price {
    font-size: 19px;
  }
}

/* Shop Info Section */
.shop-info {
  text-align: center;
  padding: 15px 20px;
  background: white;
  border-bottom: 1px solid #eee;
}

.shop-address, .shop-hours {
  color: black;
  font-weight: bold;
  margin: 3px 0;
  font-size: 14px;
}

/* Container */
.container { max-width:1000px; margin:20px auto; padding:0 10px; }

/* Mobile container adjustments */
@media (max-width: 768px) {
  .container { 
    margin: 10px auto; 
    padding: 0 8px; 
  }
}

/* Search */
.search-bar { margin-bottom:15px; }
.search-bar input {
  width:100%; padding:10px; border-radius:20px; border:1px solid #ccc; font-size:14px;
}

/* About Us Section */
.about-us-section {
  margin-bottom: 20px;
}

/* Specific About Us Background Color - Direct ID targeting */
#aboutUsSection {
  background-color: rgb(251, 217, 233) !important;
  padding: 12px;
}

.about-us-preview p {
  margin: 0 0 var(--aboutus-text-margin) 0;
  line-height: 1.4;
  color: #333;
}

/* Ensure formatting is preserved in preview with proper line height */
.about-us-preview p * {
  line-height: inherit;
}

.about-us-expand-btn, .about-us-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--aboutus-button-gap);
  cursor: pointer;
  color: var(--primary-color);
  font-weight: bold;
  padding: var(--aboutus-button-padding);
  font-size: var(--aboutus-button-font-size);
  transition: background 0.2s;
}

.about-us-expand-btn:hover, .about-us-collapse-btn:hover {
  background: var(--secondary-color);
}

.about-us-full {
  padding: var(--aboutus-content-padding);
  text-align: left;
  color: var(--text-color);
  font-size: var(--aboutus-font-size);
  line-height: 1.5;
}

.about-us-content {
  white-space: pre-wrap; /* Preserve line breaks and spaces */
  line-height: 1.5;
}

.about-us-content p {
  margin: 0 0 var(--aboutus-content-margin) 0;
  line-height: 1.5;
}

.about-us-content br {
  display: block;
  margin: 0.5em 0;
}

.about-us-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.about-us-images img {
  max-width: 150px;
  height: auto;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Category Menu Button */
.category-menu-container {
  position: relative;
  margin-bottom: 0;
}

.category-menu-button {
  display: flex;
  align-items: center;
  background: var(--secondary-color);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.category-menu-button:hover {
  background: var(--secondary-hover);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Invisible click areas covering 50% each */
.click-area-left,
.click-area-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  cursor: pointer;
  z-index: 10;
}

.click-area-left {
  left: 0;
}

.click-area-right {
  right: 0;
}

.hamburger-left, .hamburger-right {
  display: flex;
  align-items: center;
  padding: 8px;
  transition: background 0.2s;
  position: relative;
  z-index: 5;
}

.hamburger-left:hover, .hamburger-right:hover {
  background: var(--primary-color);
}

.hamburger-left:hover .hamburger-icon span,
.hamburger-right:hover .hamburger-icon span {
  background: white;
}

/* Active state when menus are open */
.hamburger-left.active,
.hamburger-right.active {
  background: var(--primary-color);
}

.hamburger-left.active .hamburger-icon span,
.hamburger-right.active .hamburger-icon span {
  background: white;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 20px;
}

.hamburger-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--primary-color);
  transition: background 0.2s;
}

.menu-text {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: bold;
  color: var(--primary-color);
  font-size: 16px;
  position: relative;
  z-index: 5;
}

.categories-text {
  font-size: 18px;
}

/* Dropdown Menus */
.category-dropdown {
  position: absolute;
  top: 100%;
  background: var(--dropdown-background);
  box-shadow: 0 4px 12px var(--dropdown-shadow);
  z-index: 1000;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  animation: slideDown 0.3s ease-out;
}

.category-dropdown.left-aligned {
  left: 0;
}

.category-dropdown.right-aligned {
  right: 0;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
  color: var(--dropdown-item-text);
}

.category-item:hover {
  background: var(--dropdown-item-hover-bg);
  color: var(--dropdown-item-hover-text);
}

.category-item.active {
  background: var(--dropdown-item-active-bg);
  color: var(--dropdown-item-hover-text);
}

.category-item:last-child {
  border-bottom: none;
}

/* Legacy category styles for compatibility */
.categories { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; }
.category {
  padding:6px 14px;
  background:#e0f2f1; font-size:13px; cursor:pointer; transition:0.2s;
}
.category:hover { background:#1f7a8c; color:white; }
.category.active { background:#1f7a8c; color:white; }

/* Sticky Info Text */
.sticky-info-text {
  background: white;
  margin: 0;
  padding: 15px 20px;
  text-align: center;
  border-bottom: 1px solid #e0e0e0;
  position: relative;
  z-index: 100;
  transition: all 0.3s ease;
}

.sticky-info-text.sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  margin: 0;
  /* Safari-specific fixes */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.sticky-info-text p {
  margin: 0;
  font-size: 16px;
  color: #333;
  line-height: 1.4;
}

.sticky-info-text a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

.sticky-info-text a:hover {
  text-decoration: underline;
}

/* Subtle phone link styling */
.sticky-info-text .phone-link {
  color: #007bff; /* Subtle blue for links */
  text-decoration: none;
  transition: color 0.2s ease;
}

.sticky-info-text .phone-link:hover {
  color: #0056b3;
  text-decoration: underline; /* Only show underline on hover */
}

/* Slightly more obvious on mobile but still subtle */
@media (max-width: 768px) {
  .sticky-info-text .phone-link {
    color: #28a745; /* Just green color on mobile */
    text-decoration: none;
  }
  
  .sticky-info-text .phone-link:active {
    color: #1e7e34; /* Darker green when tapped */
  }
}

/* Force line break before phone number on all screen sizes */
.phone-line-break {
  display: block !important;
}

@media (max-width: 768px) {
  .sticky-info-text {
    padding: 12px 15px;
  }
  
  .sticky-info-text p {
    font-size: 14px;
  }
}

/* Wider phones (400px+) - 2 cards per row with better proportions */
@media (max-width: 768px) and (min-width: 400px) {
  .items-grid { 
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 0 8px;
  }

  .item-card {
    font-size: 13px;
    max-width: 190px;
    margin: 0 auto;
  }

  .item-card img {
    height: 170px;
  }
  
  .item-title, .item-price, .item-desc {
    margin-left: 10px !important;
    margin-right: 10px !important;
  }
  
  .item-title {
    font-size: 14px !important;
  }
  
  .item-price {
    font-size: 14px !important;
  }
  
  .item-desc {
    font-size: 12px !important;
  }
}

/* ===== RESPONSIVE CARD SYSTEM - UNIFIED & DYNAMIC ===== */

/* Base Grid - Responsive & Adaptive */
.items-grid { 
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(12px, 2vw, 20px);
  padding: clamp(10px, 2vw, 20px);
  max-width: 1400px;
  margin: 0 auto;
}

/* Base Card Styles */
.item-card {
  background: white;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
  min-height: 320px;
}

.item-card:hover { 
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Responsive Images - Dynamic Sizing */
.item-card img {
  width: 90%;
  max-width: min(320px, calc(100vw - 60px));
  height: auto;
  object-fit: contain;
  margin: 15px auto 10px;
  display: block;
  transition: transform 0.2s ease;
  
  /* Performance optimizations */
  will-change: transform;
  image-rendering: auto;
  
  /* Loading states */
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s infinite;
  min-height: 150px;
}

.item-card img[src] {
  animation: none;
  background: transparent;
}

@keyframes loading-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.item-card:hover img {
  transform: scale(1.02);
}

/* Typography - Responsive Text */
.item-title { 
  font-weight: bold; 
  margin: 8px 15px 6px; 
  font-size: clamp(14px, 1.2vw, 16px);
  line-height: 1.3;
  color: #333;
}

.item-price { 
  color: #1f7a8c; 
  font-weight: bold; 
  margin: 0 15px 8px; 
  font-size: clamp(15px, 1.3vw, 18px);
}

.item-desc { 
  font-size: clamp(12px, 1vw, 14px);
  color: #666;
  margin: 0 15px 15px;
  flex-grow: 1;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card Actions */
.item-actions { 
  display: flex; 
  gap: 8px; 
  padding: 0 15px 15px; 
  margin-top: auto;
}
.item-actions button {
  flex:1; padding:6px; border:none; font-size:13px; cursor:pointer;
}
.btn-primary { background:#1f7a8c; color:white; }
.btn-secondary { background:#ccc; }

/* Footer */
footer { text-align:center; margin:30px 0; color:#666; font-size:13px; }

/* Modal */
.modal { display:none; position:fixed; top:0; left:0; width:100%; height:100%;
        background:rgba(0,0,0,0.4); justify-content:center; align-items:center; }
.modal-content { background:white; padding:20px; width:320px; max-width:90%; }
.modal-header { font-weight:bold; margin-bottom:10px; display:flex; justify-content:space-between; align-items:center; }
.modal-close { cursor:pointer; font-weight:bold; }

/* About Us Modal - Responsive and Wide */
.modal.about-us-modal .modal-content {
  width: 98%;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Category Modal - Wider for form inputs */
.modal.category-modal .modal-content {
  width: 500px;
  max-width: 95%;
}

/* About Us Editor - Responsive Layout */
@media (max-width: 768px) {
  .modal.about-us-modal .editor-container {
    flex-direction: column !important;
    gap: 15px !important;
  }
  
  .modal.about-us-modal .editor-textarea,
  .modal.about-us-modal .editor-preview {
    width: 100% !important;
    min-width: unset !important;
    min-height: 150px !important;
    max-height: 250px !important;
  }
  
  .modal.about-us-modal .editor-preview {
    order: 2; /* Preview goes below textarea on mobile */
  }

  /* Category menu mobile improvements */
  .category-menu-button {
    padding: 10px;
    font-size: 14px;
  }

  .menu-text {
    font-size: 14px;
  }

  .categories-text {
    font-size: 13px;
  }

  /* Search bar mobile improvements */
  .search-bar {
    margin-bottom: 12px;
  }

  .search-bar input {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px;
  }

  /* About Us section mobile improvements */
  .about-us-section {
    margin-bottom: 15px;
  }

  .about-us-expand-btn,
  .about-us-collapse-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}


/* ===== Fullscreen Gallery Modal ONLY ===== */
.fullscreen-modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.95); /* dark background overlay */
}

.fullscreen-modal .modal-content {
  width: 100vw;
  height: 100vh;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Close button ONLY inside fullscreen gallery */
.fullscreen-modal .close {
  position: fixed;
  top: 15px;
  right: 20px;
  font-size: 32px;
  font-weight: bold;
  color: #fff;   /* white so it shows on dark */
  cursor: pointer;
  z-index: 3100;
}

/* Gallery image scaling */
.fullscreen-modal .gallery-container img {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  margin: auto;
  background: none !important;
  box-shadow: none !important;
}

/* Gallery arrows */
.fullscreen-modal .gallery-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.7);
  border: none;
  font-size: 36px;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 50%;
  user-select: none;
  z-index: 3200;
}
.fullscreen-modal #prevImg { left: 20px; }
.fullscreen-modal #nextImg { right: 20px; }


/*   MODAL FOR GALERY   */
.gallery-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
}

.gallery-content {
  max-width: 90%;
  max-height: 90%;
  background: #111;
  padding: 10px;
  position: relative;
}

.gallery-close {
  position: absolute;
  top: 10px; right: 20px;
  font-size: 2em;
  color: white;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.gallery-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-container img {
  max-width: 80vw;
  max-height: 70vh;
}

.gallery-arrow {
  background: none;
  border: none;
  color: white;
  font-size: 2em;
  cursor: pointer;
  padding: 0 10px;
}

.gallery-thumbs {
  margin-top: 10px;
  text-align: center;
}

.gallery-thumbs img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  margin: 5px;
  cursor: pointer;
  opacity: 0.6;
}

.gallery-thumbs img.active {
  border: 2px solid #1f7a8c;
  opacity: 1;
}


.item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 250px; /* reserve space for image + text */
  padding: 8px;
  box-sizing: border-box;
}

/* Removed conflicting rule - using unified responsive system above */
