/*
Single Fortch Product Page Styles
Using provided CSS Variables
*/

:root {
   
    --sfe-font-primary: 'Poppins',  sans-serif;
    --sfe-font-headings: 'Poppins',  sans-serif;
   
}

/* --- GLOBAL & TYPOGRAPHY --- */
body {
    width: 100% !important;
    margin: 0;
    padding: 0;
    font-family: var(--sfe-font-primary) !important;
    color: var(--texte-principal);
    background-color: var(--fond-principal) !important;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px; /* Base font size for better rem calculations */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--sfe-font-headings);
    color: var(--couleur-principale);
    margin-top: 0;
    margin-bottom: 0.75em;
    line-height: 1.3;
    font-weight: 700;
}

a {
    color: var(--couleur-secondaire);
    text-decoration: none;
    transition: color 0.3s ease, opacity 0.3s ease;
}

a:hover {
    color: var(--couleur-principale-hover);
    opacity: 0.85;
}

p {
    margin-bottom: 1em;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- MAIN LAYOUT --- */
.sfe-product-page {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    animation: sfeFadeInPage 0.6s ease-out forwards;
}

@keyframes sfeFadeInPage {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.sfe-product-entry {
    background-color: var(--fond-principal);
    border-radius: var(--rayon-bordure);
    /* Consider a subtle shadow for the whole entry if desired */
    /* box-shadow: 0 5px 25px rgba(0,0,0,0.07); */
}

.sfe-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    border: 1px solid var(--couleur-bordure);
    border-radius: var(--rayon-bordure);
    background-color: var(--fond-principal); /* Ensure section backgrounds are distinct if page BG is different */
}
.sfe-section:last-child {
    margin-bottom: 0;
}
/* Remove extra padding and border for the initial two-column section wrapper */
.sfe-section.sfe-two-columns {
    padding: 0;
    border: none;
    background-color: transparent;
}


/* --- SECTION 1: TWO-COLUMN LAYOUT --- */
.sfe-two-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem; /* Increased gap for better separation */
    margin-bottom: 2.5rem;
}

.sfe-column-left {
    flex: 1 1 450px; /* Slightly larger basis for gallery */
    min-width: 300px;
    position: relative; /* For potential gallery absolutely positioned elements */
}

.sfe-column-right {
    flex: 1 1 400px; /* Slightly smaller for info */
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

/* --- GALLERY (Left Column) --- */
.sfe-gallery {
    position: sticky; /* Make gallery sticky on larger screens */
    top: 2rem;
}

.sfe-gallery-slider {
    margin-bottom: 1rem;
    border: 1px solid var(--couleur-bordure);
    border-radius: var(--rayon-bordure);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(var(--couleur-principale-rgb), 0.1);
}

.sfe-gallery-slider .swiper-slide {
    background-color: #f0f0f0; /* Placeholder if image is loading */
    display: flex;
    align-items: center;
    justify-content: center;
}
.sfe-gallery-slider .swiper-slide img {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1; /* Ensure square aspect ratio for main image */
    object-fit: contain; /* Use contain to show whole product */
    cursor: zoom-in; /* Indicate click-to-enlarge (if Lightbox added) */
}

/* Swiper Arrows */
.sfe-gallery-slider .swiper-button-next,
.sfe-gallery-slider .swiper-button-prev {
    color: var(--couleur-principale);
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.sfe-gallery-slider .swiper-button-next:hover,
.sfe-gallery-slider .swiper-button-prev:hover {
    background-color: var(--couleur-principale);
    color: var(--couleur-texte-sur-principale);
}
.sfe-gallery-slider .swiper-button-next::after,
.sfe-gallery-slider .swiper-button-prev::after {
    font-size: 1.2rem;
    font-weight: bold;
}

.sfe-gallery-thumbs {
    max-height: 100px; /* Limit thumbnail track height */
}
.sfe-gallery-thumbs .swiper-slide {
    width: 20%; /* Adjust based on how many thumbs you want visible */
    height: 80px; /* Fixed height for thumbnails */
    opacity: 0.6;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: calc(var(--rayon-bordure) / 2);
    overflow: hidden;
    transition: opacity 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(var(--couleur-principale-rgb), 0.05);
}
.sfe-gallery-thumbs .swiper-slide:hover {
    opacity: 1;
    transform: scale(1.05);
}
.sfe-gallery-thumbs .swiper-slide-thumb-active {
    opacity: 1;
    border-color: var(--couleur-secondaire);
}
.sfe-gallery-thumbs .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* --- PRODUCT INFO (Right Column) --- */
.sfe-column-right .entry-header {
    margin-bottom: 1.5rem;
}
.sfe-column-right .entry-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem); /* Responsive font size */
    margin-bottom: 0.25em;
    color: var(--couleur-principale);
    font-weight: 700;
}
.sfe-column-right .product-reference {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
    font-weight: 500;
}

