/* Responsive Styles for Sergent Tobogo */

/* Base Styles - Mobile First */
img {
    max-width: 100%;
    height: auto;
}

/* Main Content and Sidebar Layout */
.site-content-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 15px;
    box-sizing: border-box;
}

.site-content {
    display: grid;
    grid-template-columns: 280px 1fr; /* Fixed width for sidebar, rest for content */
    gap: 30px 50px; /* 30px row gap, 50px column gap */
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

#primary {
    grid-column: 2;
    width: 100%;
    overflow: visible;
}

#content {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: visible;
}

#secondary {
    grid-column: 1;
    grid-row: 1; /* Force to first row */
    width: 280px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 5px;
    position: sticky;
    top: 20px; /* Keeps it visible when scrolling */
    align-self: start;
    z-index: 10;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Mobile layout */
@media (max-width: 768px) {
    .site-content {
        grid-template-columns: 1fr;
    }
    
    #primary,
    #secondary {
        grid-column: auto;
        width: 100%;
    }
    
    #secondary {
        position: static;
        margin-top: 30px;
    }
}

/* Ensure content stays next to sidebar on larger screens */
@media screen and (max-width: 1024px) {
    #primary {
        padding-right: 20px;
    }
    
    #secondary {
        flex: 0 0 250px;
    }
}

/* Stack on mobile */
@media screen and (max-width: 768px) {
    .site-content {
        flex-direction: column;
    }
    
    #primary {
        width: 100%;
        padding-right: 0;
        margin-bottom: 30px;
    }
    
    #secondary {
        width: 100%;
        margin-top: 20px;
    }
}

/* Make the layout fluid */
#centrage-header,
#haut-header,
#centrage {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Navigation */
.nav-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    position: relative;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: #9A0202;
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

/* Responsive Breakpoints */
@media screen and (max-width: 1024px) {
    /* Tablet styles */
    #caddie {
        position: fixed;
        right: 20px;
        bottom: 20px;
        z-index: 1000;
        background: white;
        padding: 10px;
        border-radius: 50%;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    }
}

@media screen and (max-width: 768px) {
    /* Mobile styles */
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }
    
    .nav-menu a {
        display: block;
        padding: 12px 15px;
    }
    
    #banniere-rotative img {
        max-height: 200px;
        object-fit: cover;
    }
}

/* Product Grid */
.products {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 30px;
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Product items */
.products li.product {
    margin: 0;
    padding: 15px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    list-style: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden; /* Prevents content from overflowing */
}

.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Product images container */
.products li.product .woocommerce-loop-product__link {
    display: block;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* 1:1 Aspect Ratio */
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

/* Product images */
.products li.product img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures the whole image is visible */
    object-position: center;
    transition: transform 0.3s ease;
}

/* Hover effect for images */
.products li.product:hover img {
    transform: scale(1.05);
}

/* Product titles */
.products li.product h2 {
    font-size: 1.1em;
    margin: 0 0 10px 0;
    flex-grow: 1;
}

/* Price */
.products li.product .price {
    color: #9A0202;
    font-weight: bold;
    font-size: 1.2em;
    margin: 10px 0;
}

/* Add to cart button */
.products li.product .button {
    display: inline-block;
    background: #40A9C1;
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.products li.product .button:hover {
    background: #2d7a8a;
}

/* Responsive grid */
@media (min-width: 480px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .products {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Typography */
body {
    font-size: 16px;
    line-height: 1.6;
}

h1 { font-size: 2em; }
h2 { font-size: 1.75em; }
h3 { font-size: 1.5em; }

/* Utility Classes */
.hide-on-mobile {
    display: none;
}

@media screen and (min-width: 769px) {
    .hide-on-mobile {
        display: block;
    }
    
    .hide-on-desktop {
        display: none;
    }
}
