* {
  box-sizing: border-box;
}

:root {
  --primary-color: #3b2689;
  --primary-color-dark: #2a1b63;
  --secondary-color: #5a45b8;
  --accent-color: #ffd700;
  --text-dark: #333;
  --text-light: #666;
  --border-color: #ddd;
  --paper: #fffdf8;
}

body {
  margin: 0;
  color: var(--text-dark);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.home-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(90deg, #241769 0%, #3b2689 55%, #4c35a0 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 4px 24px rgba(16, 10, 38, 0.38);
}

.home-topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.8rem;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.home-topbar .site-brand {
  position: static;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 56px;
  background: transparent;
  border: none;
  box-shadow: none;
  text-decoration: none;
}

.home-topbar .site-brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ── Topbar address bar ── */
.home-topbar-address {
  flex: 1;
  min-width: 0;
  max-width: 520px;
  position: relative;
}

.home-topbar-address .address-input-wrapper {
  gap: 0.45rem;
}

.home-topbar-address .address-input-wrapper input {
  flex: 1;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 22px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: #fff;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
}

.home-topbar-address .address-input-wrapper input::placeholder {
  color: rgba(255, 255, 255, 0.56);
}

.home-topbar-address .address-input-wrapper input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.home-topbar-address .geolocation-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: #fff;
  padding: 0.42rem 0.55rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.home-topbar-address .geolocation-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.home-topbar-address .address-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 300;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #e0d5f5;
}

.home-topbar-address-status {
  display: none;
}

.home-shell {
  width: 100%;
  flex: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 5.3rem 1.1rem 2rem;
}

.home-main {
  display: grid;
  gap: 0.9rem;
}

.home-categories-strip {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) 2.4rem;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 0.3rem 0.82rem;
  border: none;
  border-radius: 0;
  background: transparent;
}

.home-categories-nav {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid #cfcfcf;
  background: #ffffff;
  color: #4a4a4a;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.home-categories-nav:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #f3f3f3;
}

.home-categories-nav:disabled {
  opacity: 0.45;
  cursor: default;
}

.home-categories-scroll {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  padding: 0.1rem 0.15rem 0.2rem;
}

.home-categories-scroll::-webkit-scrollbar {
  display: none;
}

.home-category-chip {
  flex: 0 0 auto;
  min-width: 7.2rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #3f3f3f;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  text-align: center;
}

.home-category-icon {
  font-size: 1.32rem;
  line-height: 1;
}

.home-category-label {
  white-space: nowrap;
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #fff;
  color: var(--primary-color);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.2;
  box-sizing: border-box;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.login-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.75rem 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
  font-family: inherit;
}

.signup-link {
  cursor: pointer;
}

.admin-link:hover,
.login-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-auth-section {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}

.cart-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.75rem 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all 0.3s ease;
  position: relative;
  font-family: inherit;
}

.portal-cart-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cart-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.55);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.portal-cart-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 2px;
}

.cart-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.cart-icon .cart-icon-svg {
  width: 1.22rem;
  height: 1.22rem;
  display: block;
  color: #fff;
}

.cart-count {
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  padding: 0 0.28rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-color);
  color: var(--primary-color);
  font-size: 0.72rem;
  font-weight: 700;
}

.portal-cart-btn .cart-count {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  margin-left: 0;
}

.home-user-info {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
  transition: background 0.15s;
}

.home-user-info:hover {
  background: rgba(255, 255, 255, 0.15);
}

.home-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.55);
  flex: 0 0 auto;
}

.home-user-avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.02rem;
}

.home-user-label {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logout-style {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

#home-login-link,
#home-logout-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

#home-login-link:hover,
#home-logout-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.5);
}

.logout-style:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.5);
}

.hidden {
  display: none !important;
}

.home-superadmin-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  display: flex;
  justify-content: center;
  padding: 0.6rem 1rem;
  background: rgba(30, 10, 5, 0.82);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.home-superadmin-btn {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.35);
  padding: 0.6rem 2rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-superadmin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.home-superadmin-btn:active {
  transform: translateY(0);
}

.home-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(39, 17, 7, 0.55);
  backdrop-filter: blur(6px);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-height: 90vh;
  overflow-y: auto;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
  position: relative;
}

@keyframes slideIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.login-modal-content {
  max-width: 520px;
}

.home-cart-modal-content {
  max-width: 600px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  margin: 0;
  color: var(--primary-color);
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: var(--primary-color);
}