.sfe-pricing {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}
.sfe-price-regular del {
    color: #999;
    font-size: 1.3rem;
}
.sfe-price-promo {
    font-size: 2rem;
    color: var(--couleur-alerte); 
    font-weight: 700;
}
.sfe-price {
    font-size: 2rem;
    color: var(--couleur-principale);
    font-weight: 700;
}
.sfe-pricing span { /* Generic span for currency etc. */
    font-weight: 600;
}

/* Stock Status Styles */
.sfe-in-stock {
    color: #28a745; /* Green for available stock */
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    background-color: rgba(40, 167, 69, 0.1);
    display: inline-block;
}

.sfe-low-stock {
    color: #fd7e14; /* Orange for low stock */
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    background-color: rgba(253, 126, 20, 0.1);
    display: inline-block;
    animation: pulse 2s infinite;
}

.sfe-out-of-stock {
    color: #dc3545; /* Red for out of stock */
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    background-color: rgba(220, 53, 69, 0.1);
    display: inline-block;
    text-decoration: line-through;
}

/* Optional animation for low stock warning */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Optional hover effects */
.sfe-in-stock:hover, .sfe-low-stock:hover, .sfe-out-of-stock:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.sfe-short-description {
    margin-bottom: 1.5rem;
    background: var(--sfe-background-light);
    padding: 1rem 1.25rem;
    border-radius: var(--rayon-bordure);
    border-left: 4px solid var(--couleur-principale);
}
.sfe-short-description h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5em;
    color: var(--couleur-principale);
}
.sfe-short-description p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.sfe-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    margin-top: 1.5rem;
}
.sfe-button {
    display: inline-flex; /* For aligning icon and text if you add icons */
    align-items: center;
    justify-content: center;
    padding: 0.8em 1.75em;
    border-radius: var(--rayon-bordure);
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
    transition: all 0.3s ease; /* Smoother transition for multiple properties */
    flex-grow: 1; /* Make buttons share space, or remove for natural width */
}
.sfe-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(var(--couleur-principale-rgb), 0.15);
}
.sfe-button:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(var(--couleur-principale-rgb), 0.1);
}

.sfe-button-whatsapp {
    background-color: var(--couleur-principale);
    color: var(--couleur-texte-sur-principale);
    border-color: var(--couleur-principale);
}
.sfe-button-whatsapp:hover {
    background-color: var(--couleur-principale-hover); /* Darken WhatsApp green */
    border-color:var(--couleur-principale-hover);
    color:  var(--couleur-texte-sur-principale);
}

.sfe-button-add-to-cart {
    background-color: var(--couleur-secondaire);
    color: var(--couleur-texte-sur-secondaire);
    border-color: var(--couleur-secondaire);
}
.sfe-button-add-to-cart:hover {
    background-color: var(--couleur-secondaire-hover);
    border-color: var(--couleur-secondaire-hover);
    color: var(--couleur-texte-sur-secondaire);
}


/* --- SECTION 2: COMPATIBLE ACCESSORIES --- */
.sfe-compatible-accessories {
    background: var(--sfe-background-light);
}
.sfe-compatible-accessories h3 {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    text-align: center; /* Center the title for a showcase feel */
    color: var(--couleur-principale);
}
.sfe-compatible-accessories ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}
.sfe-compatible-accessories li {
    background: var(--fond-principal);
    border: 1px solid var(--couleur-bordure);
    border-radius: var(--rayon-bordure);
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.sfe-compatible-accessories li:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(var(--couleur-principale-rgb), 0.1);
}
.sfe-compatible-accessories li a {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--couleur-principale);
    font-size: 0.9rem;
}
.sfe-compatible-accessories li img {
    width: 60px; /* Larger thumbnail */
    height: 60px;
    object-fit: cover;
    border-radius: 50%; /* Circular thumbnails */
    margin-bottom: 0.75rem;
    border: 2px solid var(--couleur-bordure);
}

