
:root {
  --color-primary:   #da6f0d;
  --color-primary-d: #b85d0a;
  --color-primary-l: #c2630c;
  --color-dark:      #001830;
  --color-secondary: #f1ece6;
  --color-accent:    #e9ecef;
  --color-danger:    #ef4444;
  --shadow-soft:     0 10px 30px rgba(0,0,0,.08);
  --radius-card:     0.75rem;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1rem;
  border-radius: var(--radius-card);
  font-weight: 600;
  text-decoration: none;
  transition: filter .2s ease, background-color .2s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { filter: brightness(.93); }

.btn-dark {
  background: var(--color-dark);
  color: #fff;
}
.btn-dark:hover { filter: brightness(1.15); }

.btn-ghost {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #111827;
}
.btn-ghost:hover { background: #f9fafb; }

#loading-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity .5s ease, visibility .5s ease;
}
#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  width: 100px;
  height: 100px;
  background-image: url('https://i.postimg.cc/vBjDkrGd/logo-wafricastore.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  animation: logoSpin 1.5s linear infinite;
}

@keyframes logoSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.mobile-menu {
  position: fixed;
  top: 0; left: 0;
  width: 300px;
  height: 100%;
  background-color: rgba(0, 0, 0, .9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: 49;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 4rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-100%);
  transition: opacity .3s ease, visibility .3s ease, transform .3s ease;
}
.mobile-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.mobile-menu ul {
  list-style-type: none;
  padding: 0;
  width: 100%;
}
.mobile-menu li {
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.mobile-menu a {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  padding: 1rem 1.5rem;
  text-align: left;
  transition: background-color .2s ease;
  width: 100%;
  box-sizing: border-box;
}
.mobile-menu a:hover { background-color: rgba(255,255,255,.1); }
.mobile-menu a.menu-active { color: var(--color-primary) !important; }
.mobile-menu a.menu-active i { color: var(--color-primary) !important; }

.user-profile-section {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  width: 100%;
  box-sizing: border-box;
}
.user-profile-section .profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.user-profile-section .avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}
.user-profile-section .user-info { flex: 1; }
.user-profile-section .user-name {
  font-weight: 600;
  color: white;
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}
.user-profile-section .user-fullname {
  color: var(--color-primary);
  font-size: .9rem;
  font-weight: 500;
  margin: .2rem 0 0;
  line-height: 1.3;
  display: none;
}
.user-profile-section .user-fullname.is-visible { display: block; }
.user-profile-section .user-id {
  background-color: var(--color-primary);
  color: white;
  padding: .15rem .4rem;
  border-radius: .375rem;
  font-weight: 500;
  font-size: .85rem;
}
.user-profile-section .user-detail {
  color: #cbd5e1;
  font-size: .85rem;
  margin: .25rem 0;
  line-height: 1.3;
}
.user-profile-section .balance {
  font-weight: 600;
  color: var(--color-primary);
}

.user-profile-section .view-profile-btn,
.user-profile-section .logout-btn,
.user-profile-section .login-btn {
  display: block;
  width: 100%;
  padding: .8rem;
  color: white;
  border: none;
  border-radius: .5rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .2s ease;
  text-align: center;
}
.user-profile-section .view-profile-btn,
.user-profile-section .login-btn {
  background-color: var(--color-primary);
  margin-top: 1rem;
}
.user-profile-section .view-profile-btn:hover,
.user-profile-section .login-btn:hover {
  background-color: var(--color-primary-l);
}
.user-profile-section .logout-btn {
  background-color: #3f3f46;
  margin-top: .5rem;
}
.user-profile-section .logout-btn:hover { background-color: #52525b; }

.user-profile-section .not-connected-section p {
  color: white;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.hamburger-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-dark);
  padding: .5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.hamburger-btn:hover { color: var(--color-primary); }

#hamburger-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 16px; height: 16px;
  background-color: var(--color-danger);
  border-radius: 50%;
  border: 2px solid white;
  display: none;
  pointer-events: none;
  animation: badgePulse 2s ease-in-out infinite;
  color: white;
  font-size: 10px;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
#hamburger-badge.show { display: flex; }

@keyframes badgePulse {
  0%,100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.2); opacity: .8; }
}

.header-cart-icon {
  background: none;
  border: none;
  padding: .5rem;
  margin: 0;
  cursor: pointer;
  color: var(--color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s ease;
  position: relative;
  text-decoration: none;
}
.header-cart-icon:hover { color: var(--color-primary); }
.header-cart-icon i { font-size: 1.5rem; }

#cart-count-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 18px;
  height: 18px;
  background-color: var(--color-primary);
  border-radius: 9999px;
  border: 2px solid white;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  line-height: 1;
  padding: 0 3px;
}
#cart-count-badge.show { display: flex; }

.global-container {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 4rem);
}

.sidebar {
  width: 160px;
  display: none;
  background-color: #f9fafb;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.sidebar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.main-content {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

@media (min-width: 1024px) {
  .sidebar { display: block; }
  .main-content { max-width: calc(100% - 320px); }
}

.sidebar.color-5 { background-color: var(--color-primary); }

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

.news-card {
  transition: all .25s ease;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,.12);
}

.news-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-top-left-radius: var(--radius-card);
  border-top-right-radius: var(--radius-card);
}
.news-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.news-card:hover .news-image { transform: scale(1.04); }

.news-date-badge {
  background-color: var(--color-primary);
  color: white;
  padding: .25rem .6rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  position: absolute;
  top: .75rem; right: .75rem;
  z-index: 10;
}

.new-badge {
  position: absolute;
  top: .75rem; left: .75rem;
  background-color: var(--color-danger);
  color: white;
  padding: .25rem .6rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  z-index: 10;
}

.news-category-tag {
  display: inline-block;
  background-color: #f3f4f6;
  color: #4b5563;
  padding: .25rem .75rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 500;
  margin-bottom: .5rem;
}

.news-content {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}
.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.no-news-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}
.no-news-icon {
  font-size: 3rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}
.no-news-text {
  font-size: 1.25rem;
  font-weight: 500;
}

#backToTop {
  position: fixed;
  bottom: 2rem; right: 2rem;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 4rem; height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .3s ease, visibility .3s ease, transform .3s ease, background-color .2s ease;
  z-index: 1000;
}
#backToTop:hover {
  background-color: var(--color-primary-d);
  transform: translateY(-2px);
}
#backToTop.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.presentation-section {
  padding: 1rem;
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
  z-index: 1;
}
.presentation-section p {
  margin-bottom: .5rem;
  font-size: .8rem;
  color: #4b5563;
  line-height: 1.4;
}
.presentation-section p:last-child { margin-bottom: 0; }
.presentation-section p.title {
  font-size: .9rem;
  font-weight: 500;
  color: #1f2937;
  text-align: center;
  margin-bottom: .75rem;
}

.presentation-container {
  max-width: 72rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .presentation-container { padding-left: 1.5rem; padding-right: 1.5rem; }
}
@media (min-width: 1024px) {
  .presentation-container { padding-left: 2rem; padding-right: 2rem; }
}

footer {
  background-color: var(--color-dark);
  color: #9ca3af;
  padding-top: 1rem;
  padding-bottom: 3rem;
  z-index: 1;
}
footer p {
  font-size: .875rem;
  margin: 0;
}
footer .footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}

.hidden { display: none !important; }