body {
    text-align: center;
    font-family: Comic Sans MS, sans-serif;
    font-style: italic;
    margin: 0;
    padding: 20px;
    background-color: #fffaea;
    /* MAIN PAGE BACKGROUND */
}

h1 {
    text-align: center;
}

.header {
    display: flex;
    align-items: center;
    /* vertical alignment */
    gap: 12px;
    /* space between logo and text */
    justify-content: center;
    /* remove this line if you want it left-aligned */
}

.logo {
    width: 150px;
    /* 👈 controls logo size */
    height: auto;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* 👈 centers each row */
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
}

.gallery-item {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    background-color: rgb(186, 228, 250);
    /* GALLARY BACKGROUND */
    cursor: pointer;
    width: 260px;
    max-width: 100%;
    position: relative;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

.gallery-item p {
    margin-top: 8px;
    font-size: 14px;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.gallery-item:active {
    transform: scale(0.97);
}

.gallery-item {
    position: relative;
    overflow: hidden;
}

.gallery-item .overlay {
    position: absolute;
    inset: 0;
    /* fills the entire image */
    background: rgba(0, 0, 0, 0.55);
    color: white;

    display: flex;
    flex-direction: column;
    justify-content: center;
    /* vertical center */
    align-items: center;
    /* horizontal center */
    text-align: center;

    padding: 12px;

    opacity: 0;
    transform: translateY(0);
    transition: opacity 0.25s ease;
}

/* Desktop hover (only when hover is supported) */
@media (hover: hover) and (pointer: fine) {
    .gallery-item:hover .overlay {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile tap-to-open class */
.gallery-item.is-open .overlay {
    opacity: 1;
    transform: translateY(0);
}

.overlay span {
    font-size: 12px;
    opacity: 0.85;
}

.overlay small {
    font-size: 11px;
    line-height: 1.2;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #fff;
    padding: 20px;
    width: 300px;
    border-radius: 10px;
    text-align: center;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 22px;
    background: none;
    border: none;
    cursor: pointer;
}

.quantity {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.quantity button {
    width: 30px;
    height: 30px;
    font-size: 18px;
}

body {
    background-image:
        url(images/floral1.png),
        url(images/floral2.png),
        url(images/floral3.png),
        url(images/floral4.png);

    background-position:
        top left,
        top right,
        bottom left,
        bottom right;

    background-repeat: no-repeat;

    background-size: 300px;
    /* 👈 make them smaller */
}

.cart-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    padding: 10px 14px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    z-index: 2000;
}

#cart-items {
    text-align: left;
    margin: 10px 0;
}

.cart-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 6px;
}

#checkout-btn {
    margin-top: 10px;
    padding: 10px;
    width: 100%;
    cursor: pointer;
}

.out-of-stock {
    margin-top: 8px;
    padding: 4px 10px;
    background: #c0392b;
    color: white;
    font-size: 13px;
    font-weight: bold;
    border-radius: 12px;
}

.gallery-item.out {
    opacity: 0.6;
}

.gallery-item.out {
    cursor: not-allowed;
}

/* keeps stars + text from colliding */
.meta-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.star-wrap {
    display: inline-flex;
    flex: 0 0 auto;
}

.star-rating {
    display: inline-flex;
    gap: 2px;
    line-height: 1;
}

.star {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
    font-size: 16px;
    line-height: 16px;
}

.star::before {
    content: "☆";
    position: absolute;
    left: 0;
    top: 0;
}

.star::after {
    content: "★";
    position: absolute;
    left: 0;
    top: 0;
    width: calc(var(--fill, 0) * 100%);
    overflow: hidden;
}


.rating-text {
    white-space: nowrap;
}

.star-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
}

.star-link:focus {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.gallery-item {
    position: relative;
  }
  
  .gallery-item .overlay {
    position: absolute;
    inset: 0;
    padding-bottom: 36px; /* 👈 leaves room for rating/meta */
    pointer-events: none; /* overlay never steals clicks */
  }
  
  /* Keep rating always above overlay */
  .gallery-item .meta-line {
    position: relative;
    z-index: 2;
    backdrop-filter: blur(2px);
  }

  /* clickable rating area */
.star-link {
    display: inline-flex;
    align-items: center;
    transition: transform 0.15s ease, filter 0.15s ease;
    transform-origin: left center;
  }
  
  /* hover effect */
  .star-link:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
  }
  
  /* prevent layout jump */
  .meta-line {
    min-height: 24px;
  }

  .star-link {
    cursor: pointer;
  }

  /* rating line should look natural (no white pill/box) */
.meta-line{
    background: transparent !important;
    backdrop-filter: none !important;
  }

  .gallery-item{
    position: relative;
  }
  
  /* keep rating at the bottom in its own layer */
  .gallery-item .meta-line{
    position: relative;
    z-index: 3;
  }
  
  /* hover overlay stops before rating */
  .gallery-item .overlay{
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
  
    /* 👇 this is the magic: overlay ends before the rating row */
    bottom: 34px;   /* adjust: 28–44px depending on your design */
  
    z-index: 2;
  }
  
  .rating-link{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    padding: 2px 4px;           /* makes the clickable area bigger */
    border-radius: 8px;
  }
  
  .rating-link:hover{
    transform: scale(1.06);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
  }
  
  .rating-link:active{
    transform: scale(1.02);
  }