/* --- SECTION 3: TABS --- */
.sfe-tabs {
    /* No specific outer styling needed if sfe-section already handles it */
    overflow: hidden; /* Important for border-radius on children */
}
.sfe-tab-links {
    list-style: none;
    padding: 0;
    margin: 0 0 -1px 0; /* Negative margin to connect with content border */
    display: flex;
    flex-wrap: wrap; /* Allow tabs to wrap */
    background-color: var(--sfe-background-light);
    border-bottom: 1px solid var(--couleur-bordure);
    position: relative;
    z-index: 2;
}
.sfe-tab-links li {
    flex-grow: 1; /* Distribute space equally */
    margin-bottom: -1px; /* Overlap border */
}
.sfe-tab-links li a {
    display: block;
    padding: 0.9rem 1.25rem; /* Slightly adjusted padding */
    text-align: center;
    font-weight: 600;
    color: var(--texte-principal);
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none; /* Active state will handle bottom border or underline */
    position: relative;
    transition: background-color 0.3s, color 0.3s;
    border-radius: var(--rayon-bordure) var(--rayon-bordure) 0 0;
}

.sfe-tab-links li a::after { /* Underline effect */
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--couleur-secondaire);
    transition: width 0.3s ease, left 0.3s ease;
}

.sfe-tab-links li a:hover,
.sfe-tab-links li a:focus {
    color: var(--couleur-secondaire);
    background-color: #e9ecef;
}
.sfe-tab-links li a:hover::after,
.sfe-tab-links li a:focus::after,
.sfe-tab-links li.active a::after {
    width: 80%;
    left: 10%;
}

.sfe-tab-links li.active a {
    color: var(--couleur-secondaire);
    background-color: var(--fond-principal);
    border-color: var(--couleur-bordure); /* Top, left, right borders */
    border-bottom-color: var(--fond-principal); /* Make bottom "disappear" */
    z-index: 1;
}

.sfe-tab-content {
    padding: 2rem 1.5rem; /* More padding inside tab content */
    border: 1px solid var(--couleur-bordure);
    border-top: none; /* Tab links handle top separation */
    border-radius: 0 0 var(--rayon-bordure) var(--rayon-bordure);
    background-color: var(--fond-principal);
}
.sfe-tab-pane {
    display: none;
    animation: sfeFadeInTab 0.5s ease-out forwards;
}
.sfe-tab-pane.active {
    display: block;
}
@keyframes sfeFadeInTab {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sfe-tab-title {
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--couleur-bordure);
    display: none; /* Hidden by default, shown on mobile if tabs stack */
}

.sfe-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
}
.sfe-specs-table tr:nth-child(odd) td {
    background-color: var(--sfe-background-light);
}
.sfe-specs-table tr td {
    padding: 0.8rem 1rem;
    border: 1px solid var(--couleur-bordure);
    vertical-align: top;
}
.sfe-specs-table tr td:first-child {
    font-weight: 600;
    color: var(--couleur-principale);
    width: 30%; /* Fixed width for spec name */
    background-color: #F7F7F7; /* Slightly different shade for heading column */
}

.sfe-full-description {
    line-height: 1.7;
}
.sfe-full-description p,
.sfe-full-description ul,
.sfe-full-description ol {
    margin-bottom: 1.2em;
}
.sfe-full-description ul, .sfe-full-description ol {
    padding-left: 1.5em;
}
.sfe-full-description strong {
    font-weight: 600;
    color: var(--couleur-principale);
}
.sfe-full-description a {
    text-decoration: underline;
}
.sfe-full-description img {
    margin: 1rem auto;
    border-radius: calc(var(--rayon-bordure)/2);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}


.sfe-downloads {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}
.sfe-download-button {
    /* Reuse .sfe-button styles, but ensure they are distinct if needed */
    background-color: var(--couleur-principale);
    color: var(--couleur-texte-sur-principale);
    border-color: var(--couleur-principale);
    min-width: 250px; /* Give download buttons a decent width */
    text-align: left;
    padding-left: 1.5em; /* More padding on left if you add icon */
    flex-grow: 0; /* Do not grow to fill container by default */
}
.sfe-download-button:hover {
    background-color: var(--couleur-principale-hover);
    border-color: var(--couleur-principale-hover);
    color: var(--couleur-texte-sur-principale);
}


