/* ===== VARIABLES ===== */
:root {
  --primary-color: #652a15;
  --secondary-color: #4b5563;
  --accent-color: #d4a574;
  --light-color: #f8f9fa;
  --dark-color: #1a1a1a;
  --text-light: #ffffff;
  --text-dark: #333333;
  --gray-light: #e5e7eb;
  --gray-medium: #9ca3af;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* Dark theme variables */
[data-theme="dark"] {
  --primary-color: #8b4513;
  --secondary-color: #6b7280;
  --light-color: #1a1a1a;
  --dark-color: #f8f9fa;
  --text-light: #333333;
  --text-dark: #ffffff;
  --gray-light: #374151;
  --gray-medium: #6b7280;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
}

/* ===== BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--light-color);
  transition: var(--transition);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== HEADER ===== */
header {
  background-color: var(--text-light);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.header-branding {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
}

.company-name {
  font-size: 1.5rem;
  color: var(--primary-color);
  text-align: center;
}

.logo-overlay {
  position: absolute;
  right: 1rem;
  height: 50px;
  width: auto;
  opacity: 0.8;
}

/* ===== NAVIGATION ===== */
.navbar {
  position: relative;
}

.menu-toggle {
  position: absolute;
  top: -3.5rem;
  right: 1rem;
  background: var(--primary-color);
  color: var(--text-light);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  z-index: 1001;
  box-shadow: var(--shadow);
}

.nav-links {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100vh;
  background-color: var(--light-color);
  box-shadow: var(--shadow-lg);
  z-index: 1002;
  transition: var(--transition);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.nav-links.active {
  left: 0;
}

.close-sidebar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  color: var(--text-dark);
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.close-sidebar:hover {
  background-color: var(--gray-light);
}

.sidebar-title {
  padding: 1.5rem 1rem 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  border-bottom: 1px solid var(--gray-light);
  margin-bottom: 1rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 1rem;
  color: var(--text-dark);
  transition: var(--transition);
  border-bottom: 1px solid var(--gray-light);
  font-weight: 500;
}

.sidebar-link:hover {
  background-color: var(--gray-light);
  color: var(--primary-color);
}

.sidebar-link i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
}

/* Sidebar dropdown */
.sidebar-dropdown {
  border-bottom: 1px solid var(--gray-light);
}

.sidebar-products-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  cursor: pointer;
  color: var(--text-dark);
  transition: var(--transition);
  font-weight: 500;
}

.sidebar-products-toggle:hover {
  background-color: var(--gray-light);
  color: var(--primary-color);
}

.sidebar-products-toggle i {
  transition: var(--transition);
}

.sidebar-products-toggle.active i {
  transform: rotate(180deg);
}

.sidebar-products-menu {
  max-height: 0;
  overflow: hidden;
  transition: var(--transition);
  background-color: rgba(0, 0, 0, 0.03);
}

.sidebar-products-menu.active {
  max-height: 300px;
}

.sidebar-products-menu a {
  display: block;
  padding: 0.75rem 1rem 0.75rem 2rem;
  color: var(--text-dark);
  transition: var(--transition);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 500;
}

.sidebar-products-menu a:hover {
  background-color: var(--gray-light);
  color: var(--primary-color);
}

/* Desktop dropdown */
.desktop-dropdown {
  display: none;
  position: relative;
}

/* Social section - HIDDEN ON DESKTOP */
.sidebar-social-list {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid var(--gray-light);
}

.sidebar-social-list a {
  display: flex;
  align-items: center;
  padding: 0.75rem 0;
  color: var(--text-dark);
  transition: var(--transition);
  font-weight: 500;
}

.sidebar-social-list a:hover {
  color: var(--primary-color);
}

.sidebar-social-list i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
}

/* Backdrop */
.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ===== THEME TOGGLE ===== */
#theme-toggle {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary-color);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 998;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  cursor: grab;
}

#theme-toggle:active {
  cursor: grabbing;
}

#theme-toggle .moon {
  display: none;
}

[data-theme="dark"] #theme-toggle .sun {
  display: none;
}