/* Cart Section */
.cart-items {
  padding: 1.5rem;
  min-height: 100px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  gap: 1rem;
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.cart-item-price {
  color: var(--text-light);
  font-size: 0.95rem;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-btn {
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.quantity-btn:hover {
  background: var(--secondary-color);
  color: white;
  border-color: var(--secondary-color);
}

.remove-btn {
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.remove-btn:hover {
  background: #ff5252;
}

.cart-summary {
  padding: 1.5rem;
  border-top: 2px solid var(--border-color);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-weight: bold;
  font-size: 1.2rem;
  color: var(--primary-color);
}

.total {
  color: var(--secondary-color);
}

.checkout-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.checkout-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.empty-cart-message {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}

.home-cart-modal-body {
  display: block;
  min-height: 100px;
}

.home-cart-item {
  background: #fff;
}

.home-cart-line-total {
  margin: 0;
  color: var(--secondary-color);
  font-weight: 700;
  white-space: nowrap;
}

.home-cart-summary {
  display: grid;
  gap: 0.85rem;
}

.home-cart-summary-meta {
  color: var(--text-light);
  font-size: 0.95rem;
}

.home-cart-summary-actions {
  display: grid;
  gap: 0.75rem;
}

.home-cart-summary-link {
  display: block;
  text-align: center;
  text-decoration: none;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #fafbfc;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(212, 74, 63, 0.1);
  background: white;
  outline: none;
}

.submit-btn {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, #d44a3f 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  box-shadow: 0 2px 4px rgba(212, 74, 63, 0.2);
}

.submit-btn:hover {
  background: linear-gradient(135deg, #d44a3f 0%, #b83c32 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(212, 74, 63, 0.3);
}

.submit-btn.is-loading {
  opacity: 0.9;
  cursor: wait;
  position: relative;
  padding-right: 3rem;
}

.submit-btn.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: signup-spin 0.7s linear infinite;
}

.auth-error-message {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #f1b8b8;
  background: #ffecec;
  color: #8f1212;
  font-size: 0.9rem;
}

.login-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.login-form .form-group {
  margin-bottom: 1.5rem;
}

.login-modal-content {
  max-width: 450px;
  animation: loginSlideIn 0.4s ease-out;
}

@keyframes loginSlideIn {
  from {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.login-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #d44a3f 100%);
  color: white;
  border-bottom: none;
}

.login-header h2 {
  color: white;
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

.login-header .close-btn {
  color: white;
  font-size: 2rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.login-header .close-btn:hover {
  opacity: 1;
}

.home-modal-card {
  width: min(92vw, 520px);
  max-height: min(90vh, 760px);
  overflow-y: auto;
  border-radius: 8px;
  border: none;
  background: white;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 0;
  animation: loginSlideIn 0.4s ease-out;
}

.home-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0;
  background: linear-gradient(135deg, var(--primary-color) 0%, #d44a3f 100%);
  color: white;
  border-bottom: none;
  padding: 1.5rem 1.5rem;
  border-radius: 8px 8px 0 0;
}

.home-modal-header h2 {
  margin: 0;
  color: white;
  font-size: 1.3rem;
  font-weight: 600;
}

.home-modal-header p {
  display: none;
}

.home-modal-close {
  border: none;
  background: transparent;
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 1.8rem;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.home-modal-close:hover {
  opacity: 1;
}

.signup-modal-card {
  background: linear-gradient(180deg, #f6f0ff 0%, #ffffff 26%);
  border: 1px solid rgba(76, 53, 160, 0.2);
  box-shadow: 0 20px 48px rgba(36, 23, 105, 0.22);
}

#signup-modal .home-modal-header {
  background: linear-gradient(90deg, #241769 0%, #3b2689 55%, #4c35a0 100%);
}

#signup-modal .home-modal-header p {
  display: block;
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
  line-height: 1.4;
}

.signup-form {
  display: grid;
  gap: 1rem;
  padding: 2rem 1.5rem;
  max-width: none;
  margin: 0 auto;
}

.signup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.signup-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #31255f;
  font-size: 0.95rem;
}

.signup-form input {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #ddd3f8;
  border-radius: 8px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.92);
  transition: all 0.3s ease;
}

.signup-form .phone-field {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.signup-form .phone-country {
  width: 140px;
  min-width: 120px;
  border: 2px solid #ddd3f8;
  border-radius: 12px;
  padding: 0.8rem 2.55rem 0.8rem 0.78rem;
  font-size: 0.95rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.92);
  color: #31255f;
  background-image:
    linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(245, 240, 255, 0.92) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2331255f' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m1 1 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: 0 0, right 0.8rem center;
  background-size: auto, 12px 8px;
  box-shadow: 0 8px 18px rgba(59, 38, 137, 0.08);
  appearance: none;
  transition: all 0.3s ease;
}

.signup-form .phone-number {
  flex: 1;
}

.signup-form input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 38, 137, 0.14);
  background: white;
}

.signup-form .phone-country:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 38, 137, 0.14);
  background: white;
}

.signup-address-field {
  position: relative;
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.signup-address-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
}

.signup-address-field input {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #ddd3f8;
  border-radius: 8px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.92);
  transition: all 0.3s ease;
}

.signup-address-field input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 38, 137, 0.14);
  background: white;
}