/* --- ORDER SECTION --- */
#sam-fortch-whapp-order-section {
    padding: 2rem 1.5rem; /* Adjusted padding */
    background: var(--sfe-background-light);
    border: 1px solid var(--couleur-bordure);
    border-radius: var(--rayon-bordure);
    margin-top: 2.5rem;
    box-shadow: 0 5px 20px rgba(var(--couleur-principale-rgb), 0.08);
    animation: sfeSlideUpForm 0.7s ease-out forwards;
}
@keyframes sfeSlideUpForm {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

#sam-fortch-whapp-order-section h2 {
    text-align: center;
    margin-bottom: 2rem; /* Increased margin */
    font-size: clamp(1.6rem, 5vw, 2rem);
    color: var(--couleur-principale);
}
.label-st-order-section { /* For <strong class="label-st-order-section"> */
    display: block;
    font-weight: 600;
    margin-bottom: 0.6rem; /* Spacing between label and input */
    color: var(--texte-principal);
    font-size: 0.9rem;
}
#sam-fortch-whapp-order-section label { /* Actual <label> element */
    display: block;
    margin-bottom: 1.25rem;
}
#sam-fortch-whapp-order-section label > div:not(.custom-dropdown) { /* For quantity controls wrapper */
    display: flex;
    align-items: center;
}

/* Quantity controls */
.qty-input {
    width: 35%;
    text-align: center;
    border: 1px solid var(--couleur-bordure);
    padding: 0.6rem 0.5rem; /* Adjusted padding */
    border-radius: var(--rayon-bordure);
    margin: 0 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    -moz-appearance: textfield; /* Firefox */
    transition: border-color 0.3s, box-shadow 0.3s;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.qty-input:focus {
    outline: none;
    border-color: var(--couleur-secondaire);
    box-shadow: 0 0 0 3px rgba(var(--couleur-secondaire-rgb), 0.2);
}
.qty-decrease, .qty-increase {
    background-color: var(--couleur-principale);
    color: var(--couleur-texte-sur-principale);
    border: none;
    width: 36px; /* Slightly larger buttons */
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qty-decrease:hover, .qty-increase:hover {
    background-color: var(--couleur-secondaire);
    color: var(--couleur-texte-sur-secondaire);
    transform: scale(1.1);
}

/* Form fields layout */
.form-fields-container {
    width: 100%;
    display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
 
}


.custom-order-input-container,
.custom-select-container {
  flex: 1 1 47%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  
}

#sam-fortch-whapp-order-section input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem; /* Comfortable padding */
    border: 1px solid var(--couleur-bordure);
    border-radius: var(--rayon-bordure);
    box-sizing: border-box;
    font-size: 1rem;
    font-family: var(--sfe-font-primary);
    transition: border-color 0.3s, box-shadow 0.3s;
}
#sam-fortch-whapp-order-section input[type="text"]:focus {
    outline: none;
    border-color: var(--couleur-secondaire);
    box-shadow: 0 0 0 3px rgba(var(--couleur-secondaire-rgb), 0.2);
}

/* Custom Dropdowns */
.custom-dropdown {
    position: relative;
    width: 100%;
    cursor: pointer;
}
.dropdown-selected {
    padding: 0.75rem 1rem;
    border: 1px solid var(--couleur-bordure);
    border-radius: var(--rayon-bordure);
    background-color: var(--fond-principal);
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-size: 1rem;
}
.dropdown-selected::after {
    content: '▼';
    font-size: 0.8em;
    color: var(--texte-principal);
    transition: transform 0.3s ease;
}
.custom-dropdown.open .dropdown-selected {
    border-color: var(--couleur-secondaire);
    box-shadow: 0 0 0 3px rgba(var(--couleur-secondaire-rgb), 0.2);
}
.custom-dropdown.open .dropdown-selected::after {
    transform: rotate(180deg);
}

