/* styles.css */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f5f5f5;
    overflow-x: hidden;
    width: 100%;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
    
    /* Liquid Glassmorphism Effect */
    background: rgba(0, 0, 0, 0.212) !important;
    backdrop-filter: blur(1px) saturate(1%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease;
}

.back-button {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    color: rgb(255, 255, 255) !important;
    width: 42px;
    height: 42px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.back-button img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1); /* Make the black back icon white to match glass */
}

/* Symmetrical Glass Orders Button */
.MyCommandes {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    border-radius: 50% !important;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.MyCommandes:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.MyCommandes img {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1) !important; /* Make delivery scooter white */
}

.nbrComande {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: #ff5a5a !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 90, 90, 0.4);
    z-index: 5;
}

main {
    padding: 5px;
    overflow-x: hidden;

}

.category-hero {
    padding: 110px 20px 10px;
    text-align: center;
}

.category-hero h1 {
    margin: 0 0 10px;
    font-size: 2rem;
    color: #2f241f;
}

.category-hero p {
    margin: 0;
    color: #6b5b54;
}

.bacgrd {
    position: fixed;
    z-index: -2;
    height: 100vh;
    width: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
}

.bacgrd img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.filtre {
    position: fixed;
    background-color: rgba(236, 160, 160, 0.292);
    z-index: -1;
    height: 100vh;
    width: 100%;
    top: 0;
    left: 0;
}

.category {
    margin-bottom: 40px;
}

.category h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

/* Scrollable container */
.items {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 10px;
    scroll-behavior: smooth;
}

.items::-webkit-scrollbar {
    height: 8px;
}

.items::-webkit-scrollbar-thumb {
    background-color: #d58a8a;
    border-radius: 4px;
}

.items::-webkit-scrollbar-track {
    background-color: #f0f0f0;
}

/* Grid layout for single category display */
.items.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 25px;
    overflow-x: visible; /* Disable horizontal scroll */
    padding-bottom: 0;
    justify-content: center;
    width: 100%;
}

.items.grid-layout .item {
    width: 100% !important;
    max-width: 360px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .items.grid-layout {
        grid-template-columns: 1fr; /* 1 column on mobile */
        justify-items: center;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .items.grid-layout {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet */
    }
}

@media (min-width: 901px) {
    .items.grid-layout {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on standard desktop */
    }
}

@media (min-width: 1200px) {
    .items.grid-layout {
        grid-template-columns: repeat(4, 1fr); /* 4 columns on large screens */
    }
}

/* Premium Product Item Cards */
.item {
    background-color: #ffffff;
    height: 410px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    width: 290px; /* Width constraint to keep items neat in a list */
    flex: 0 0 auto;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(255, 90, 90, 0.12);
}

.item img {
    height: 180px;
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.item:hover img {
    transform: scale(1.04);
}

/* Card Content Details */
.item-details {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: left;
    width: 100%;
}

.item h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2c2520;
    margin: 0 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-description {
    font-size: 0.85rem;
    color: #7a6e67;
    line-height: 1.45;
    margin: 0 0 16px;
    height: 55px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Card Footer with Price and Order Button */
.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    width: 100%;
}

.item-footer .price-tag {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ff5a5a;
    font-family: Arial, sans-serif;
    letter-spacing: 0.5px;
}

.order-button {
    background-color: #ff5a5a;
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 10px rgba(255, 90, 90, 0.2);
}

.order-button:hover {
    background-color: #e44a4a;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(255, 90, 90, 0.3);
}

/* --- Premium Category Navigation Tabs --- */
.category-tabs-container {
  width: 100%;
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 15px;
  display: flex;
  justify-content: center;
}

.category-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  max-width: 100%;
}

.category-tabs::-webkit-scrollbar {
  display: none; /* Hide scrollbar for extreme clean aesthetics */
}

.category-tab {
  padding: 9px 22px;
  border-radius: 50px;
  background: transparent;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: #6b5b54;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.category-tab:hover {
  color: #ff5a5a;
  background: rgba(255, 90, 90, 0.08);
}

.category-tab.active {
  background: #ff5a5a;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 90, 90, 0.25);
}

/* Animation */
.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .back-button {
        order: -1;
        text-align: left;
    }
}

.btn {
    padding: 1rem 1.5rem;
    outline: none;
    border: none;
    font-size: 1rem;
    color: #ffffff;
    background-color: var(--tertiary-color, #ff5a5a);
    transition: 0.3s;
    cursor: pointer;
}

.final {
    background-image: url(assets/catalogue.svg);
    height: 600px;
}

/* --- Symmetrical Header Actions Group --- */
.header-actions {
    display: flex;
    gap: 12px;
    /* height: 60px; */
}

/* --- Centered Expanding Search Bar (Floats below the navbar) --- */
.search-bar-container {
    position: fixed;
    top: 90px; /* Floats directly below the navbar (15px top + 60px height + 15px gap) */
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: calc(100% - 30px);
    max-width: 600px;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.search-bar-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.search-bar-inner {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px 20px;
    height: 52px;
    border-radius: 30px;
    width: 100%;
    box-sizing: border-box;
    
    /* Liquid Glassmorphism Effect */
    background: rgba(255, 255, 255, 0.42) !important;
    backdrop-filter: blur(10px)!important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    box-shadow: 0 10px 35px 0 rgba(0, 0, 0, 0.15) !important;
}

.search-bar-icon {
    color: rgba(11, 11, 11, 0.7);
    font-size: 1.15rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.search-input {
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    color: #000000;
    font-size: 0.95rem;
    font-weight: 500;
}

.search-input::placeholder {
    color: rgba(91, 91, 91, 0.65);
}

.search-clear-btn {
    background: transparent;
    border: none;
    color: #ff5a5a;
    font-size: 1.3rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-left: 10px;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: #ff0000;
}

.search-toggle-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    color: rgb(255, 255, 255) !important;
    width: 42px;
    height: 42px;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.search-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.search-toggle-btn i {
    font-size: 20px;
    color: #ffffff;
}

/* No search results feedback */
.no-results-msg {
    text-align: center;
    padding: 40px;
    color: #7a6e67;
    font-size: 1.1rem;
    font-weight: 500;
    width: 100%;
}

/* Floating Cart inherited from main styles */
#floatingCart {
  position: fixed;
  bottom: 25px;
  right: 25px;
  cursor: pointer;
  z-index: 1000;
  background-color: #f7ab0a;
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#floatingCart svg {
  width: 28px;
  height: 28px;
  color: #111;
}

#cartCount {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: #e43d30;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid white;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}