[data-theme="dark"] #theme-toggle .moon {
  display: block;
}

/* ===== MAIN CONTENT ===== */
main {
  padding: 1rem 0 3rem;
  min-height: calc(100vh - 200px);
}

/* ===== CAROUSEL STYLES ===== */

/* wrapper controls height + shadow */
.carousel-wrapper{
  width:100%;
  max-width:1400px;
  margin:22px auto;
  overflow:hidden;
  border-radius:14px;
  position:relative;
  box-shadow:0 0 22px rgba(0,0,0,.18);
  background:#fff;
  position: relative;
 overflow-x: hidden !important;   /* <— this clips the ::before/::after masks */
}

/* track + slides */
.carousel{
 width:100%;
}

.carousel-track{
  display:flex;
  width:100%;
  transition:transform .55s ease;
}

.slide{
  flex:0 0 100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}

.carousel .slide img{
  width:100%;
  height:100%;
  object-fit: contain !important;
  display:block;
  background:#fff;   /* so when image aspect ratio differs, the white background covers */
}

/* arrows */
.carousel-btn{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:44px;height:44px;
  border-radius:50%;
  background:rgba(0,0,0,.60);
  color:#fff;
  font-size:22px;
  border:0;
  cursor:pointer;
  z-index:12;
  display:flex;
  justify-content:center;
  align-items:center;
}
.prev{left:16px;}
.next{right:16px;}

/* Jumia gradient masks left / right */
.carousel-wrapper::before,
.carousel-wrapper::after{
  content:"";
  position:absolute;
  top:0;bottom:0;
  width:50px;
  pointer-events:none;
  z-index:5;
}
.carousel-wrapper::before{
  left:0;
  background:linear-gradient(to right,rgba(0,0,0,.55),transparent);
}
.carousel-wrapper::after{
  right:0;
  background:linear-gradient(to left,rgba(0,0,0,.55),transparent);
}

/* dots */
.carousel-dots{
  position:absolute;
  bottom:14px;
  left:0;right:0;
  display:flex;
  justify-content:center;
  gap:8px;
  z-index:12;
}
.carousel-dots button{
  width:8px;height:8px;border-radius:50%;
  background:rgba(0,0,0,.18);
  border:0;cursor:pointer;
  transition:all .25s;
}
.carousel-dots button.active{
  width:18px;
  border-radius:10px;
  background:#e07b17;
  box-shadow:0 6px 14px rgba(224,123,23,.25);
}

.carousel .slide{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
}

/* === responsive heights === */
@media(min-width:1366px){
  .carousel-wrapper{height:430px;}
}
@media(min-width:1024px) and (max-width:1365px){
  .carousel-wrapper{height:360px;}
}
@media(min-width:768px) and (max-width:1023px){
  .carousel-wrapper{height:300px;}
}
@media(max-width:767px){
  .carousel-wrapper{height:250px;}
  .carousel-btn{display:none !important;}
}
@media (max-width:768px){
  .carousel-wrapper{
    height: auto !important;
  }
  @media(max-width:576px){
  .carousel-wrapper{
    height:220px;   /* safe for phones */
  }
}
  .carousel .slide{
    height: auto !important;
  }
}

/* ===== PRODUCT GRID ===== */
.product-grid-section {
  margin-bottom: 3rem;
}

.section-title {
  text-align: center;
  margin: 2rem 0 1.5rem;
  color: var(--primary-color);
  position: relative;
  font-size: 2rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--primary-color);
}

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