.dropdown-items {
    display: none;
    position: absolute;
    top: calc(100% + 4px); /* Small gap from selected box */
    left: 0;
    right: 0;
    background-color: var(--fond-principal);
    border: 1px solid var(--couleur-bordure);
    border-radius: var(--rayon-bordure);
    max-height: 220px; /* Max height before scroll */
    overflow-y: auto;
    z-index: 100; /* Ensure it's above other elements */
    box-shadow: 0 5px 15px rgba(var(--couleur-principale-rgb), 0.1);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--couleur-principale) var(--sfe-background-light);
}
.dropdown-items::-webkit-scrollbar { width: 8px; }
.dropdown-items::-webkit-scrollbar-track { background: var(--sfe-background-light); border-radius: var(--rayon-bordure); }
.dropdown-items::-webkit-scrollbar-thumb { background-color: var(--couleur-principale); border-radius: var(--rayon-bordure); }

.custom-dropdown.open .dropdown-items {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
.dropdown-items div {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 0.95rem;
}
.dropdown-items div:hover {
    background-color: var(--sfe-background-light);
    color: var(--couleur-secondaire);
}
.dropdown-items div.selected-item-highlight { /* Class for selected item in dropdown if you implement that */
    background-color: rgba(var(--couleur-secondaire-rgb), 0.1);
    font-weight: 600;
}


#order-summary {
    padding: 1rem 1.25rem;
    background: #e9f7ef; /* Light success green */
    border: 1px solid #badbcc; /* Greenish border */
    border-left: 4px solid var(--couleur-succes);
    border-radius: var(--rayon-bordure);
    margin-bottom: 1.5rem;
    color: #155724; /* Dark green text */
    font-size: 0.95rem;
    line-height: 1.5;
    transition: all 0.3s ease;
}
#order-summary strong {
    font-weight: 600;
}

.order-summ-buttons {
    display: flex;
    gap: 1rem;
    flex-direction: column; /* Stack buttons on small screens */
}


#order-whatsapp, #order-viber {
    flex: 1; /* Make buttons share space */
    text-align: center;
    font-weight: bold;
    padding: 0.85em 1.2em; /* Slightly taller */
    text-decoration:none;
    border-radius: var(--rayon-bordure);
    color: #fff;
    transition: transform 0.2s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}
#order-whatsapp { background:#25D366; }
#order-viber { background:#665CAC; }

#order-whatsapp:hover, #order-viber:hover {
    opacity: 0.9;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
#order-whatsapp:active, #order-viber:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* --- RESPONSIVE STYLES --- */

/* Tablet and Smaller (<= 1024px) */
@media (max-width: 1024px) {
    .sfe-product-page {
        margin: 1.5rem auto;
        padding: 0 0.75rem;
    }

    .sfe-two-columns {
        gap: 2rem; /* Slightly reduced gap for tablets */
    }

    .sfe-column-left {
        flex: 1 1 48%; /* Give slightly more balanced flex basis */
    }
    .sfe-column-right {
        flex: 1 1 48%;
    }

    .sfe-gallery {
        position: static; /* Remove sticky for tablet, can cause layout issues */
        top: auto;
    }

    .sfe-pricing .sfe-price-promo,
    .sfe-pricing .sfe-price {
        font-size: 1.8rem;
    }
    .sfe-pricing .sfe-price-regular del {
        font-size: 1.1rem;
    }

    .sfe-compatible-accessories ul {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 1rem;
    }
    .sfe-compatible-accessories li img {
        width: 50px;
        height: 50px;
    }
}


