/* 🌸 Restaurant Festive Theme 🌸 */
:root {
  /* Brand Colors */
  --primary-color: #f55f0a; /* Festive Saffron: Headings, Buttons, Key Info */
  --secondary-color: #00a99d; /* Regal Teal: Backgrounds, Sub-headings, Icons */
  --accent-color: #ffc107; /* Prosperity Gold: Highlights, Prices, Badges */

  /* Text Colors */
  --text-primary: #2c2c2c; /* Charcoal for readability */
  --text-secondary: #4f4f4f; /* Medium gray */
  --text-muted: #7d7d7d; /* Muted gray */

  /* Backgrounds & Surfaces */
  --highlight-bg: #ffe7c6; /* Light saffron wash */
  --category-bg: #e6f9f6; /* Soft teal tint for category blocks */
  --modal-overlay: rgba(0, 0, 0, 0.55);
  --modal-close: var(--primary-color);
  --modal-close-hover: #c94705; /* Darker saffron */

  /* Buttons */
  --button-green: var(--secondary-color);
  --button-green-hover: #008f82; /* Dark teal hover */
  --button-red: var(--primary-color);
  --button-red-hover: #c94705;

  /* Borders & Shadows */
  --border-light: #ffe0b2; /* Light saffron border */
  --border-medium: #ffcdd2; /* Warm accent border */
  --shadow-light: rgba(245, 95, 10, 0.25); /* Saffron glow */
  --shadow-medium: rgba(0, 0, 0, 0.25);

  /* Base */
  --white: #fffdf9;
  --light-gray: #f9f9f9;
}

/* @font-face {
  font-family: "Numans";
  src: url("fonts/Numans-Regular.woff2") format("woff2"),
    url("fonts/Numans-Regular.woff") format("woff"),
    url("fonts/Numans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
} */

/* --- PRELOADER --- */
#preloaderOpen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.75s ease, visibility 0.75s ease;
  opacity: 1;
  visibility: visible;
}

#preloaderOpen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-container {
  text-align: center;
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader-logo {
  width: 80px;
  height: auto;
  animation: pulse 1.5s ease-in-out infinite;
  z-index: 2;
}

.loader-spinnerOne {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 5px solid var(--secondary-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Ensure the preloader is hidden when the page first loads */
#preloaderOpen {
  display: none;
}

/* --- GLOBAL STYLES --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Numans", sans-serif;
  background-color: var(--light-gray);
  color: var(--text-primary);
  overflow-x: hidden;
}

main {
  padding: 20px;
}

@media (max-width: 1024px) {
  main {
    padding: 15px;
  }
}
@media (max-width: 767px) {
  main {
    padding: 10px;
  }
}

/* --- HEADER --- */
header {
  background-color: #f8f8f8;
  padding: 0;
  color: #333;
}

.main-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  gap: 1.5rem;
  border-bottom: 2px solid var(--primary-color);
}

.logo-container {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
}

.logo {
  height: 100px;
  width: 100px;
  border-radius: 50%;
}

#title {
  margin: 0;
  text-align: left;
  color: #d32f2f;
}
.company-name{
 text-align: left;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}
.svg-icons {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 5px;
}
.contact-item a {
  text-decoration: none;
  color: var(--text-primary);
}
.contact-item span {
  display: inline;
}

@media (max-width: 767px) {
  .contact-item span {
    display: none;
  }
  .contact-info {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 2rem;
  }
}

@media (min-width: 768px) {
  .contact-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }
  .main-header-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
  }
}

@media (max-width: 992px) {
  #title {
    font-size: 1.3rem;
  }
}
@media (max-width: 767px) {
  .main-header-content {
    text-align: center;
    padding: 10px;
  }
  #title {
    font-size: 1.5rem;
  }
  .logo {
    width: 60px;
    height: 60px;
  }
  .contact-info {
    text-align: center;
    gap: 0.75rem;
  }
  .contact-item {
    justify-content: center;
  }
  .logo-container{
    grid-template-columns: 60px 1fr;
  }
}
@media (max-width: 350px) {
  #title {
    font-size: 14px;
  }
  .titledescription {
    font-size: 12px;
  }
  
}

/* --- CONTROLS SECTION --- */
.mobile-controls {
  margin-bottom: 16px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 12px;
  position: relative; /* For the filter overlay positioning */
}