.product {
  background: var(--light-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.product img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  cursor: pointer;
  transition: var(--transition);
}

.product p {
  padding: 0.5rem 1rem;
  margin: 0;
}

.product p:nth-of-type(1) {
  font-weight: 500;
  color: var(--text-dark);
}

.product p:nth-of-type(2) {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.25rem;
}

.selectors {
  padding: 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.selectors label {
  font-size: 0.875rem;
  color: var(--secondary-color);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.selectors select {
  padding: 0.5rem;
  border: 1px solid var(--gray-light);
  border-radius: 4px;
  background: var(--light-color);
  color: var(--text-dark);
  font-size: 0.875rem;
}

.action-row {
  padding: 1rem;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.qty-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--gray-light);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: var(--transition);
}

.qty-btn:hover {
  background: var(--primary-color);
  color: var(--text-light);
}

.qty-input {
  width: 60px;
  text-align: center;
  padding: 0.5rem;
  border: 1px solid var(--gray-light);
  border-radius: 4px;
  background: var(--light-color);
  color: var(--text-dark);
}

.add-btn {
  padding: 0.75rem;
  border-radius: 4px;
  font-weight: 500;
  text-align: center;
  transition: var(--transition);
  background: var(--primary-color);
  color: var(--text-light);
}

.add-btn:hover {
  background: var(--secondary-color);
}

/* ===== RECENTLY VIEWED ===== */
.recently-viewed {
  padding: 0 1rem;
  margin-bottom: 2rem;
}

.recently-items {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 1rem 0;
  scrollbar-width: thin;
}

.recently-item {
  min-width: 120px;
  flex-shrink: 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.recently-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  object-position: center;
}

.recently-item:hover {
  transform: scale(1.05);
}

.recently-item.bounce {
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 20%, 60%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  80% {
    transform: translateY(-5px);
  }
}

/* ===== CATEGORY GRID ===== */
#product-categories {
  padding: 0 1rem;
}

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

.category-card {
  background: var(--light-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: center;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.category-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  object-position: center;
}

.category-card p {
  padding: 0.75rem;
  margin: 0;
  font-weight: 500;
  color: var(--text-dark);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--dark-color);
  color: var(--text-light);
  padding: 2rem 0 1rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-column h3 {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.footer-column p {
  color: var(--gray-medium);
}

.footer-column ul li {
  margin-bottom: 0.5rem;
}

.footer-column ul li a {
  color: var(--gray-medium);
  transition: var(--transition);
}

.footer-column ul li a:hover {
  color: var(--text-light);
}

.social-icons {
  display: flex;
  gap: 1rem;
}

.social-icons a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--secondary-color);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.social-icons a:hover {
  background: var(--primary-color);
  transform: translateY(-2px);
}

.footer-bottom {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--secondary-color);
  color: var(--gray-medium);
}

/* ===== EXIT OFFER POPUP ===== */
.exit-offer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.exit-offer.active {
  opacity: 1;
  visibility: visible;
}

.exit-box {
  background: var(--light-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-lg);
  color: var(--text-dark);
}

.exit-box h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.exit-box p {
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

.exit-btn {
  display: inline-block;
  background: var(--primary-color);
  color: var(--text-light);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: var(--transition);
}

.exit-btn:hover {
  background: var(--secondary-color);
}

#exit-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dark);
  transition: var(--transition);
}

#exit-close:hover {
  color: var(--primary-color);
}

/* ===== WELCOME MESSAGE ===== */
.welcome-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--light-color);
  color: var(--text-dark);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  z-index: 1100;
  text-align: center;
  max-width: 400px;
  width: 90%;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.welcome-message.active {
  opacity: 1;
  visibility: visible;
  animation: flash 2s ease-in-out;
}

@keyframes flash {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.welcome-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  color: var(--text-dark);
  font-size: 1.25rem;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.welcome-close:hover {
  background: var(--gray-light);
}

/* ===== PRODUCT POPUP ===== */
.product-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.product-popup.active {
  opacity: 1;
  visibility: visible;
}

.popup-content {
  background: var(--light-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  color: var(--text-dark);
}

.popup-content img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
}

.popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  color: var(--text-dark);
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.popup-close:hover {
  background: var(--gray-light);
}

/* ===== RESPONSIVE STYLES ===== */

/* Small mobile (320px - 575px) */
@media (max-width: 575px) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .company-name {
    font-size: 1.25rem;
  }
}

