/* =============================
   RESET & BASE STYLES
   ============================= */

/* Common reset and box-sizing */
*,
*:before,
*:after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body styling */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    overflow-x: hidden;
}

/* =============================
   OFFERS SECTION (DESKTOP)
   ============================= */

/* By default, the offers overlay is hidden off-screen to the left */
.offers-section {
    width: 30%;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: scroll;
    padding: 20px;
    background-color: #fff; 
    border-right: 1px solid #e0e0e0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    z-index: 2000;
    transform: translateX(-100%); /* Start hidden */
}

/* Slide the offers overlay into view on desktop */
.offers-section.visible {
    transform: translateX(0);
}

/* Hide the scrollbar in WebKit (optional) */
.offers-section::-webkit-scrollbar {
    display: none;
}

/* =============================
   OFFERS LIST & ITEM STYLES
   ============================= */

.offers-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.offer-item {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.offer-item strong {
    display: block;
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.x-button{
    display: none;
}

.offer-image {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
}

/* =============================
   TOGGLE BUTTON (DESKTOP)
   ============================= */

/* The toggle button starts on the left, vertically centered */
.toggle-button {
    position: fixed;
    top: calc(50vh - 25px); /* center vertically */
    left: 0;
    transform: translateY(0);
    background-color: #c91100; /* Red color */
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1.3rem;
    border-radius: 0 5px 5px 0;
    transition: left 0.3s ease-in-out;
    z-index: 2001;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

/* When the overlay is open on desktop, you can shift the button to the overlay edge if you like */
.toggle-button.open {
    left: 30%; /* Matches the .offers-section width */
}

.toggle-button.closed {
    left: 0;
}

/* =============================
   MOBILE STYLES
   ============================= */

   @media (max-width: 768px) {
    .offers-section {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;        /* Make sure it covers full screen */
        padding: 20px;
        background-color: #fff;
        box-shadow: 2px 0 5px rgba(0,0,0,0.1);
        
        /* Start hidden by translating off-screen to the left */
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 2000;

        /* This is crucial to allow scrolling INSIDE the overlay */
        overflow-y: auto;
    }

    .offers-section.visible {
        /* Slide in from the left on mobile */
        transform: translateX(0);
    }

    /* Hide the toggle button when overlay is open if desired */
    .toggle-button.open {
        display: none;
    }

    .x-button {
        display: block;
        position: fixed!important;
        right: 25px;
        top: 20px;
        background: transparent;
        border: none;
        font-size: 1.5rem;
        color: #c91100;
        cursor: pointer;
        z-index: 2101;
    }
}