/* Mobile Devices (<= 767px) */
@media (max-width: 767px) {
   body, html  {
        font-size: 15px; /* Slightly smaller base font for mobile */
       width: 100% !important;
  margin: 0;
  padding: 0;
  box-sizing: border-box !important;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.4rem; }

    .sfe-product-page {
        margin: 1rem auto;
        padding: 0 0.75rem; /* Consistent with tablet padding */
    }

    .sfe-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    /* Ensure the two-column wrapper behaves like other sections on mobile */
    .sfe-section.sfe-two-columns {
        padding: 1rem; /* Restore padding */
        border: 1px solid var(--couleur-bordure); /* Restore border */
        background-color: var(--fond-principal); /* Restore background */
        margin-bottom: 1.5rem; /* Add margin like other sections */
    }

    .sfe-two-columns {
        flex-direction: column;
        gap: 1.5rem; /* Gap between stacked columns */
    }
    .sfe-column-left,
    .sfe-column-right {
        flex-basis: auto; /* Reset flex-basis */
        min-width: 0; /* Allow full shrink */
        width: 100%;
    }

    .sfe-gallery {
        margin-bottom: 1.5rem; /* Space below gallery before next content */
    }
    .sfe-gallery-slider .swiper-button-next,
    .sfe-gallery-slider .swiper-button-prev {
        width: 35px;
        height: 35px;
    }
    .sfe-gallery-slider .swiper-button-next::after,
    .sfe-gallery-slider .swiper-button-prev::after {
        font-size: 1rem;
    }
    .sfe-gallery-thumbs {
        max-height: 80px;
    }
    .sfe-gallery-thumbs .swiper-slide {
        height: 60px;
        width: 25%; /* Show 4 thumbs */
    }

    .sfe-column-right .entry-title {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
    }
    .sfe-pricing .sfe-price-promo,
    .sfe-pricing .sfe-price {
        font-size: 1.7rem;
    }

    .sfe-stock {
        display: block; /* Make it full width for better readability */
        text-align: center;
        margin-bottom: 1rem;
    }

    .sfe-buttons {
        flex-direction: column; /* Stack buttons */
        gap: 0.75rem;
    }
    .sfe-button {
        padding: 0.9em 1.5em; /* Adjust padding for stacked buttons */
        font-size: 0.9rem;
    }

    .sfe-compatible-accessories h3 {
        font-size: 1.3rem;
    }
    .sfe-compatible-accessories ul {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 0.75rem;
    }
    .sfe-compatible-accessories li {
        padding: 0.75rem;
    }
    .sfe-compatible-accessories li img {
        width: 45px;
        height: 45px;
    }
    .sfe-compatible-accessories li a {
        font-size: 0.85rem;
    }

    /* Mobile Tabs: Stacked Vertically */
    .sfe-tab-links {
        flex-direction: column; /* Stack tab links */
        margin: 0; /* Reset margin */
        border-bottom: none; /* Remove bottom border from container */
        background-color: transparent; /* Remove background from link container */
    }
    .sfe-tab-links li {
        margin-bottom: 0; /* Remove any overlap margin */
        flex-grow: 0; /* Don't grow */
    }
    .sfe-tab-links li a {
        padding: 0.8rem 1rem;
        border-radius: 0; /* No border radius when stacked */
        text-align: left; /* Align text to left for stacked tabs */
        border: 1px solid transparent; /* Base border state */
        border-bottom: 1px solid var(--couleur-bordure); /* Separator */
        background-color: var(--sfe-background-light); /* Give tabs a background */
        font-weight: 500;
    }
    .sfe-tab-links li:first-child a {
        border-top-left-radius: var(--rayon-bordure);
        border-top-right-radius: var(--rayon-bordure);
    }
    .sfe-tab-links li:last-child a {
        border-bottom: none; /* Last tab link has no bottom border, content below will have top */
    }
    .sfe-tab-links li a::after {
       display: none; /* Disable the underline effect from desktop */
    }
    .sfe-tab-links li a:hover,
    .sfe-tab-links li a:focus {
        color: var(--couleur-secondaire);
        background-color: #e0e0e0; /* Slightly darker hover */
    }
    .sfe-tab-links li.active a {
        color: var(--couleur-secondaire);
        background-color: var(--fond-principal);
        border-left: 4px solid var(--couleur-secondaire);
        border-top-color: var(--couleur-bordure);
        border-right-color: var(--couleur-bordure);
        border-bottom-color: var(--couleur-bordure); /* Make active tab distinct */
        font-weight: 700; /* Make active tab text bolder */
        padding-left: calc(1rem - 4px); /* Adjust padding for the border */
        position: relative;
        z-index: 2; /* Ensure active tab is above others if overlapping occurs */
    }
     .sfe-tab-links li.active:last-child a {
        border-bottom-color: var(--couleur-bordure); /* For active last tab */
    }

    .sfe-tab-content {
        padding: 1.25rem 1rem;
        border: 1px solid var(--couleur-bordure); /* Ensure content area has border */
        border-top: none; /* Connect with active tab's bottom border or overall tab links bottom */
        border-radius: 0 0 var(--rayon-bordure) var(--rayon-bordure); /* Keep bottom radius */
        margin-top: -1px; /* Pull up to meet tab links border */
        position: relative;
        z-index: 1;
    }
    .sfe-tab-title { /* Title inside tab pane */
        display: block; /* Show tab titles as headings within content */
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    /* Responsive Table: Stacked Rows */
    .sfe-specs-table thead {
        display: none; /* Hide table head if present */
    }
    .sfe-specs-table tr {
       
        margin-bottom: 1rem;
        border: 1px solid var(--couleur-bordure); /* Each item gets a border */
        border-radius: calc(var(--rayon-bordure) / 2);
        overflow: hidden; /* For rounded corners on children */
    }
    .sfe-specs-table tr:last-child {
        margin-bottom: 0;
    }
    .sfe-specs-table td {
      
        width: 100% ; /* Full width */
        text-align: left !important; /* Align text to left */
        border: none !important; /* Remove original cell borders */
        padding: 0.6rem 0.8rem !important; /* Consistent padding */
        background-color: var(--fond-principal) !important; /* Reset alternating bg */
    }
    .sfe-specs-table td:first-child { /* Label cell */
        font-weight: 600;
        color: var(--couleur-principale);
        background-color: var(--sfe-background-light) !important; /* Keep label distinct */
        border-bottom: 1px solid var(--couleur-bordure); /* Separator between label and value */
    }
    .sfe-specs-table td::before { /* Remove any ::before from other methods */
        content: "";
        display: none;
    }

    .sfe-downloads {
        align-items: stretch; /* Make download buttons full width */
    }
    .sfe-download-button {
        min-width: unset; /* Remove min-width */
        width: 100%;
        text-align: center;
        padding-left: 1em; /* Reset padding if icon alignment changes */
        padding-right: 1em;
    }

    #sam-fortch-whapp-order-section {
        padding: 1.5rem 1rem;
        margin-top: 1.5rem;
    }
    #sam-fortch-whapp-order-section h2 {
        margin-bottom: 1.5rem;
        font-size: clamp(1.4rem, 5vw, 1.8rem);
    }
    .form-fields-container { /* Already 1fr, but can reduce gap */
        gap: 1rem;
    }
     .custom-order-input-container,
  .custom-select-container {
    flex: 1 1 100%;
  }
    #sam-fortch-whapp-order-section input[type="text"],
    .dropdown-selected {
        padding: 0.7rem 0.9rem;
        font-size: 0.95rem;
    }
    .qty-input {
        padding: 0.5rem 0.4rem;
        width: 50%;
    }
    .qty-decrease, .qty-increase {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .order-summ-buttons { /* Already column, can reduce gap */
        gap: 0.75rem;
    }
    #order-whatsapp, #order-viber {
        padding: 0.8em 1em;
        font-size: 0.85rem;
    }
}