/* Medium mobile (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Large mobile (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* iPad (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* iPad landscape (1024px - 1366px) */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
  .menu-toggle {
    display: none;
  }
  
  .nav-links {
    position: static;
    width: auto;
    height: auto;
    background: none;
    box-shadow: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    overflow: visible;
    padding: 1rem;
  }
  
  .close-sidebar, .sidebar-title, .sidebar-social-list {
    display: none;
  }
  
  .sidebar-link {
    border: none;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: var(--border-radius);
    position: relative;
  }
  
  .sidebar-dropdown {
    display: none;
  }
  
  .desktop-dropdown {
    display: block;
    position: relative;
  }
  
  .dropbtn {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
  }
  
  .dropbtn:hover {
    background: var(--gray-light);
    color: var(--primary-color);
  }
  
  .desktop-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--light-color);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border-radius: var(--border-radius);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
  }
  
  .dropdown-content a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    transition: var(--transition);
    border-bottom: 1px solid var(--gray-light);
  }
  
  .dropdown-content a:hover {
    background: var(--gray-light);
    color: var(--primary-color);
  }
  
  .sidebar-social-list {
    display: none;
  }
  
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .category-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Very large screens (1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
  }
  
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Added responsive carousel + full images */
.carousel-item img {
    width: 100%;
    height: 55vw;
    object-fit: contain;
}

.product-card img, .product img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.category-card img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Responsive size adjustments for theme toggle */
@media (max-width: 375px){
  #theme-toggle { width:44px; height:44px; font-size:1rem; bottom:80px; right:12px; }
}
@media (min-width: 376px) and (max-width: 767px){
  #theme-toggle { width:50px; height:50px; font-size:1.1rem; bottom:90px; right:14px; }
}
@media (min-width:768px) {
  #theme-toggle { width:60px; height:60px; font-size:1.5rem; }
}

/* modernize product grid: reduce image height and make cards compact */
.product img { height:160px; object-fit:cover; }
.product { border-radius:12px; padding-bottom:6px; }
.product p:nth-of-type(2) { font-size:1.05rem; }

/* dark mode tweak: lighten background a bit and improve clickable feedback */
[data-theme="dark"] {
  --light-color: #111315;
  --dark-color: #f4f4f4;
  --text-light: #f4f4f4;
  --text-dark: #e6e6e6;
  --gray-light: #2b2f33;
  --gray-medium: #4b5563;
  --shadow: 0 6px 12px rgba(0,0,0,0.45);
  --shadow-lg: 0 14px 24px rgba(0,0,0,0.55);
  --accent-color: #caa472;
}

/* Better tap/click states */
button, .sidebar-link, .dropbtn, .add-btn {
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 180ms ease;
}
button:active, .sidebar-link:active, .dropbtn:active {
  transform: translateY(1px) scale(0.998);
  box-shadow: none;
  opacity: 0.95;
}

/* prevent body scroll when sidebar open */
body.no-scroll { overflow: hidden; touch-action: none; }

/* --- improved dark-mode contrast --- */
[data-theme="dark"] {
  --primary-color: #9a5a2b;
  --secondary-color: #9aa0a6;
  --light-color: #111214;
  --dark-color: #f6f7f8;
  --text-light: #eaeaea;
  --text-dark: #f4f4f4;
  --gray-light: #2f3740;
  --gray-medium: #667085;
  --shadow: 0 4px 10px rgba(0,0,0,0.45);
  --shadow-lg: 0 14px 30px rgba(0,0,0,0.45);
}

/* --- pressed/tap feedback --- */
button, a.button-like {
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.pressed {
  transform: translateY(1px) scale(0.998);
  box-shadow: none !important;
}

/* --- carousel dots --- */
.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display:flex;
  gap: 6px;
  z-index: 30;
}
.carousel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  transition: all 0.18s;
  opacity: 0.9;
}
.carousel-dot.active {
  transform: scale(1.35);
  background: white;
}

/* --- theme toggle drag state --- */
#theme-toggle.dragging { box-shadow: 0 10px 30px rgba(0,0,0,0.25); transform: scale(1.03); cursor:grabbing; }

/* --- product card polish: reduce perceived height and modernize --- */
.product {
  border-radius: 12px;
  overflow: hidden;
  display:flex;
  flex-direction:column;
  transition: transform 220ms;
}
.product img { object-fit: contain; height: 160px; background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0)); }

