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

.container {
    display: flex;
}

/* Sidebar Styling */
.sidebar {
    width: 20%;
    height: 100vh;
    position: sticky;
    top: 0;
    padding: 20px;
    background-color: var(--bg-color);
    overflow-y: auto;
    padding-top: 40px;
}

.sidebar h2 {
    font-size: 1.6em;
    color: var(--primary-color);
    margin-top: 40px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.1em;
    padding: 8px 0;
    display: block;
}

/* Main Content Area */
.main-content {
    width: 80%;
    padding: 20px;
    padding-top: 10px;
    margin: 0 auto;
}

.wine-section {
    margin: 40px;
    margin-bottom: 100px;
    padding-top: 30px;
}

.wine-section h2 {
    font-size: 1.6em;
    color: var(--primary-color);
    padding-bottom: 10px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Wine Card Styling and Hover Effect */
.wine-card {
    position: relative;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}

.wine-card .card-details {
    display: none;
}

.wine-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.quick-overview-text {
    position: absolute;
    top: 65%; /* Center vertically */
    left: 50%; /* Center horizontally */
    transform: translate(-50%, -50%); /* Adjust for accurate centering */
/*     background-color: rgba(0, 0, 0, 0.7);  */
/*     color: white; */
    background-color: var(--primary-color-light); 
    color: black;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 1.1em;
/*     font-weight: bold; */
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease-in-out; /* Smooth fade in/out */
    pointer-events: none; /* Allows clicks to pass through to the card */
    z-index: 10; /* Ensure it's above the image */
}

.wine-card:hover .quick-overview-text {
    opacity: 1; /* Visible on hover */
}

.wine-card img {
    width: 80%;
    max-width: 100px;
    height: auto;
    display: block;
    margin: 0 auto;
    padding-top: 20px;
}

.wine-card h3 {
    font-size: 20px;
    padding-top: 20px;
    padding-bottom: 5px;
}

.wine-card p {
    font-size: 16px;
    padding-bottom: 20px;
}

.mirabelle img {
    width: 80%;
    max-width: 150px;
    height: auto;
}


.sold-out-card {
    position: relative;
    pointer-events: none;
    cursor: not-allowed;
}

.sold-out-card img {
    filter: blur(2px) grayscale(70%);
    transition: filter 0.3s ease;
}

.sold-out-card h3 {
    filter: blur(1px);
    transition: filter 0.3s ease;
}
.sold-out-card p {
    filter: blur(1px);
    transition: filter 0.3s ease;
}

.sold-out-card .quick-overview-text {
    display: none;
}

/* --- Classier Sold Out Overlay and Text --- */

.sold-out-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.2); /* Slightly more opaque white overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    border-radius: 8px;
    /* We'll use a diagonal ribbon effect on the overlay itself */
    overflow: hidden; /* Important for the ribbon effect */
}

.sold-out-text {
    position: absolute; /* Position the text within the overlay */
    top: 40px; /* Adjust vertical position */
    right: -120px; /* Position off-screen to start the diagonal */
    background-color: var(--primary-color); /* #333; */ 
    color: white;
    padding: 24px 150px; /* Generous padding for the ribbon */
    font-size: 1.1em;
    font-weight: normal; /* Less aggressive than bold */
    text-transform: uppercase; /* Classic uppercase */
    letter-spacing: 2px; /* Adds a bit of air between letters */
    transform: rotate(45deg); /* Rotate for a diagonal banner */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
    border: none; /* No explicit border needed */
    /* Ensure it overlaps properly */
    white-space: nowrap; /* Prevent text from wrapping */
}


/* Overlay and Expanded Card */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5); /* Semi-transparent background */
    backdrop-filter: blur(10px); /* Blurry effect */
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.expanded-card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    width: 80%;
    max-width: 800px;
/*     height: 90%; */
/*     text-align: center; */
    position: relative;
    transform: scale(0.8); /* Start smaller for a pop-in effect */
    transition: transform 0.3s ease-in-out;
    
    display: flex; 
    gap: 20px; /* Space between columns */
    align-items: center;
    
    
    height: auto; /* Allow content to dictate initial height */
    max-height: 90vh; /* Set maximum height to 90% of viewport height */
    overflow-y: hidden; /* Hide main scrollbar on the card itself */
}

.expanded-card-left {
    width: 50%;
    text-align: center; /* Center image and title within its column */
    display: flex;
    flex-direction: column;
    align-items: center; 
}

.expanded-card-left img {
    width: 80%;
    max-width: 150px;
    height: auto;
/*     max-height: 500px; */
    border-radius: 5px;
    margin-bottom: 15px; /* Space between image and title */
    padding: 10px;
}

.expanded-card-left h3 {
    margin: 0;
    font-size: 1.8em;
}

.expanded-card-left p {
    margin-bottom: 10px;
}

.wine-volume {
  display: block;
  font-size: 1.1rem;
}