/* New: Top controls layout */
.mobile-controls .cuisine-filters {
  /* Radio buttons row */
  margin-bottom: 12px;
  justify-content: space-around;
  padding: 0;
}
.search-filter-row {
  /* Search + Icon row */
  display: flex;
  gap: 10px;
  align-items: center;
  position: relative;
}
.search-filter-row input {
  flex-grow: 1;
}
.filter-icon-btn {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}
.filter-icon-btn:hover {
  background-color: var(--button-red-hover);
}
.filter-icon-btn svg {
  width: 24px;
  height: 24px;
  stroke: var(--white);
}

/* Styles for the dropdown overlay (old accordion content) */
#filter-content-overlay {
  position: absolute;
  top: 100%; /* Position below the controls */
  right: 0;
  width: 100%;
  background: var(--white);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 0 0 8px 8px;
  padding: 12px;
  z-index: 10;
  display: none; /* Controlled by JS */
}
#filter-content-overlay.active {
  display: block;
}

.control-item {
  margin-bottom: 16px;
}
.control-item:last-child {
  margin-bottom: 0;
}

#controls-accordion input,
#controls-accordion select,
#controls-desktop input,
#controls-desktop select,
#mobile-top-controls input,
#mobile-top-controls select {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 16px;
}

.desktop-controls {
  margin: 16px;
}

#controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cuisine-filters {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
}

@media (min-width: 768px) {
  .mobile-controls {
    display: none;
  }
  .desktop-controls {
    display: block;
  }
  #controls {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1.5fr;
    align-items: center;
  }
}

@media (max-width: 767px) {
  .desktop-controls {
    display: none;
  }
  /* NEW MOBILE CONTROLS STYLES */
  .mobile-controls {
    position: sticky;
    top: 0;
    z-index: 90;
    border-radius: 0 0 8px 8px;
    margin-bottom: 10px;
  }
}

/* --- PRODUCTS TABLE (Desktop Only) and NEW MOBILE LAYOUT --- */
.products-container {
  width: 100%;
}
.desktop-table {
  display: block;
}
.mobile-accordion {
  display: none;
}

.desktop-table table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

#products-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--white);
  box-shadow: 0 0 10px var(--shadow-light);
}

th,
td {
  padding: 12px;
  text-align: center;
  border: 1px solid var(--border-medium);
}

th {
  background-color: var(--primary-color);
  color: var(--white);
  font-weight: 600;
}

.category-row td,
.category-row {
  background-color: var(--category-bg);
  font-weight: bold;
  text-align: center;
  padding: 5px;
}

.product-image {
  width: 70px;
  height: 70px;
  object-fit: cover;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.2s;
}
.product-image:hover {
  transform: scale(1.1);
}

.price {
  font-weight: bold;
  color: var(--text-primary);
}

/* Original mobile styles (now hidden) */
@media (max-width: 767px) {
  .desktop-table {
    display: none;
  }
  .mobile-accordion {
    display: none;
  } /* Ensure old mobile view is hidden */

  #products-table thead { /* <-- Ippidi maathunga */
    display: none;
  }
  #products-table tbody {
    display: block;
  }

  /* Removed old mobile list styling as we are using the new card layout */
}

/* --- QUANTITY CONTROLS --- */
.quantity-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.quantity-controls button {
  width: 40px;
  height: 40px;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  border-radius: 4px;
  transition: background-color 0.2s;
}
.quantity-controls button:hover {
  background-color: #e03e00;
}
.quantity-input {
  width: 50px;
  height: 40px;
  text-align: center;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 1em;
}
@media (max-width: 767px) {
  .quantity-controls button {
    width: 25px;
    height: 25px;
    font-size: 1em;
  }
  .quantity-input {
    width: 30px;
    height: 25px;
    font-size: 0.9em;
  }
}

.highlight-row {
  background-color: var(--highlight-bg);
}

/* --- MODALS --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  padding-top: 50px;
  animation: fadeIn 0.3s ease-in-out;
}
.modal-content {
  background-color: var(--white);
  margin: 5% auto;
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  position: relative;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
}
.modal-header {
  background-color: var(--category-bg);
  padding: 1rem 2rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--primary-color);
  text-align: center;
}
.close {
  color: var(--primary-color);
  font-size: 2.5rem;
  font-weight: bold;
  position: absolute;
  top: 10px;
  right: 20px;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
  z-index: 10;
}
.close:hover {
  color: var(--modal-close-hover);
  transform: rotate(90deg);
}

/* Image Modal */
#image-modal .modal-content {
  padding: 0;
}
#modal-image {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 0 0 12px 12px;
}

