* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
  font-family: "Lato", sans-serif;
}

/* Scrollbar */
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.msg-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: purple;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 1200;
}

.msg-fab .bx {
  font-size: 22px;
}

.msg-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff3b30;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

@media (max-width: 768px) {
  .msg-fab {
    bottom: 90px;
  }
}
/* ===== Global Loader ===== */
.site-loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(77, 15, 123, 0.52);
  backdrop-filter: blur(2px);
  z-index: 5000;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 0.35s ease,
    visibility 0.35s ease;
}

.site-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-core {
  position: relative;
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
}

.loader-ring {
  width: 100%;
  height: 100%;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-right-color: #fff;
  border-radius: 50%;
  animation: spinRing 1s linear infinite;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.18);
}

.loader-car {
  position: absolute;
  font-size: 38px;
  color: #fff;
  animation: carPulse 1.1s ease-in-out infinite;
}

.loader-text {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

@keyframes spinRing {
  to {
    transform: rotate(360deg);
  }
}

@keyframes carPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.06);
  }
}

@media (max-width: 768px) {
  .loader-core {
    width: 92px;
    height: 92px;
  }

  .loader-car {
    font-size: 32px;
  }

  .loader-text {
    font-size: 0.88rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader-ring,
  .loader-car {
    animation: none;
  }
}

/* =====Header===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #fff;
  padding: 12px 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo span {
  font-size: 1.5rem;
  font-weight: bold;
  color: purple;
  font-family: "Pacifico", cursive;
}
.droit {
  width: 70%;
  display: flex;
  align-items: center;
  gap: 2rem;
  position: relative;
  margin-left: auto;
  justify-content: flex-end;
}
.rech {
  width: 380px;
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 10px;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}
.rech input {
  width: 100%;
  padding: 8px 40px 8px 12px;
  border-radius: 10px;
  border: none;
}
.rech .search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: purple;
  border: none;
  padding: 4px;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
}
.rech .search-btn .bx {
  font-size: 18px;
}
.container nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 25px;
}
.container nav ul li a .bx {
  font-size: 20px;
}

.container nav ul li .nav-btn .bx {
  font-size: 22px;
}
.container nav ul li a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333;
  font-size: 0.7rem;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
  padding-bottom: 6px;
}

.container nav ul li .nav-btn {
  background: none;
  border: none;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333;
  font-size: 0.7rem;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
  padding-bottom: 6px;
  cursor: pointer;
}

.container nav ul li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: purple;
  transition: width 0.3s ease;
}

.container nav ul li .nav-btn::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: purple;
  transition: width 0.3s ease;
}

.container nav ul li a:hover::after {
  width: 100%;
}

.container nav ul li .nav-btn:hover::after {
  width: 100%;
}

.user-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  background-color: purple;
  color: #fff;
  padding: 6px 12px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
}

.user-toggle .bx-chevron-down {
  font-size: 18px;
  margin-left: 2px;
}

.user-menu.open .user-toggle .bx-chevron-down {
  transform: rotate(180deg);
  transition: transform 0.2s ease;
}

.user-toggle::after {
  display: none;
}

.user-toggle:hover {
  opacity: 0.7;
}

.user-toggle .bx {
  font-size: 18px;
}

.user-toggle.order-attention {
  animation: orderAttentionPulse 0.9s ease-in-out infinite;
}

.user-toggle.order-attention .bx-user {
  animation: orderAttentionShake 0.55s ease-in-out infinite;
}

@keyframes orderAttentionPulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(128, 0, 128, 0.45);
  }
  50% {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 0 0 8px rgba(128, 0, 128, 0);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(128, 0, 128, 0);
  }
}

@keyframes orderAttentionShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}

.user-menu {
  position: relative;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  background: #fff;
  border: 1px solid rgba(128, 0, 128, 0.18);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  padding: 12px;
  display: none;
  z-index: 1100;
}

.user-menu.open .user-dropdown {
  display: block;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.user-info strong {
  color: #333;
  font-size: 0.95rem;
}

.user-info small {
  color: #777;
  font-size: 0.8rem;
}

.user-orders {
  border-top: 1px solid rgba(128, 0, 128, 0.12);
  padding-top: 10px;
  margin-bottom: 10px;
}

.orders-title {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 8px;
}

.order-card {
  background: #f8f3fc;
  border: 1px solid rgba(128, 0, 128, 0.15);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-label {
  font-size: 0.75rem;
  color: #777;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.order-amount {
  color: #4b0076;
  font-size: 0.95rem;
}

.order-actions {
  display: flex;
  gap: 8px;
}

.order-actions form {
  flex: 1;
  margin: 0;
}

.order-actions > .order-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.order-actions form .order-btn {
  width: 100%;
}

.order-btn {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease;
}

.order-btn.danger {
  background: #ffe6ea;
  color: #a6002c;
}

.order-btn.success {
  background: #e7f6ee;
  color: #0f7a2f;
}

.order-btn.danger:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(166, 0, 44, 0.18);
}

.order-btn.success:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 122, 47, 0.18);
}

.order-btn:focus-visible {
  outline: 2px solid purple;
  outline-offset: 2px;
}

.user-link {
  display: block;
  text-decoration: none;
  color: #333;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.user-link:hover {
  color: purple;
}

.logout-btn {
  width: 100%;
  border: none;
  background: #f2e6fb;
  color: #5a1a8c;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.logout-btn:hover {
  background: #e6d2f6;
}

.search-only {
  display: none;
}

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 900;
}

@media (max-width: 768px) {
  .droit {
    width: 100%;
    gap: 1rem;
  }

  .search-only {
    display: block;
  }

  .rech {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    background: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    z-index: 1001;
    width: auto;
  }

  .rech input {
    padding: 10px 42px 10px 12px;
  }

  .rech .search-btn {
    right: 10px;
  }

  header.search-open .rech {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  header.search-open nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition:
      opacity 0.2s ease,
      transform 0.2s ease;
  }

  header.search-open .logo,
  header.search-open .user-toggle {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition:
      opacity 0.2s ease,
      transform 0.2s ease;
  }

  header.search-open .droit {
    width: 100%;
  }

  header.search-open .search-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  header {
    padding: 10px 16px;
  }

  .container nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    padding: 10px 16px 12px;
    z-index: 1200;
  }

  .container nav ul {
    justify-content: space-around;
    gap: 10px;
  }

  body {
    padding-bottom: 90px;
  }

  .user-toggle {
    background-color: purple;
    color: #fff;
    padding: 6px 12px;
    border-radius: 10px;
  }

  .user-toggle .con-text {
    display: none;
  }
}

/* ===== Footer ===== */
.site-footer {
  margin-top: 40px;
  background: #f8f4fb;
  border-top: 1px solid rgba(128, 0, 128, 0.15);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px 30px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 24px;
}

.footer-brand h3 {
  color: purple;
  font-size: 1.5rem;
  margin-bottom: 10px;
  font-family: "Pacifico", cursive;
}

.footer-brand p {
  color: #555;
  line-height: 1.5;
  margin-bottom: 14px;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(128, 0, 128, 0.2);
  color: purple;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.footer-social a:hover {
  transform: translateY(-2px);
  background: rgba(128, 0, 128, 0.08);
}

.footer-links h4,
.footer-newsletter h4 {
  color: #222;
  margin-bottom: 12px;
}

.footer-links a {
  display: block;
  color: #555;
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: purple;
}

.footer-newsletter p {
  color: #555;
  margin-bottom: 12px;
}

.newsletter-form {
  display: flex;
  gap: 8px;
}

.newsletter-form input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
}

.newsletter-form button {
  background: purple;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.footer-bottom {
  border-top: 1px solid rgba(128, 0, 128, 0.15);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  color: #666;
  font-size: 0.9rem;
}

.footer-bottom-links {
  display: flex;
  gap: 16px;
}

.footer-bottom a {
  color: #666;
  text-decoration: none;
}

.footer-bottom a:hover {
  color: purple;
}

@media (max-width: 900px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .footer-container {
    grid-template-columns: 1fr;
  }

  .newsletter-form {
    flex-direction: column;
  }
}