.expanded-card-right {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.expanded-card-right .card-description p {
    font-size: 1.2em;
    text-align: left;
    margin-bottom: 20px;
    line-height: 1.6;
}

.expanded-card-right p {
    font-size: 1.1em;
    text-align: left;
    margin-bottom: 20px;
}

.cart-feedback-message {
  text-align: center;
  color: var(--primary-color-dark);
  font-style: italic;
  font-size: 0.95rem;
  margin: 10px 0;
  transition: opacity 0.4s ease;
  opacity: 0;
}
.cart-feedback-message.visible { opacity: 1; }


/* Quantity Selector Styles */

.quantity-label {
    margin-right: 5px; /* Adds a small space to the right of the text */
/*     font-weight: bold; */
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 20px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
/*     border: 1px solid #ccc; */
    border: none;
    background-color: var(--primary-color);
    font-size: 1.2em;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.quantity-btn:hover {
    background-color: var(--primary-color-dark);
}

.quantity-input {
    width: 50px;
    text-align: center;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 5px;
    -moz-appearance: textfield; /*Hides arrows on Firefox*/
}

/* Hides arrows on Chrome, Safari, Edge */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-to-cart-btn {
    background-color: var(--primary-color);
    color: white;
    width: 70%;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    margin-top: 20px;
    transition: background-color 0.3s ease;
    align-self: center;
    width: fit-content; /* Ensures the element only takes up as much width as its content */
    margin-top: 20px;
}

.add-to-cart-btn:hover {
    background-color: var(--primary-color-dark);
}

.see-cart-btn {
    background-color: white;
    color: var(--primary-color);
    width: 70%;
    padding: 12px 25px;
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    margin-top: 20px;
    transition: background-color 0.3s ease;
    align-self: center;
    width: fit-content; /* Ensures the element only takes up as much width as its content */
    margin-top: 20px;
}

.see-cart-btn:hover {
    background-color: var(--primary-color-dark);
    color: white;
}


.overlay.active .expanded-card {
    transform: scale(1); /* Expand to full size */
}

/* Positioning the close button and the new navigation group */
.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2em;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 10;
}

.navigation-group {
    position: absolute;
    top: 20px;
    right: 70px; /* Position to the left of the close button */
    display: flex; /* Use flexbox to align buttons */
    gap: 30px; /* Spacing between the buttons */
    z-index: 10;
}

/* Styling the navigation buttons */
.nav-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 0.9em; /* Make them slightly smaller */
    font-style: italic; /* Italicize the text */
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-btn:hover {
    color: var(--primary-color-dark);
}

/* Hide the navigation buttons on sold-out cards to prevent confusion */
.sold-out-card .nav-btn,
.sold-out-card .navigation-group {
    display: none;
}



  /*  ---------------------- Small screen ---------------------- */


/* Optional: Slight adjustment for responsiveness if needed, but 45deg is usually fine */
@media (max-width: 768px) {
    .sold-out-text {
        font-size: 0.9em;
        right: -40px;
        padding: 6px 50px;
    }
}

/* --- Media Queries for Responsive E-shop Layout --- */

@media (max-width: 1100px) {
  .page-container {
    flex-direction: column; /* Stacks the sidebar and main content vertically */
  }
    

  /* Adjusts sidebar to full width and removes sticky positioning */
  .sidebar {
    width: 100%;
    height: auto;
    position: static; /* Removes the sticky effect */
    padding-top: 30px; 
/*     padding-bottom: 20px; */
    text-align: center;
  }

    .sidebar h2 {
      margin-top: 0;
    }
  
    .sidebar ul {
      display: flex;
      justify-content: center;
      gap: 15px;
      flex-wrap: wrap; /* Allows list items to wrap to the next line */
    }
  
    .sidebar a {
      font-size: 1.1em;
    }
    
    .main-content {
      width: 100%;
      padding: 0px;
      padding-top: 0px;
    }
    
    .wine-section {
      margin: 0px;
      margin-bottom: 50px;
      padding-top: 50px;
  }

    /* Small adjustments to the expanded card */
    .expanded-card {
        padding: 15px;
    }
    
    .card-grid {
      /* Adjust grid columns for better tablet viewing */
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 15px;
    }
    
    /* Expanded card adjustments for smaller screens */
    .expanded-card {
        flex-direction: column; /* Stack left and right columns */
        width: 95%;
        max-height: 90vh; /* Prevents card from going off-screen on smaller devices */
        overflow-y: auto; /* Adds scroll if content is too tall */
    }
    
    .expanded-card-left,
    .expanded-card-right {
        width: 100%; /* Make them full width */
        text-align: center; /* Center content within columns */
        align-items: center;
    }

    .expanded-card-right .card-description p {
        text-align: center;
    }

    .quantity-selector,
    .add-to-cart-btn,
    .see-cart-btn {
        margin-left: auto;
        margin-right: auto;
    }
    
    .navigation-group {
        position: static;
        margin-top: 15px;
        justify-content: center;
        width: 100%;
        gap: 15px;
    }
}

@media (max-width: 500px) {

 
  
    .card-grid {
        grid-template-columns: 1fr;
    }

    .expanded-card-left h3 {
        font-size: 1.5em;
    }
    
    .card-description p {
        font-size: 8px;
    }
    .expanded-card-left p {
        font-size: 8px;
    }
    
   /* 
 .expanded-card-right img {
      width: 20%;
    }
 */

    .close-btn {
        right: 10px;
    }
}