/* Form Modal */
.form-modal-container .modal-text {
  padding: 1.5rem 2rem;
  background-color: var(--light-gray);
}
.form-modal-container .form-input {
  width: 100%;
  padding: 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.form-modal-container .form-input:focus {
  border-color: var(--button-green);
  box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
  outline: none;
}
#table-error {
  color: var(--modal-close);
  font-size: 0.9em;
  font-weight: 500;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
  display: none;
}
.modal-buttons {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 2rem;
  background-color: var(--white);
  border-top: 1px solid var(--border-medium);
}
.modal-buttons button {
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.3s, transform 0.2s;
  flex: 1;
}
#submit-button {
  background-color: var(--button-green);
  color: var(--white);
}
#submit-button:hover {
  background-color: var(--button-green-hover);
  transform: translateY(-2px);
}
#close-form {
  background-color: var(--button-red);
  color: var(--white);
}
#close-form:hover {
  background-color: var(--button-red-hover);
  transform: translateY(-2px);
}
.amount-summary {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 20px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 600;
}
.amount-summary p {
  margin: 0;
  color: #495057;
}
#modal-total-amount {
  color: var(--primary-color);
  font-size: 1.1em;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* --- FLOATING TOTAL BAR --- */
#floating-total {
  position: fixed;
  bottom: -100px; /* Initially hidden */
  left: 0;
  width: 100%;
  background-color: var(--text-primary);
  color: var(--white);
  padding: 12px 10px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 998;
  transition: bottom 0.4s ease-in-out;
  gap: 10px;
}
#floating-total.visible {
  bottom: 0; /* Slides in when cart is not empty */
}
.cart-summary {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 2px;
}
.cart-summary-item {
  font-size: 1rem;
  font-weight: 500;
}
.cart-summary-item-div {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
#total-amount-display {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent-color);
  margin-left: 10px;
}
#clear-cart-button,
#ok-button {
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  transition: background-color 0.2s, transform 0.2s;
}
#ok-button {
  background-color: var(--primary-color);
  color: var(--white);
}
#ok-button:hover {
  background-color: var(--button-red-hover);
  transform: translateY(-2px);
}
#clear-cart-button {
  background-color: #4f4f4f; /* Darker Gray (Matches the image) */
  color: var(--white);
}
#clear-cart-button:hover {
  background-color: #404040;
  transform: translateY(-2px);
}

/* --- UTILITIES --- */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}
.toast {
  background: #28a745; /* success green */
  color: white;
  padding: 12px 20px;
  margin-top: 10px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(-20px);
  animation: slideInToast 0.4s forwards, fadeOutToast 0.5s 3s forwards;
  font-size: 14px;
}
.toast.error {
  background: #dc3545;
}
@keyframes slideInToast {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeOutToast {
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

#goTopBtn {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 30px;
  z-index: 99;
  border: none;
  background-color: var(--accent-color);
  color: white;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;
  width: 50px;
  height: 50px;
}
#goTopBtn:hover {
  opacity: 1;
  transform: translateY(-3px);
}
#goTopBtn svg {
  width: 20px;
  height: 20px;
}
@media (max-width: 768px) {
  #goTopBtn {
    bottom: 80px;
    right: 15px;
    width: 45px;
    height: 45px;
  }
}

/* --- LOADER OVERLAY --- */
#loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
}
.loader-spinner {
  border: 5px solid #f3f3f3;
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

/* --- CART IN MODAL --- */
#modal-cart-items {
  max-height: 25vh;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px;
  background-color: #f9f9f9;
}
.modal-cart-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px 5px;
  border-bottom: 1px solid #e0e0e0;
}
.modal-cart-item:last-child {
  border-bottom: none;
}
.modal-cart-item img {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
}
.modal-cart-item-details {
  flex-grow: 1;
}
.modal-cart-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}
.modal-cart-item-price {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.modal-cart-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-quantity-input {
  width: 35px;
  height: 30px;
  text-align: center;
  border-radius: 5px;
  border: 1px solid var(--accent-color);
}
.modal-cart-item .quantity-controls {
  gap: 3px;
}
.modal-cart-item .quantity-controls button {
  width: 28px;
  height: 28px;
  font-size: 1rem;
}
.delete-item-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #ef4444;
  padding: 5px;
}
.delete-item-btn svg {
  width: 22px;
  height: 22px;
}
.delete-item-btn:hover {
  color: #dc2626;
}