/* --- reduce forced reflow risk: avoid expensive selectors --- */
.recently-items, .product-grid { will-change: transform; }

/* --- prevent body scroll when sidebar is open --- */
.no-scroll-sidebar { overflow: hidden !important; height: 100%; }

/* small helper for placeholder images: center and subtle background */
img[src*="placeholder-200.png"] { background: linear-gradient(180deg,#f1f3f5,#fff); display:block; }

#cart-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
}

#cart-hint-popup {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: #333;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    display: none;
    max-width: 250px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#cart-hint-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #333;
}

/* --- UI improvements appended --- */

/* === UI Improvements: Header, Theme Toggle, Logo, Cards, Checkout Button === */

/* Header visible in dark mode */
body.dark-mode header,
body.dark-mode .header, body.dark-mode .site-header {
    background-color: rgba(17,17,17,0.98) !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(6px);
}

/* Light mode header */
body:not(.dark-mode) header,
body:not(.dark-mode) .header, body:not(.dark-mode) .site-header {
    background-color: rgba(255,255,255,0.96) !important;
    color: #111827 !important;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

/* Theme toggle styles (supports id #theme-toggle and .theme-toggle) */
#theme-toggle, .theme-toggle {
    width: 52px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    padding: 4px;
    cursor: pointer;
    transition: background 240ms ease, box-shadow 240ms ease;
    background: var(--toggle-bg, #e6e6e6);
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
#theme-toggle .knob, .theme-toggle .knob {
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transform: translateX(0);
}
body.dark-mode #theme-toggle, body.dark-mode .theme-toggle {
    --toggle-bg: #3b3b3b;
}
body.dark-mode #theme-toggle .knob, body.dark-mode .theme-toggle .knob {
    transform: translateX(22px);
    background: #fafafa;
}

/* Click/tap feedback */
#theme-toggle:active .knob, .theme-toggle:active .knob {
    transform: scale(0.92);
}

/* Desktop logo bump and consistent left */
@media (min-width: 1024px) {
    .site-logo img, .header-logo img, .nav-logo img {
        height: 60px !important;
        width: auto !important;
        display: block;
    }
    header .site-logo, header .header-logo, header .nav-logo {
        margin-left: 20px !important;
        display: flex;
        align-items: center;
    }
}

/* Product card hover (subtle lift and shadow) */
.pm-card, .product-card, .card {
    transition: transform 220ms cubic-bezier(.2,.9,.3,1), box-shadow 220ms cubic-bezier(.2,.9,.3,1);
    will-change: transform, box-shadow;
}
.pm-card:hover, .product-card:hover, .card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 36px rgba(6,15,30,0.12);
}

/* =========================
   CENTERED CHECKOUT BUTTON
   =========================*/
   
.go-checkout {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 2rem 0 !important;
    padding: 0 1rem !important;
}

.go-checkout .checkout-btn {
    margin: 0 auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Ensure consistent left alignment of header elements */
.header-inner, .header-container, .site-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* small tweak to ensure header z-index over content */
header, .site-header {
    position: relative;
    z-index: 9999;
}

/* Accessible focus outlines for toggle and checkout button */
#theme-toggle:focus, .theme-toggle:focus, .checkout-btn:focus {
    outline: 3px solid rgba(255,124,0,0.18);
    outline-offset: 3px;
}

/* Slight text improvement for categories title */
.category-grid p, .category-card p {
    font-weight: 600;
    letter-spacing: -0.2px;
}

/* UI Enhancements */

.proceed-global-btn {
    background: linear-gradient(135deg,#ff7a00,#ff4d00);
    padding: 14px 26px;
    color:#fff;
    border-radius:12px;
    font-weight:600;
    text-decoration:none;
    box-shadow:0 8px 20px rgba(255,77,0,.2);
    transition:all .25s ease;
}
.proceed-global-btn:hover {
    transform:translateY(-3px);
    box-shadow:0 14px 32px rgba(255,77,0,.26);
}
.proceed-global-btn:active {
    transform:scale(.96);
}