.signup-address-field .address-suggestions {
  left: 0;
  right: 0;
  top: calc(100% + 6px);
}

.signup-feedback {
  margin: 1rem 0 0 0;
  padding: 0.8rem 0.9rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  border: 1px solid;
}

.signup-feedback.success {
  background: #eaf8ee;
  border-color: #9dd0ab;
  color: #176238;
}

.signup-feedback.error {
  background: #ffecec;
  border-color: #efb6b6;
  color: #8f1212;
}

.signup-actions {
  display: flex;
  justify-content: flex-end;
}

.home-login-card {
  width: min(92vw, 520px);
}

.signup-submit-btn {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(90deg, #241769 0%, #3b2689 55%, #4c35a0 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  box-shadow: 0 8px 20px rgba(59, 38, 137, 0.25);
}

.signup-submit-btn:hover {
  background: linear-gradient(90deg, #2b1b76 0%, #412b97 55%, #5a45b8 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(59, 38, 137, 0.3);
}

.signup-submit-btn.is-loading {
  opacity: 0.9;
  cursor: wait;
  position: relative;
}

.signup-submit-btn.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 1rem;
  height: 1rem;
  margin-top: -0.5rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  animation: signup-spin 0.7s linear infinite;
}

@keyframes signup-spin {
  to {
    transform: rotate(360deg);
  }
}
}

.search-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.search-panel-title {
  margin: 0;
  color: var(--primary-color);
  font-size: 2rem;
  line-height: 1.15;
}

.search-panel-subtitle {
  margin: 0.35rem 0 0.7rem;
  color: var(--text-light);
  font-size: 1rem;
}

.search-panel label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 700;
  color: var(--primary-color);
}

.search-panel input {
  width: 100%;
  border: 2px solid var(--border-color);
  border-radius: 9px;
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
}

.search-panel input:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 5px rgba(210, 105, 30, 0.25);
}

/* ── Header search bar ── */
.header-search-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
}

.header-search-label {
  display: none;
}

.header-search-input {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-family: inherit;
  width: 180px;
  transition: background 0.2s, border-color 0.2s;
}

.header-search-input::placeholder {
  color: rgba(255, 255, 255, 0.56);
}

.header-search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.address-panel {
  position: relative;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #e8d5bf;
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  margin: -0.15rem 0 1rem;
}

.address-panel label {
  display: block;
  margin-bottom: 0.25rem;
  color: #7e4720;
  font-size: 0.88rem;
  font-weight: 700;
}

.address-panel input {
  width: 100%;
  border: 1px solid #ddc1a2;
  border-radius: 8px;
  padding: 0.52rem 0.6rem;
  font-size: 0.94rem;
}

.address-input-wrapper {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.address-input-wrapper input {
  flex: 1;
}

.geolocation-btn {
  background: #fff;
  border: 1px solid #ddc1a2;
  border-radius: 8px;
  padding: 0.52rem 0.7rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.geolocation-btn:hover {
  background: #f5f0e8;
  border-color: var(--secondary-color);
  transform: scale(1.05);
}

.geolocation-btn:active {
  transform: scale(0.95);
}

.geolocation-btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
}

.address-suggestions {
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  top: calc(0.65rem + 1.5rem + 2.25rem);
  max-height: 210px;
  overflow-y: auto;
  border: 1px solid #ddc1a2;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 10px 18px rgba(70, 38, 14, 0.14);
  z-index: 30;
}

.address-suggestion-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid #f0e0cc;
  color: #55331a;
  padding: 0.56rem 0.62rem;
  font-size: 0.9rem;
  cursor: pointer;
}

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

.address-suggestion-item:hover {
  background: #f9f0e4;
}

.address-panel small {
  display: block;
  margin-top: 0.33rem;
  color: #7b644d;
  font-size: 0.78rem;
}

.hidden {
  display: none !important;
}

.results-info {
  font-size: 0.96rem;
  margin-bottom: 0.8rem;
  color: var(--text-light);
}

.restaurants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.restaurant-card {
  background: var(--paper);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.95rem;
  box-shadow: 0 7px 14px rgba(106, 59, 20, 0.08);
}

.restaurant-media-link {
  display: block;
  border-radius: 8px;
  position: relative;
}

.restaurant-admin-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary-color, #c0392b);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

.restaurant-card--admin {
  border-color: var(--primary-color, #c0392b);
  box-shadow: 0 7px 14px rgba(192, 57, 43, 0.15);
}

.restaurant-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ead8c3;
  margin-bottom: 0.7rem;
}

