@layer base {
  body {
    font-family: 'Inter', sans-serif;
    background-color: #F5F5DC;
    color: #5D4037;
  }
}

@layer components {
  .title-font {
    font-family: 'Lora', serif;
  }
  .card {
    background-color: #FFF8E7;
    border: 1px solid #D7CCC8 !important;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    position: relative; /* Needed for positioning the plus icon */
  }
  .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  }
  /* Show plus icon on card hover */
  .card:hover .add-to-cart-btn {
    opacity: 1;
    transform: scale(1);
  }
  .control-button {
    background-color: #8D6E63 !important;
    color: #FFFFFF;
    transition: background-color 0.2s;
  }
  .control-button:hover {
    background-color: #A1887F;
  }
  .control-button.active {
    background-color: #5D4037 !important;
    color: #fff !important;
  }
  
  /* New flex rules for controls */
  .search-item {
    flex: 2 1 40%; /* Takes up more space */
    min-width: 250px;
  }
  .filter-item {
    flex: 1 1 15%; /* Takes up less space */
    min-width: 160px;
  }
  .reset-item {
    flex: 0 0 auto; /* Doesn't grow or shrink */
  }

  .pagination-button {
    background-color: #A1887F;
    color: white;
  }
  .pagination-button:disabled {
    background-color: #D7CCC8;
    cursor: not-allowed;
  }
  #name-list {
    display: grid;
    grid-auto-rows: 1fr;
  }
  select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }
  /* Styles for the add to cart button */
  .add-to-cart-btn {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    background-color: #5D4037;
    color: white;
    border-radius: 9999px;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    border: none;
  }
  .add-to-cart-btn:hover {
    background-color: #A1887F;
  }
  .add-to-cart-btn.added {
    background-color: #4CAF50; /* Green when added */
    opacity: 1; /* Make it permanently visible */
    transform: scale(1); /* Keep it at full size */
  }
  
  /* Styles for the saved names panel item */
  .saved-name-item {
    display: block; /* Changed from flex to block for card layout */
    background-color: #FFFFFF;
    border: 1px solid #D7CCC8;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    transition: box-shadow 0.2s;
  }
  .saved-name-item:hover {
      box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }
  .remove-name-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #8D6E63;
    padding: 0;
  }
  .remove-name-btn:hover {
    color: #c82333;
  }
  /* Improved styles for panel filters */
  .panel-select {
    width: 100%;
    padding: 0.6rem;
    padding-right: 2.5rem; /* Make space for arrow */
    border-radius: 0.5rem;
    border: 1px solid #D7CCC8;
    background-color: #FDFCF9; /* Light off-white, different from panel bg */
    color: #5D4037;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Custom dropdown arrow */
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="%23A1887F"><path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1.25em;
  }
  .panel-select:focus {
    border-color: #8D6E63;
    outline: none;
    box-shadow: 0 0 0 2px rgba(141, 110, 99, 0.2);
  } 
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-footer {
    color: #5f6368; 
    padding: 2rem 1rem;
    border-top: 1px solid #e0e0e0; 
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allows items to stack on small screens */
    gap: 1.5rem; /* Space between left and right sections when they stack */
}

.footer-left {
    flex: 1;
    min-width: 250px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0;
}

.footer-links li {
    padding-right: 0.75rem;
    margin-right: 0.75rem;
    position: relative;
}

.footer-links li:not(:last-child)::after {
    content: '·';
    position: absolute;
    right: -5px;
    color: #888;
}

.footer-links a {
    text-decoration: none;
    color: #3c4043;
    font-weight: 500;
}

.footer-links a:hover {
    text-decoration: underline;
}

.copyright {
    margin-top: 0.75rem;
    font-size: 0.9em;
}

.footer-right {
    text-align: right;
    min-width: 250px;
}

.footer-right p {
    margin: 0.25rem 0;
    font-size: 0.95em;
}

.footer-right a {
    color: #3c4043;
    font-weight: 500;
    text-decoration: underline;
}

.footer-right a:hover {
    text-decoration: none;
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column; 
        align-items: center;
        text-align: center;
    }

    .footer-right {
        text-align: center;
        margin-top: 1rem;
    }

    .footer-links {
        justify-content: center; 
    }
}
