/* Hardcoded theme colors */
:root {
    --theme-primary-color: #116466; /* Grayish Beige #D6D3CC; */
    --theme-secondary-color: #FFCB9A; /* Black/Dark Gray #1C1C1C; */
    --theme-accent-color: #D1E8E2; /* Purple was, bluish: #6D87E5, #6C2083;*/
    --theme-light-accent: #D9B08C; /* Bluish - was Light Purple/Pink: #EAD1FF #6D87E5;*/
	--theme-background-color: white;
	--theme-image-item-background-color: rgba(209, 232, 226, 0.25); /* theme accent color but oppacity down*/
}

/* **Loading Spinner Style** */
#loadingIndicator {
    display: none; /* Hidden by default */
    text-align: center;
    margin: 20px auto;
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--theme-accent-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* **Simulated Click Effect on Button** */
.button-clicked {
    background-color: var(--theme-accent-color) !important;
    transform: scale(0.98);
    transition: background-color 0.2s, transform 0.2s;
}

/* **Back to top button Style** */
#backToTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  background-color: #116466;
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 24px;
  cursor: pointer;
  display: none; /* hidden by default */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: opacity 0.3s ease-in-out;
}

#backToTop:hover {
  background-color: #0d3f3d;
}


/* ============= */
/* SEARCH STYLES */
/* ============= */

#search-container {
    text-align: center;
    margin-bottom: 20px;
}

#searchInput {
    padding: 10px;
    width: 80%;
    font-size: 16px;
    border: 2px solid var(--theme-primary-color);
    background-color: var(--theme-background-color);
    color: #2C3531;
    border-radius: 5px;
}

#searchInput::placeholder {
    color: #2C3531;
    opacity: 0.7;
}

#searchButton {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: var(--theme-primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease-in-out;
}

#searchButton:hover {
    background-color: var(--theme-accent-color);
    color: var(--theme-primary-color);
}

/* ============= */
/* GRID STYLES */
/* ============= */

#resultsGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Smaller item width */
    gap: 15px;
    padding: 20px;
    justify-content: center;
}

/* For phone portrait mode */
@media (max-width: 480px) {
  #resultsGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* force 2 columns on narrow phones with equal widths */
    gap: 15px;
  }
}

/* Ensure there is no horizontal overflow due to padding and margin etc (esp on phone) */
*, *::before, *::after {
  box-sizing: border-box;
}


/* Grid item (each card) */
.grid-item {
    background-color: var(--theme-background-color);
    padding: 0px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--theme-primary-color);
    transition: transform 0.2s ease-in-out;
    max-width: 250px; /* Smaller card width */
}

.grid-item:hover {
    transform: scale(1.02);
}

/* ============================== */
/*      Grid Item Inner Elements  */
/* ============================== */

/* Image .grid-item img { */
.grid-image {
    width: 100%;
    height: auto;
    max-height: 200px; /* Smaller images */
    object-fit: contain;
    border-radius: 6px;
	padding: 10px;
    margin: 0px;
	background-color: var(--theme-image-item-background-color);
}

/* Gift Title */
.grid-title {
    font-weight: bold;
    font-size: 15px; /* Smaller font */
    color: var(--theme-primary-color);
    margin-bottom: 5px;
}

/* Price */
.grid-price {
    font-weight: bold;
    font-size: 15px;
    color: white;
    margin-bottom: 8px;
}

/* Buy Button */
.grid-button {
    background-color: var(--theme-primary-color);
    color: white;
    font-size: 15px;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 5px;
    display: inline-block;
    margin-top: 8px;
    width: 90%;
}

.grid-button:hover {
    background-color: var(--theme-light-accent);
    color: var(--theme-secondary-color);
}

/* Description */
.grid-description {
    font-size: 13px;
    color: black;
    margin-top: 5px;
}

/* Read More */
.read-more {
    font-weight: bold;
    font-size: 13px;
    color: black;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 1px;
    display: inline-block;
}

.read-more:hover {
    color: var(--theme-primary-color);
}

/* pop-up*/
.description-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    font-size: 14px;
    color: var(--theme-primary-color);
    border-radius: 10px;
    padding: 20px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: left;
}

.close-modal {
    font-size: 14px;
    background: var(--theme-primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

.close-modal:hover {
    background: var(--theme-light-accent);
    color: var(--theme-secondary-color);
}