.restaurant-card h3 {
  margin: 0 0 0.4rem;
}

.restaurant-title-link {
  color: var(--primary-color);
  text-decoration: none;
}

.restaurant-title-link:hover {
  text-decoration: underline;
}

.restaurant-meta {
  margin: 0 0 0.8rem;
  color: var(--text-light);
}

.restaurant-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

.restaurant-drive-time {
  font-size: 0.86rem;
  font-weight: 700;
  color: #4b4b4b;
  white-space: nowrap;
}

.empty-message {
  background: rgba(255, 255, 255, 0.76);
  padding: 1rem;
  border-radius: 10px;
  border: 1px dashed #d4b08a;
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid #d8d8d8;
  background: #f1f1f1;
}

.site-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1.1rem 1.2rem;
  display: grid;
  gap: 0.55rem;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
}

.site-footer-links a,
.site-footer-support a {
  color: #3f3f3f;
  font-weight: 600;
  text-decoration: none;
}

.site-footer-links a:hover,
.site-footer-support a:hover {
  text-decoration: underline;
}

.site-footer-support {
  margin: 0;
  color: #5c5c5c;
  font-size: 0.95rem;
}

/* ── Page de Maintenance ── */
.maintenance-page {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(135deg, rgba(36, 23, 105, 0.98) 0%, rgba(60, 40, 137, 0.98) 100%);
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

.maintenance-page.hidden {
  display: none !important;
  pointer-events: none;
}

.maintenance-container {
  width: 100%;
  max-width: 480px;
  padding: 2rem;
}

.maintenance-content {
  background: white;
  border-radius: 16px;
  padding: 3rem 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.maintenance-title {
  margin: 0 0 0.75rem;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.2;
}

.maintenance-subtitle {
  margin: 0 0 2rem;
  font-size: 1.1rem;
  color: #666;
  font-weight: 500;
}

.maintenance-form {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

.maintenance-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.maintenance-form-group label {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.95rem;
}

.maintenance-form-group input {
  padding: 0.9rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background: #fafafa;
}

.maintenance-form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 3px rgba(59, 38, 137, 0.1);
}

.maintenance-btn {
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(59, 38, 137, 0.3);
  font-family: inherit;
  margin-top: 0.5rem;
}

.maintenance-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 38, 137, 0.4);
}

.maintenance-btn:active {
  transform: translateY(0);
}

.maintenance-error {
  padding: 0.75rem 1rem;
  background: #ffebee;
  border: 1px solid #ef5350;
  border-radius: 6px;
  color: #c62828;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 0.5rem;
  display: block;
}

.maintenance-error.hidden {
  display: none;
}

.main-content {
  width: 100%;
}

.main-content.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .home-shell {
    padding-top: 8.5rem;
  }

  .home-user-info {
    padding: 2px;
    gap: 0;
  }

  .home-user-label {
    display: none;
  }

  .home-topbar-inner {
    padding: 0 1rem;
    flex-wrap: wrap;
    height: auto;
    min-height: 66px;
    gap: 0.5rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .home-topbar-address {
    order: 3;
    max-width: 100%;
    flex: 1 1 100%;
  }

  .header-auth-section {
    width: 100%;
    justify-content: flex-end;
    gap: 0.45rem;
    row-gap: 0.45rem;
    flex-wrap: wrap;
  }

  #home-cart-btn,
  #home-user-info,
  #home-logout-btn,
  #home-login-link,
  #home-signup-btn {
    order: 1;
    flex: 0 0 auto;
  }

  .header-search-wrapper {
    order: 2;
    flex: 1 1 100%;
    min-width: 0;
  }

  .header-search-input {
    width: 100%;
  }

  .search-panel-title {
    font-size: 1.55rem;
  }

  .home-categories-strip {
    grid-template-columns: 2.1rem minmax(0, 1fr) 2.1rem;
    gap: 0.45rem;
    padding: 0.65rem 0.2rem 0.58rem;
  }

  .home-categories-nav {
    width: 2.1rem;
    height: 2.1rem;
    font-size: 0.95rem;
  }

  .home-category-chip {
    min-width: 6.45rem;
    font-size: 0.9rem;
    padding: 0.34rem 0.62rem;
    gap: 0.2rem;
  }

  .home-category-icon {
    font-size: 1.12rem;
  }

  .signup-grid {
    grid-template-columns: 1fr;
  }

  .home-modal-card {
    padding: 1rem;
  }

  .home-cart-summary-link {
    width: 100%;
  }

  .site-footer-inner {
    padding: 0.9rem 0.9rem 1rem;
  }

  .site-footer-links {
    gap: 0.45rem 0.8rem;
  }
}