/* Small Mobile Devices (<= 480px) - Optional fine-tuning */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    .sfe-product-page {
        padding: 0 0.5rem;
    }
    .sfe-section,
    .sfe-section.sfe-two-columns {
        padding: 0.75rem;
    }

    .sfe-column-right .entry-title {
        font-size: clamp(1.4rem, 6vw, 1.9rem);
    }
    .sfe-pricing .sfe-price-promo,
    .sfe-pricing .sfe-price {
        font-size: 1.5rem;
    }
    .sfe-pricing .sfe-price-regular del {
        font-size: 1rem;
    }

    .sfe-gallery-thumbs .swiper-slide {
        height: 50px;
    }

    .sfe-compatible-accessories ul {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Allow slightly smaller items */
    }
    .sfe-compatible-accessories li img {
        width: 40px;
        height: 40px;
    }

    .sfe-tab-links li a {
        padding: 0.7rem 0.8rem;
        font-size: 0.9rem;
    }
    .sfe-tab-links li.active a {
         padding-left: calc(0.8rem - 4px);
    }
    .sfe-tab-content {
        padding: 1rem 0.75rem;
    }
     .sfe-tab-title {
        font-size: 1.1rem;
    }

    .sfe-specs-table tr {
        margin-bottom: 0.75rem; /* Slightly reduce margin between spec items */
    }
    .sfe-specs-table td {
        padding: 0.5rem 0.6rem !important;
        font-size: 0.9rem;
    }

    #sam-fortch-whapp-order-section input[type="text"],
    .dropdown-selected,
    #order-summary {
        font-size: 0.9rem;
    }
    #order-whatsapp, #order-viber {
        padding: 0.75em 0.9em;
        font-size: 0.8rem;
    }
}