/* RESET BASE */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 20px;
    background-color: white;
    color: #803b32;
    transition: background-color 0.5s ease-in, color 0.5s ease-in;
    font-family: Google Sans, sans-serif;
}

body.dark-mode {
    background-color: #d5cecd;  /* dark background */
}


/* TOP BAR */

.top-nav-bar {
    display: flex;
    align-items: center;
    padding: 16px 0;
    gap: 12px;
    margin-bottom: 40px;
} 

.logo {
    margin-right: auto;
    font-size: 1.5rem;
}

.toggle-text {
    font-size: 14px;
}

/* hide checkbox but it's still there working in the background*/
#mode-switch {
  display: none;
}

/* switch container */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  background-color: #f2e7e7;
  border-radius: 28px;
  cursor: pointer;
  transition: background-color 0.3s;
}

/* creates the circle inside the switch */
.switch::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

/* when the checkbox is checked → move circle switch next to it and change background */
#mode-switch:checked + .switch {
  background-color: #692929; 
}

#mode-switch:checked + .switch::before {
  transform: translateX(22px);
}



/* LAYOUT */

.row-container {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;      
}

/* Styles that apply only when the screen width is at least 500px */
@media (max-width: 768px) {
  .row-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}


/* SIDEBAR */

/* All lighting */
.header {
    width: 100%;    
    border-bottom: 1px solid #803b32;
    color: #803b32;
    padding: 5px 0;
}

#side-bar button {
    position: relative;
    background: none;  
    border: none; 
    margin: 10px 0;  
    color: #803b32;  
    font-size: 13px;
    cursor: pointer;   
    text-align: left;
    padding-left: 0; 
    transition: color 0.3s ease, padding 0.3s ease;
    display: flex;
    flex-direction: column;   
}

#side-bar button:hover {
    color: #b17c75;
}

/* hidden dash by default */
#side-bar button::before {
    content: "—";
    position: absolute;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ACTIVE STATE */
#side-bar button.active {
    padding-left: 14px; /* make space for dash */
}

#side-bar button.active::before {
    opacity: 1;
}

/* Default state on mobile (collapsed) */
@media (max-width: 768px) {
  #side-bar {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  #side-bar.open {
    max-height: 500px; /* large enough to fit buttons */
  }

  .filter-toggle {
    border-top: 1px solid #803b32;
    cursor: pointer;
  }

  .filter-toggle:hover {
    cursor: pointer;
    color: #b17c75;
  }
}

#gallery-view {
    margin: 10px 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px; 
}


/* PRODUCT CARD COMPONENT */

.card {
    display: flex;
    flex-direction: column;
} 

@media (max-width: 900px) {
    #gallery-view { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
    #gallery-view { grid-template-columns: 1fr; }
}

.card img {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 2 / 3;
    margin-bottom: 10px;
    transition: 1s ease;
}

.product-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.product-price {
    font-size: 12px;
    opacity: 0.85;
}


/* ANIMATIONS */

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}