/* --- NEW MOBILE TWO-COLUMN LAYOUT STYLES --- */
#mobile-menu-layout {
  display: none; /* Default hidden, shown in media query */
  gap: 10px;
  padding-bottom: 60px; /* To prevent floating bar overlap */
}

@media (max-width: 767px) {
  /* Hide the old mobile view and desktop view */
  .desktop-table {
    display: none;
  }
  .mobile-accordion {
    display: none;
  }

  /* Show the new two-column layout */
  #mobile-menu-layout {
    display: grid;
    grid-template-columns: 80px 1fr; /* 80px for category sidebar, rest for products */
    gap: 10px;
    height: auto;
    min-height: calc(100vh - 200px);
  }

  /* Categories Sidebar (Left Column) */
  #category-sidebar {
    position: sticky;
    top: 150px; /* Below the sticky controls */
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding-right: 0px;
    border-right: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 0;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s;
    background-color: var(--light-gray);
  }
  .category-item.active,
  .category-item:hover {
    background-color: var(--highlight-bg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }
  .category-item-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 5px;
    border: 2px solid var(--primary-color);
  }
  .category-item-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
  }

  /* Product Card Container (Right Column) - Stacks cards vertically */
  #product-card-container {
    max-height: 100%;
    overflow-y: visible;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }

  /* Product Card Styling - MODIFIED FOR VERTICAL STACK WITHIN CARD */
  .product-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 10px 0px 15px 0px; /* More padding at the bottom */
    height: 220px;
    /* Changed from grid to flex column for vertical stacking (card view) */
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;

    position: relative;
    border: 1px solid var(--border-light);
  }
  .highlight-row.product-card {
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px var(--shadow-light);
  }
  .product-card-image-wrapper {
    width: 100%; /* Ensure wrapper is full width */
    display: flex;
    justify-content: center;
  }
  .product-card-image {
    width: 100px;
    max-height: 100px;
    height: auto;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
  }
  .product-card-details {
    width: 100%; /* Take full width for stacking */
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 5px;
  }
  .product-card-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-align: center; /* Center text in card */
    height: 25px;
  }
  .product-card-tamil {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    text-align: center; /* Center text in card */
  }
  .product-card-price-controls {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center; /* Vertically align items */
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light); /* Separator */
  }
  .product-card-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
  }
  /* Quantity control adaptations for the card */
  .product-card .quantity-controls {
    gap: 5px;
  }
  .product-card .quantity-controls button {
    width: 20px;
    height: 20px;
    font-size: 1em;
  }
  .product-card .quantity-input {
    width: 25px;
    height: 20px;
    font-size: 0.9em;
  }
}

/* --- COMBO OFFER STYLES (NEW) --- */
.combo-offer-section {
  width: 100%;
  text-align: center;
  margin-bottom: 12px;
  display: flex;
}
.combo-offer-toggle {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s;
  width: 100%; /* Take full width in top row */
}
.combo-offer-toggle:hover {
  background-color: var(--button-red-hover);
}

/* Blinking Animation */
.combo-offer-toggle .blink {
  animation: pulse-blink 1.5s infinite;
}
@keyframes pulse-blink {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

/* Notification Badge */
.combo-notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--accent-color);
  color: var(--text-primary);
  border-radius: 50%;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: bold;
  min-width: 25px;
  height: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid var(--white);
}
/* Combo Modal Styles */
#combo-items-container {
  max-height: 50vh;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
#combo-modal-header {
  font-size: 1.8rem;
}
.combo-item {
  /* Define a 3-column layout for the main row (Image, Details, Controls) */
  grid-template-columns: 70px 1fr auto;
  /* Define 2 rows: The main content, and the chips below it */
  grid-template-rows: auto auto auto;
  /* Name the grid areas for layout */
  grid-template-areas:
    "image name name"
    "image details controls"
    "chips chips chips"; /* Chips span all 3 columns */
  display: grid;
  align-items: center;
  gap: 15px 15px; /* Vertical gap 15px, Horizontal gap 15px */
  padding: 10px;
  background-color: #fcfcfc;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.combos-name {
  grid-area: name;
}
/* --- Positioning within the Grid --- */

