:root {
    /* Light Theme (Pastel/Watercolor vibe) */
    --bg-color: #fdf6f7; /* Very soft pink */
    --text-main: #4a3b3e;
    --header-bg: #f9e4e8;
    --accent-color: #f48fb1;
    --card-bg: #ffffff;
    --shadow: 0 8px 24px rgba(244, 143, 177, 0.15);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-color: #1a1415;
    --text-main: #fce8ed;
    --header-bg: #2d1f24;
    --accent-color: #d8547c;
    --card-bg: #241a1c;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Quicksand', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: var(--header-bg);
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease;
}

/* Updated Logo Class */
.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    position: relative; /* Added to act as the anchor for the absolute positioned flourish */
    display: inline-block; /* Ensures the bounds wrap tightly around the text */
}

/* New Signature Flourish Class */
.signature-flourish {
    font-family: 'Dancing Script', cursive;
    font-size: 0.65em;
    color: var(--text-main); 
    position: absolute;
    bottom: -10px;
    right: -45px;
    transform: rotate(-12deg);
    white-space: nowrap;
    text-shadow: 2px 2px 4px var(--header-bg); /* Helps it stand out if it overlaps the main text */
}

#theme-toggle {
    background: none;
    border: 2px solid var(--accent-color);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s ease;
}

#theme-toggle:hover {
    background: var(--accent-color);
    color: #fff;
}

main {
    flex: 1;
    padding: 3rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* --- Homepage Collections Grid --- */
.collections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.collection-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 250px;
    border-radius: 16px;
    text-decoration: none;
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
}

/* Placeholder backgrounds until real banner uploads */
#banner-glass {
    background: linear-gradient(135deg, rgba(244,143,177,0.4), rgba(255,255,255,0.2));
}

#banner-gumdrops {
    background: linear-gradient(135deg, rgba(179,229,252,0.4), rgba(244,143,177,0.2));
}

#banner-sugar-blossoms {
    background: linear-gradient(135deg, rgba(216, 180, 226, 0.4), rgba(255, 255, 255, 0.2));
}

#banner-anklets {
    /* Soft pastel orange/coral to cream gradient to contrast with the other categories */
    background: linear-gradient(135deg, rgba(255, 224, 178, 0.5), rgba(255, 255, 255, 0.2));
}

.collection-banner:hover {
    transform: translateY(-5px);
    /* Dual-layered shadow: one for depth, one for a uniform radiant glow */
    box-shadow: 0 12px 30px rgba(244, 143, 177, 0.4), 0 0 15px rgba(244, 143, 177, 0.2);
}

.banner-content {
    background: rgba(255, 255, 255, 0.85); /* Frosting effect */
    padding: 1rem 2rem;
    border-radius: 8px;
    text-align: center;
    color: #4a3b3e; /* Keeps high text visibility against white frosting */
}

[data-theme="dark"] .banner-content {
    background: rgba(0, 0, 0, 0.7);
    color: #fce8ed;
}

footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--header-bg);
    margin-top: auto;
}

/* --- Navigation --- */
.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--accent-color);
}

/* --- Category Grouping Styles --- */
.category-group {
    margin-bottom: 4rem;
}

.category-heading {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    border-bottom: 2px dashed var(--header-bg);
    padding-bottom: 0.5rem;
    font-weight: 700;
}

/* --- Product Grid --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(244, 143, 177, 0.1);
}

.product-card:hover {
    transform: translateY(-5px);
    /* Creates a soft, pastel pink glowing halo effect around the card */
    box-shadow: 0 12px 30px rgba(244, 143, 177, 0.4), 0 0 15px rgba(244, 143, 177, 0.2);
    /* Optional: Slightly brightens the card background on hover to enhance the glow */
    border-color: rgba(244, 143, 177, 0.4);
}

/* Keeps pictures framed landscape-style so wide necklaces do not over-zoom */
.product-image {
    height: 200px; 
    width: 100%;
    overflow: hidden; 
    background-color: var(--header-bg);
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.03);
}

/* Beautiful text card structure with clear formatting and margins */
.product-info {
    padding: 1.25rem;
    background-color: var(--card-bg);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.product-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 0.05em;
}

/* Position the icons in the top right of the card */
.card-icons {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 10px;
  z-index: 10; /* Ensures they sit above the card background */
}

/* Base styling for the buttons */
.icon-btn {
  background: rgba(0, 0, 0, 0.3); /* Subtle dark background */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  padding: 8px;
  color: #fff;
  opacity: 0.5; /* Semi-transparent default */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

/* Hover effect */
.icon-btn:hover {
  opacity: 1;
  transform: scale(1.15);
  background: rgba(0, 0, 0, 0.6);
}

/* Update this block in style.css */
.icon-btn.cart-btn {
  /* cursor: default;  <-- REMOVE COMMENT TO TURN OFF */
}

.icon-btn.cart-btn:hover {
  transform: scale(1); /* Optional: disable the scale effect if you want it completely static */
}

/* --- Modal & Backdrop Blur Styling --- */

.modal-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px); /* This creates the blurred background */
  -webkit-backdrop-filter: blur(10px); /* For Safari support */
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

/* Class added by JS to show the modal */
.modal-overlay.active {
  display: flex;
}

.modal-content {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
  object-fit: contain;
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #ccc;
}