.combo-item-image {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  grid-area: image; /* Place in the image area */
}

.combo-item-details {
  flex-grow: 1; /* Retain for internal flex use if needed, but grid manages outer sizing */
  grid-area: details; /* Place in the details area */
}

/* This rule is now redundant/incorrect due to grid-area usage, it should be removed or updated */
/* .combos-name{
    grid-column: 2 / span 3; 
} */

.combo-item-name {
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--primary-color);
  margin: 0;
  display: flex;
  justify-content: flex-start;
  flex-direction: column;
}

.combo-item-price {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--secondary-color);
  margin-top: 5px;
}

.combo-item .quantity-controls {
  align-self: center; /* Center vertically on the main row */
  grid-area: controls; /* Place in the controls area */
}

/* --- Included Items (Chips) --- */

.combo-included-items {
  grid-area: chips; /* Span the full width on the bottom row */
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 0; /* Clear margin since grid gap handles spacing */
}

/* This rule is now redundant/incorrect due to grid-area usage, it should be removed */
/* .combo-included-items{
    grid-column: 1 / span 4
} */

.combo-item-chip {
  background-color: var(--highlight-bg); /* Light saffron background */
  color: var(--text-primary);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--primary-color);
}

@media (min-width: 768px) {
  .mobile-controls {
    display: none;
  }
  .desktop-controls {
    display: block;
  }
  /* NEW: Adjust grid to include combo button (1.5fr for combo, 2.5fr for search, 1.5fr for others) */
  #controls {
    display: grid;
    grid-template-columns: 1.5fr 2.5fr 1.5fr 1.5fr;
    align-items: center;
    gap: 16px;
  }

  /* NEW: Hide mobile combo section on desktop */
  #mobile-top-controls .combo-offer-section {
    display: none;
  }

  /* NEW: Ensure the desktop button is visible and takes up its column */
  .desktop-combo-section {
    display: block;
    grid-column: 1 / 2; /* Place the combo button in the first column */
    width: 100%;
  }
}

/* smart_menu/style.css */

/* ... (locate this media query block) ... */

@media (max-width: 767px) {
  .desktop-controls {
    display: none;
  }

  /* NEW: Hide desktop combo section on mobile */
  .desktop-combo-section {
    display: none !important;
  }

  /* THIS SECTION IS MODIFIED TO ENSURE CLICKABILITY */
  #mobile-top-controls .combo-offer-section {
    display: block;
    /* ADDED to ensure the button is on the top layer and fully clickable */
    position: relative;
    z-index: 100; /* Set higher than other elements in the mobile-controls container */
    display: grid;
    grid-template-columns: 2fr 1fr;
  }

  /* NEW MOBILE CONTROLS STYLES */
  .mobile-controls {
    position: sticky;
    top: 0;
    z-index: 90; /* Parent z-index */
    border-radius: 0 0 8px 8px;
    margin-bottom: 10px;
  }

  /* ... (rest of mobile styles) ... */
}

/* smart_menu/style.css */

/* --- HIDE SCROLLBAR IN CATEGORY SIDEBAR --- */
/* Target the category sidebar specifically */
#category-sidebar {
  /* Existing styles remain (max-height, overflow-y: auto, etc.) */

  /* 1. For Internet Explorer and Edge */
  -ms-overflow-style: none;

  /* 2. For Firefox */
  scrollbar-width: none;
}

/* 3. For Chrome, Safari, and Opera */
#category-sidebar::-webkit-scrollbar {
  display: none;
  width: 0 !important; /* Ensures no width is reserved for the scrollbar */
}

/* Inside smart_menu/style.css */

.combo-offer-toggle {
  background-color: var(--primary-color);
  /* NEW: Applied animation to button */
  animation: pulse-blink 1.5s infinite;
  /* ... (rest of styles) ... */
}

/* The old .combo-offer-toggle .blink block was removed. */

/* --- Language Specific Adjustments for Tamil --- */

/* Rule 1: Change .category-item-name font size to .6rem in Tamil mode */
body.lang-ta .category-item-name {
  font-size: 0.6rem !important; /* Use !important if necessary to override existing rules */
}

/* Rule 2: Change .product-card-name font size to .7rem in Tamil mode */
body.lang-ta .product-card-name {
  font-size: 0.7rem !important; /* Use !important if necessary to override existing rules */
}

/* NEW RULE: Apply 0.6rem font size to combo chips only in Tamil mode AND on mobile screens */
@media (max-width: 767px) {
  body.lang-ta .combo-item-chip {
    font-size: 0.6rem !important;
  }
  body.lang-ta #combo-modal-header {
    font-size: 1.2rem !important;
  }
  body.lang-ta .combo-item-name {
    font-size: 0.8rem !important;
  }
  body.lang-ta #title {
    font-size: 1.3rem !important;
  }
  body.lang-ta .t-text {
    font-size: 1rem !important;
  }
}

/* --- Header/Contact Layout Adjustment --- */
.header-controls {
  display: flex;
  flex-direction: column; /* Stack on mobile */
  align-items: center;
  gap: 10px;
}

.header-lang-selector {
  margin: 5px 0 0 0;
  order: -1; /* Place on top visually (mobile) */
}

.header-lang-selector button {
  padding: 5px 10px;
  font-weight: bold;
  border: 2px solid var(--primary-color);
  border-radius: 5px;
  background: #fff;
  color: var(--primary-color);
  cursor: pointer;
  transition: background 0.3s;
}

.header-lang-selector button.active {
  background: var(--primary-color);
  color: #fff;
}

/* Desktop Layout for Header Controls */
@media (min-width: 768px) {
  .header-controls {
    flex-direction: row; /* Side-by-side on desktop */
    justify-content: flex-end;
    align-items: flex-start;
    gap: 20px;
    width: auto;
  }

  .header-lang-selector {
    order: 1; /* Place after contact info */
    margin: 0;
  }
}

/* ==== OVERLAY BACKDROP ==== */
.initial-modal {
  display: none; /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

/* ==== MODAL BOX ==== */
.initial-modal .modal-content {
  background: #ffffff;
  width: 90%;
  max-width: 420px;
  border-radius: 14px;
  padding: 25px 30px;
  box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.15);
  animation: popup 0.28s ease;
}

/* ==== HEADER ==== */
.modal-header h2 {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  margin: 0;
  color: #333;
}

/* ==== BODY TEXT ==== */
.lang-options-body p {
  text-align: center;
  font-size: 15px;
  color: #555;
  margin-bottom: 10px;
  margin-top: 10px;
}

/* ==== CLOSE BUTTON ==== */
.close-initial-lang {
  font-size: 34px;
  font-weight: bold;
  cursor: pointer;
  color: #444;
  transition: 0.2s ease;
  display: flex;
  justify-content: flex-end;
}

.close-initial-lang:hover {
  color: #ff4545;
}

.language-modal-header {
  display: flex;
  padding: 20px;
  justify-content: space-between;
  align-items: center;
}

/* ==== LANGUAGE BUTTONS ==== */
.language-options-popup {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lang-select-btn {
  padding: 12px 18px;
  font-size: 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: 0.25s ease;
}

/* Button colors */
#select-en {
  background: #007bff;
  color: #fff;
}

#select-ta {
  background: #f44336;
  color: #fff;
}

.lang-select-btn:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

/* ==== ANIMATIONS ==== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popup {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .initial-modal .modal-content {
    width: 95%;
    padding: 20px;
  }
}

/* --- MODE SWITCH TOGGLE (NEW) --- */

.mode-switch-container {

  text-align: center;
  /* Center the toggle on mobile */
  display: flex;
  justify-content: flex-end;
}
.toggle-wrapper {
  margin: 0;
}
.toggle-wrapper-desktop{
  display: flex;
  justify-content: center;
}
/* Hide checkbox */
.toggle-checkbox {
  display: none;
}

/* Switch container */
.toggle-switch {
  position: relative;
  width: 80px;
  height: 38px;
  /* Menu Mode (Default) - Secondary Color (Teal/Green) */
  background: var(--secondary-color);
  border-radius: 999px;
  transition: 0.3s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Knob */
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 30px;
  height: 30px;
  /* Knob Color - White */
  background: var(--white);
  border-radius: 50%;
  transition: 0.3s ease;
}

/* Icons/Text */
.toggle-icon {
  position: absolute;
  /* Adjust size and positioning for the icons */
  font-size: 20px;
  top: 9px;
  color: var(--text-primary); /* Default icon color */
  transition: 0.3s ease;
}

/* Menu (left) */
.toggle-icon.menu {
  left: 14px;
  color: var(--white); /* Active icon color */
}

/* Bill (right) */
.toggle-icon.bill {
  right: 14px;
  opacity: 0.7; /* Inactive opacity */
}

/* Move knob & change color when checked (Bill Mode) */
.toggle-checkbox:checked + .toggle-switch {
  /* Bill Mode - Primary Color (Red-Orange/Saffron) */
  background: var(--primary-color);
}

.toggle-checkbox:checked + .toggle-switch::after {
  transform: translateX(40px);
}

/* Change icon states when checked (Bill Mode) */
.toggle-checkbox:checked + .toggle-switch .toggle-icon.menu {
  color: var(--text-primary); /* Inactive color */
  opacity: 0.7;
}

.toggle-checkbox:checked + .toggle-switch .toggle-icon.bill {
  color: var(--white); /* Active color */
  opacity: 1;
}

/* --- MENU MODE SPECIFIC HIDING (NEW) --- */
/* 1. Hide Quantity controls and Total column in Menu Mode (desktop) */
body.menu-mode .desktop-table td:nth-child(4),
body.menu-mode .desktop-table th:nth-child(4),
body.menu-mode .desktop-table td:nth-child(5),
body.menu-mode .desktop-table th:nth-child(5) {
    display: none !important; /* ADDED !important */
}

/* 2. Hide Quantity controls in Product Cards (mobile) */
body.menu-mode .product-card .quantity-controls {
    display: none !important; /* ADDED !important */
}
/* Ensure product card price/details still align correctly when controls are hidden */
@media (max-width: 767px) {
    body.menu-mode .product-card-price-controls {
        flex-direction: row; /* Back to row layout */
        justify-content: center;
    }
    body.menu-mode .product-card-price-info {
        display: flex;
        align-items: center;
        width: 100%;
        justify-content: center;
    }
}


/* 3. Hide Floating Order Bar */
body.menu-mode #floating-total {
    display: none !important; /* ADDED !important */
}

/* 4. Hide Combo Quantity Controls in Modal */
body.menu-mode .combo-quantity-controls {
    display: none !important; /* ADDED !important */
}

/* 5. Hide Combo Notification Badge */
body.menu-mode .combo-notification-badge {
    display: none !important; /* ADDED !important */
}

@media (min-width: 768px) {
  /* ... existing styles ... */
  /* NEW: Adjust grid to include mode switch button */
  #controls {
    display: grid;
    /* Combo | Search Bar | Category Dropdown | Sort Dropdown | Mode Switch */
    grid-template-columns: 1.5fr 2.5fr 1.5fr 1.5fr 1.5fr;
    align-items: center;
    gap: 16px;
  }
}


/* --- BILL PREVIEW MODE STYLES (NEW) --- */

/* 1. Hide Language Selector in Bill Preview Mode */
body.bill-preview-active .header-lang-selector {
    display: none !important;
}

/* 2. Hide Main App Content and Floating Bar when Bill Preview is Active */
body.bill-preview-active main,
body.bill-preview-active #floating-total {
    display: none;
}

/* 3. Bill Preview Container Styling */
#bill-preview-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.bill-preview-header {
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.bill-preview-header h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 5px;
}
.bill-preview-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Bill Table Styling */
#customer-bill-table {
    width: 100%;
    border-collapse: collapse;
}
#customer-bill-table thead th {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 10px;
    text-align: left;
    font-weight: 600;
}
#customer-bill-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px dashed var(--border-medium);
    text-align: left;
    color: var(--text-primary);
    font-size: 1rem;
}
/* #customer-bill-table tbody tr:last-child td {
    border-bottom: none;
} */
.bill-item-total, .bill-item-price {
    text-align: right !important;
}
.bill-item-qty {
    text-align: center !important;
}

/* Bill Summary */
.bill-summary {
    text-align: right;
    padding: 15px 10px 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}
.bill-summary span:first-child {
    color: var(--text-primary);
    margin-right: 10px;
}

/* Bill Controls */
.bill-controls {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}
.bill-controls button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}
#back-to-menu-btn {
    background-color: var(--button-red);
    color: var(--white);
}
#back-to-menu-btn:hover {
    background-color: var(--button-red-hover);
    transform: translateY(-2px);
}
#print-bill-btn {
    background-color: var(--button-green);
    color: var(--white);
}
#print-bill-btn:hover {
    background-color: var(--button-green-hover);
    transform: translateY(-2px);
}

/* --- PRINT STYLES --- */
@media print {
    body {
        margin: 0;
        padding: 0;
        background: #fff;
    }

    /* Hide everything except the bill container */
    header, 
    main,
    #floating-total,
    .modal,
    #toast-container,
    #goTopBtn,
    .bill-controls {
        display: none !important;
    }
    
    /* Ensure the bill container is visible and styled for print */
    #bill-preview-container {
        display: block !important;
        max-width: none;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

 /* Bill Table Styling */
#customer-bill-table {
    width: 97%;
    border-collapse: collapse;
}
#customer-bill-table thead th {
    background-color: var(--secondary-color);
    color: black;
    padding: 10px;
    text-align: left;
    font-weight: 600;
    
    /* === ADD THESE LINES FOR VISIBILITY WHEN EMPTY === */
    height: 40px; 
    min-height: 40px;
    /* ================================================= */
}
    #customer-bill-table tbody td {
        border: 2px solid #ddd;
    }
    .bill-preview-header, .bill-summary {
        text-align: center;
        margin-bottom: 10px;
    }
    .bill-preview-header h2 {
        font-size: 1.5rem;
    }
    .bill-summary {
        font-size: 1.1rem;
        color: #000;
    }
    .bill-summary #bill-grand-total {
        font-weight: bold;
    }
}




/* --- FOOTER STYLES --- */
#main-footer {
  background-color: var(--text-primary); /* Uses your charcoal color #2c2c2c */
  color: var(--white);
  padding: 40px 20px 20px;
  margin-top: 40px;
  border-top: 4px solid var(--primary-color); /* Saffron top border */
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  text-align: center;
}

/* Desktop View: Horizontal Layout */
@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Brand Section */
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 50%;
  background-color: var(--white); /* White circle behind logo */
  padding: 2px;
  border: 2px solid var(--primary-color);
}

.footer-company-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color); /* Saffron Text */
  letter-spacing: 0.5px;
}

/* Links Section */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.footer-links a {
  color: #d1d5db; /* Light gray text */
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  position: relative;
}

.footer-links a:hover {
  color: var(--primary-color); /* Hover turns Orange */
}

/* Copyright Section */
.footer-bottom {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.85rem;
  color: #9ca3af;
}




/* --- POLICY VIEW STYLES --- */
#policy-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* Initially hidden via inline style in HTML */
}

/* Scrollable area for long text */
.policy-content-scrollable {
    max-height: 65vh;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.6;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.policy-content-scrollable h3 { 
    color: var(--primary-color); 
    margin-top: 20px; 
    margin-bottom: 10px;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 5px;
}

.policy-content-scrollable ul { 
    padding-left: 20px; 
    list-style-type: none; /* Removed bullet points for cleaner look */
}

.policy-content-scrollable li {
    margin-bottom: 12px;
}

.policy-content-scrollable strong {
    color: var(--text-primary);
}

/* --- STATE MANAGEMENT --- */
/* This hides the MENU/CART controls but KEEPS Header & Footer visible */
body.policy-active main,
body.policy-active #floating-total,
body.policy-active .mobile-controls,
body.policy-active #controls-desktop {
    display: none !important;
}

/* Optional: Add some spacing so the content doesn't touch the header/footer */
body.policy-active {
    background-color: #f4f4f4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ensure policy containers take up available space if content is short */
#policy-container,
#privacy-container,
#refund-container,
#shipping-container {
    flex-grow: 1; 
    margin-bottom: 20px; /* Space before footer */
}


/* --- PRIVACY CONTAINER STYLES --- */
#privacy-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* Initially hidden via inline style in HTML */
}


/* --- REFUND CONTAINER STYLES --- */
#refund-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* Initially hidden via inline style in HTML */
}


/* --- SHIPPING CONTAINER STYLES --- */
#shipping-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* Initially hidden via inline style in HTML */
}