/**
 * RESPONSIVE CUSTOM CSS - SGI LEASE & GO
 * Optimisation responsive pour Front Public + Espace Client
 * Date: 12/12/2025
 * Mobile First Approach
 */

/* ============================================
   VARIABLES & BASE
   ============================================ */
:root {
    --mobile-padding: 15px;
    --tablet-padding: 20px;
    --desktop-padding: 30px;
    --transition-speed: 0.3s;
}

/* ============================================
   MOBILE FIRST (< 576px)
   ============================================ */

/* Container & Spacing */
.container {
    padding-left: var(--mobile-padding);
    padding-right: var(--mobile-padding);
}

/* Typography */
h1 { font-size: 1.75rem !important; }
h2 { font-size: 1.5rem !important; }
h3 { font-size: 1.25rem !important; }
h4 { font-size: 1.1rem !important; }
h5 { font-size: 1rem !important; }
h6 { font-size: 0.9rem !important; }

/* Buttons - Mobile Optimized */
.btn {
    padding: 12px 20px;
    font-size: 14px;
    white-space: nowrap;
    border-radius: 8px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0;
}

.btn i {
    font-size: 16px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-sm i {
    font-size: 14px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 10px;
}

/* Button full width on mobile */
@media (max-width: 575px) {
    .btn-mobile-full {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-group-mobile {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-group-mobile .btn {
        width: 100%;
    }
}

/* Button hover effects */
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Primary button style */
.btn-fill-out,
.btn-primary {
    background: linear-gradient(135deg, var(--theme-primary-color, #FF324D) 0%, var(--theme-primary-color-dark, #e02a43) 100%);
    border: none;
    color: #fff;
}

.btn-fill-out:hover,
.btn-primary:hover {
    background: linear-gradient(135deg, var(--theme-primary-color-dark, #e02a43) 0%, var(--theme-primary-color, #FF324D) 100%);
    color: #fff;
}

/* Outline button style */
.btn-outline,
.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--theme-primary-color, #FF324D);
    color: var(--theme-primary-color, #FF324D);
}

.btn-outline:hover,
.btn-outline-primary:hover {
    background: var(--theme-primary-color, #FF324D);
    color: #fff;
}

/* Forms - Mobile Optimized */
.form-control,
.form-select {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--theme-primary-color, #FF324D);
    box-shadow: 0 0 0 3px rgba(255, 50, 77, 0.1);
}

/* Form labels */
.form-label,
label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

/* ============================================
   NAVIGATION & HEADER
   ============================================ */

/* Mobile Menu */
@media (max-width: 991px) {
    .navbar-nav {
        padding: 15px 0;
    }
    
    .navbar-nav .nav-item {
        padding: 8px 0;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }
    
    .navbar-nav .nav-link {
        padding: 12px 15px !important;
        font-size: 15px;
        font-weight: 500;
    }
    
    .dropdown-menu {
        border: none;
        box-shadow: none;
        padding-left: 20px;
        background: #f8f9fa;
        border-radius: 8px;
        margin-top: 5px;
    }
    
    .dropdown-menu .dropdown-item {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    /* Header simplification mobile */
    .header_wrap .top-header {
        display: none;
    }
    
    .header_wrap .middle-header {
        padding: 10px 0;
    }
    
    .logo {
        max-width: 120px;
    }
    
    /* Search bar mobile */
    .search_form {
        margin: 10px 0;
    }
    
    .search_form input {
        font-size: 16px;
        padding: 12px 15px;
        border-radius: 8px;
    }
    
    /* Header icons mobile */
    .header_icons,
    .header_right {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .header_icons a,
    .header_right a {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #f8f9fa;
        color: #333;
        font-size: 18px;
        position: relative;
    }
    
    .header_icons a:hover,
    .header_right a:hover {
        background: var(--theme-primary-color, #FF324D);
        color: #fff;
    }
    
    /* Cart badge */
    .header_icons .cart_count,
    .cart_trigger .cart_count {
        position: absolute;
        top: -5px;
        right: -5px;
        width: 20px;
        height: 20px;
        background: var(--theme-primary-color, #FF324D);
        color: #fff;
        font-size: 11px;
        font-weight: 600;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Mobile bottom navigation bar */
@media (max-width: 767px) {
    .mobile_bottom_nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        padding: 8px 0;
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    
    .mobile_bottom_nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: #666;
        font-size: 10px;
        text-decoration: none;
        padding: 5px 10px;
    }
    
    .mobile_bottom_nav a i {
        font-size: 20px;
    }
    
    .mobile_bottom_nav a.active,
    .mobile_bottom_nav a:hover {
        color: var(--theme-primary-color, #FF324D);
    }
    
    /* Add padding to body for bottom nav */
    body {
        padding-bottom: 70px;
    }
}

/* ============================================
   BANNER & CAROUSEL
   ============================================ */

/* Banner responsive */
.banner_section .carousel-item {
    height: 250px !important;
}

@media (min-width: 576px) {
    .banner_section .carousel-item {
        height: 300px !important;
    }
}

@media (min-width: 768px) {
    .banner_section .carousel-item {
        height: 350px !important;
    }
}

@media (min-width: 992px) {
    .banner_section .carousel-item {
        height: 384px !important;
    }
}

/* Fix décalage bannière sur mobile */
@media (max-width: 991px) {
    .banner_section .offset-lg-3 {
        margin-left: 0 !important;
    }
    
    .banner_section .container {
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
    }
    
    .banner_section .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .banner_section .col-12 {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Fix overflow horizontal sur mobile (décalage page) */
@media (max-width: 991px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .section .container-wide,
    .section .container {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Fix carrousel produits qui déborde */
    .carousel-container {
        overflow: hidden;
    }
    
    .product_slider.owl-carousel .owl-nav {
        width: 100%;
        left: 0;
        right: 0;
    }
}

/* Carousel controls mobile */
@media (max-width: 767px) {
    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
    }
    
    .carousel-control-prev i,
    .carousel-control-next i {
        font-size: 20px;
    }
}

/* ============================================
   PRODUCTS GRID
   ============================================ */

/* Product cards responsive */
.product {
    margin-bottom: 20px;
}

.product_img {
    position: relative;
    overflow: hidden;
}

.product_img img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Product info mobile */
@media (max-width: 575px) {
    .product_info {
        padding: 12px !important;
        text-align: center;
    }
    
    .product_title h6 {
        font-size: 14px !important;
        line-height: 1.4;
        margin-bottom: 8px !important;
        font-weight: 600;
    }
    
    .product_price {
        font-size: 14px !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    
    .product_price .price {
        font-size: 18px !important;
        font-weight: 700;
        color: var(--theme-primary-color, #FF324D);
    }
    
    .product_price del {
        font-size: 13px;
        color: #999;
    }
    
    .product_action_box {
        padding: 10px;
        display: flex;
        justify-content: center;
    }
    
    .product_action_box .list_product_action_box {
        display: flex;
        justify-content: center;
        gap: 8px;
    }
    
    .product_action_box .list_product_action_box li {
        margin: 0;
    }
    
    .product_action_box .list_product_action_box li a {
        width: 40px;
        height: 40px;
        font-size: 16px;
        line-height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8f9fa;
        transition: all 0.3s ease;
    }
    
    .product_action_box .list_product_action_box li a:hover {
        background: var(--theme-primary-color, #FF324D);
        color: #fff;
    }
    
    /* Product card improvements */
    .product {
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        transition: all 0.3s ease;
        background: #fff;
    }
    
    .product:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
        transform: translateY(-2px);
    }
    
    /* Add to cart button mobile */
    .product .add-to-cart-btn,
    .product .btn-add-cart {
        width: 100%;
        padding: 10px;
        font-size: 13px;
        border-radius: 0 0 12px 12px;
    }
}

/* Grid responsive */
@media (max-width: 575px) {
    .col-6.col-md-4.col-lg-3 {
        padding-left: 6px;
        padding-right: 6px;
    }
    
    .row {
        margin-left: -6px;
        margin-right: -6px;
    }
}

/* ============================================
   MOBILE ACTION BUTTONS & CTA
   ============================================ */

@media (max-width: 575px) {
    /* Section titles centered */
    .section .heading_s1 h2,
    .section .heading_s2 h2,
    .section_title h2 {
        text-align: center;
        font-size: 1.4rem !important;
        margin-bottom: 20px;
    }
    
    /* Action buttons row */
    .action_buttons,
    .btn-row,
    .button-group {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .action_buttons .btn,
    .btn-row .btn,
    .button-group .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* CTA sections */
    .cta_section {
        padding: 30px 15px;
        text-align: center;
    }
    
    .cta_section h3 {
        font-size: 1.3rem !important;
        margin-bottom: 15px;
    }
    
    .cta_section .btn {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    /* Hero section mobile */
    .hero_section,
    .banner_content {
        text-align: center;
        padding: 20px 15px;
    }
    
    .hero_section h1,
    .banner_content h1 {
        font-size: 1.6rem !important;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    .hero_section p,
    .banner_content p {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .hero_section .btn,
    .banner_content .btn {
        width: 100%;
        max-width: 250px;
    }
    
    /* Card actions */
    .card-footer {
        padding: 15px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .card-footer .btn {
        width: 100%;
    }
    
    /* Inline buttons to stack */
    .d-flex.gap-2,
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 10px !important;
    }
    
    .d-flex.gap-2 .btn,
    .d-flex.gap-3 .btn {
        width: 100%;
    }
}

/* ============================================
   PRODUCT DETAIL PAGE
   ============================================ */

/* Product images mobile */
@media (max-width: 767px) {
    .product-image {
        margin-bottom: 20px;
    }
    
    .product_img_box {
        margin-bottom: 15px;
        border-radius: 12px;
        overflow: hidden;
    }
    
    .product_gallery_item {
        margin: 5px;
        border-radius: 8px;
        overflow: hidden;
    }
}

/* Product info mobile */
@media (max-width: 767px) {
    .product_info_section,
    .product_detail_info {
        padding: 20px 15px;
    }
    
    .product_title,
    .product_detail_info h2 {
        font-size: 1.4rem !important;
        font-weight: 700;
        line-height: 1.3;
        margin-bottom: 15px;
    }
    
    .product_price,
    .product_detail_info .price_box {
        font-size: 1.6rem !important;
        margin: 15px 0;
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .product_price .price,
    .price_box .price {
        color: var(--theme-primary-color, #FF324D);
        font-weight: 700;
    }
    
    .product_desc,
    .product_detail_info .pr_desc {
        font-size: 14px;
        line-height: 1.6;
        color: #666;
    }
    
    /* Product options mobile */
    .product_options,
    .pr_switch_wrap {
        margin: 20px 0;
    }
    
    .product_options label,
    .pr_switch_wrap label {
        display: block;
        margin-bottom: 10px;
        font-weight: 600;
    }
}

/* Quantity selector mobile */
@media (max-width: 575px) {
    .quantity {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 15px;
    }
    
    .quantity .qty-btn,
    .quantity button {
        width: 44px;
        height: 44px;
        border-radius: 8px;
        border: 1px solid #ddd;
        background: #f8f9fa;
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .quantity input {
        width: 60px;
        height: 44px;
        text-align: center;
        font-size: 16px;
        font-weight: 600;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin: 0 8px;
    }
    
    /* Add to cart section mobile */
    .cart_extra,
    .product_action_wrap {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-top: 20px;
    }
    
    .cart_extra .btn,
    .product_action_wrap .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
        font-weight: 600;
    }
    
    /* Wishlist and compare buttons */
    .wishlist_btn,
    .compare_btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: #fff;
        color: #333;
        font-size: 14px;
    }
    
    .wishlist_btn:hover,
    .compare_btn:hover {
        border-color: var(--theme-primary-color, #FF324D);
        color: var(--theme-primary-color, #FF324D);
    }
}

/* ============================================
   CART & CHECKOUT
   ============================================ */

/* Cart table responsive */
@media (max-width: 767px) {
    .cart_table {
        font-size: 13px;
    }
    
    .cart_table .product-thumbnail {
        width: 60px;
    }
    
    .cart_table .product-thumbnail img {
        max-width: 50px;
    }
    
    .cart_table .product-name {
        font-size: 13px;
    }
    
    .cart_table .product-price,
    .cart_table .product-quantity,
    .cart_table .product-subtotal {
        font-size: 13px;
    }
    
    .cart_table .product-remove {
        padding: 5px;
    }
    
    /* Stack cart items vertically on very small screens */
    .cart_table thead {
        display: none;
    }
    
    .cart_table tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        padding: 15px;
        border-radius: 8px;
    }
    
    .cart_table tbody td {
        display: block;
        text-align: right;
        padding: 8px 0;
        border: none;
    }
    
    .cart_table tbody td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
    }
    
    .cart_table .product-thumbnail {
        text-align: center !important;
    }
}

/* Cart summary mobile */
@media (max-width: 767px) {
    .cart_footer {
        margin-top: 20px;
    }
    
    .cart_footer .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Checkout form mobile */
@media (max-width: 767px) {
    .checkout_form .form-group {
        margin-bottom: 15px;
    }
    
    .checkout_form .row > div {
        margin-bottom: 15px;
    }
}

/* ============================================
   DASHBOARD CLIENT
   ============================================ */

/* Dashboard cards mobile */
@media (max-width: 767px) {
    .dashboard_menu {
        margin-bottom: 20px;
    }
    
    .dashboard_menu .nav {
        flex-direction: column;
    }
    
    .dashboard_menu .nav-link {
        padding: 12px 15px;
        border-bottom: 1px solid #ddd;
    }
    
    .dashboard_content {
        padding: 15px;
    }
}

/* Stats cards mobile */
@media (max-width: 575px) {
    .stat-card {
        margin-bottom: 15px;
    }
    
    .stat-card .card-body {
        padding: 15px;
    }
    
    .stat-card h3 {
        font-size: 1.5rem !important;
    }
    
    .stat-card p {
        font-size: 13px;
    }
}

/* ============================================
   ORDERS & INVOICES
   ============================================ */

/* Orders table mobile */
@media (max-width: 767px) {
    .orders_table {
        font-size: 13px;
    }
    
    .orders_table thead {
        display: none;
    }
    
    .orders_table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        padding: 15px;
        border-radius: 8px;
    }
    
    .orders_table tbody td {
        display: block;
        text-align: right;
        padding: 8px 0;
        border: none;
    }
    
    .orders_table tbody td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
    }
}

/* Order details mobile */
@media (max-width: 767px) {
    .order_detail {
        padding: 15px;
    }
    
    .order_detail .order_info {
        margin-bottom: 20px;
    }
    
    .order_detail .order_info .row > div {
        margin-bottom: 10px;
    }
}

/* ============================================
   LEASING PAGES
   ============================================ */

/* Leasing cards mobile */
@media (max-width: 767px) {
    .leasing_card {
        margin-bottom: 15px;
    }
    
    .leasing_card .card-body {
        padding: 15px;
    }
    
    .leasing_info {
        font-size: 13px;
    }
    
    .leasing_status {
        margin: 10px 0;
    }
}

/* Leasing form mobile */
@media (max-width: 767px) {
    .leasing_form .form-group {
        margin-bottom: 15px;
    }
    
    .leasing_simulator {
        padding: 15px;
    }
    
    .simulator_result {
        padding: 15px;
        margin-top: 15px;
    }
}

/* Payment schedule mobile */
@media (max-width: 767px) {
    .payment_schedule {
        overflow-x: auto;
    }
    
    .payment_schedule table {
        min-width: 600px;
        font-size: 12px;
    }
}

/* ============================================
   TICKETS / SUPPORT
   ============================================ */

/* Tickets list mobile */
@media (max-width: 767px) {
    .ticket_item {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .ticket_header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .ticket_status {
        margin-top: 10px;
    }
}

/* Ticket messages mobile */
@media (max-width: 767px) {
    .ticket_message {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .ticket_message .message_header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .ticket_message .message_date {
        margin-top: 5px;
        font-size: 12px;
    }
}

/* ============================================
   MODALS & POPUPS
   ============================================ */

/* Modal responsive */
@media (max-width: 575px) {
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-content {
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 15px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* ============================================
   BREADCRUMB
   ============================================ */

@media (max-width: 575px) {
    .breadcrumb_section {
        padding: 15px 0;
    }
    
    .page-title h1 {
        font-size: 1.5rem !important;
    }
    
    .breadcrumb {
        font-size: 12px;
        flex-wrap: wrap;
    }
    
    .breadcrumb-item {
        padding: 2px 0;
    }
}

/* ============================================
   FILTERS & SORTING
   ============================================ */

/* Filters mobile */
@media (max-width: 767px) {
    .shop_filters {
        margin-bottom: 20px;
    }
    
    .filter_widgets {
        padding: 15px;
    }
    
    .widget_title {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    /* Collapse filters on mobile */
    .filters_mobile_toggle {
        display: block;
        width: 100%;
        padding: 12px;
        background: #f8f9fa;
        border: 1px solid #ddd;
        border-radius: 5px;
        margin-bottom: 15px;
        cursor: pointer;
    }
    
    .filters_content {
        display: none;
    }
    
    .filters_content.show {
        display: block;
    }
}

/* Sort bar mobile */
@media (max-width: 575px) {
    .shop_toolbar {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .shop_toolbar > div {
        margin-bottom: 10px;
        width: 100%;
    }
    
    .shop_toolbar select {
        width: 100%;
    }
    
    .shorting_icon {
        justify-content: center;
    }
}

/* ============================================
   PAGINATION
   ============================================ */

@media (max-width: 575px) {
    .pagination {
        font-size: 14px;
    }
    
    .pagination .page-link {
        padding: 6px 10px;
        margin: 0 2px;
    }
    
    /* Hide some page numbers on very small screens */
    .pagination .page-item:not(.active):not(.prev):not(.next) {
        display: none;
    }
    
    .pagination .page-item.active,
    .pagination .page-item.prev,
    .pagination .page-item.next {
        display: inline-block;
    }
}

/* ============================================
   FOOTER
   ============================================ */

@media (max-width: 767px) {
    .footer_top {
        padding: 30px 0;
    }
    
    .footer_widgets {
        margin-bottom: 25px;
    }
    
    .widget_title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .footer_bottom {
        padding: 15px 0;
        text-align: center;
    }
    
    .footer_bottom .row > div {
        margin-bottom: 10px;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

/* Spacing utilities mobile */
@media (max-width: 575px) {
    .section {
        padding: 30px 0 !important;
    }
    
    .mb-4 { margin-bottom: 1.5rem !important; }
    .mb-5 { margin-bottom: 2rem !important; }
    .mt-4 { margin-top: 1.5rem !important; }
    .mt-5 { margin-top: 2rem !important; }
    .py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
}

/* Hide/Show utilities */
.mobile-only {
    display: none;
}

@media (max-width: 767px) {
    .mobile-only {
        display: block;
    }
    
    .desktop-only {
        display: none;
    }
}

/* Text alignment mobile */
@media (max-width: 575px) {
    .text-sm-center {
        text-align: center !important;
    }
    
    .text-sm-left {
        text-align: left !important;
    }
    
    .text-sm-right {
        text-align: right !important;
    }
}

/* ============================================
   IMAGES & MEDIA
   ============================================ */

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Video responsive */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================
   PERFORMANCE & ANIMATIONS
   ============================================ */

/* Reduce animations on mobile for performance */
@media (max-width: 767px) {
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
    
    .owl-carousel .owl-item img {
        transform: none !important;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus states */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Touch targets minimum size */
@media (max-width: 767px) {
    a,
    button,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .no-print,
    .header_wrap,
    .footer_wrap,
    .breadcrumb_section,
    .shop_toolbar,
    .pagination {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* ============================================
   TABLET (576px - 991px)
   ============================================ */

@media (min-width: 576px) and (max-width: 991px) {
    .container {
        padding-left: var(--tablet-padding);
        padding-right: var(--tablet-padding);
    }
    
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.75rem !important; }
    h3 { font-size: 1.5rem !important; }
    
    .product_info {
        padding: 15px !important;
    }
}

/* ============================================
   FRONT ANNOUNCEMENT BAR
   ============================================ */

.front-announcement-bar {
    --fab-bg: #111827;
    --fab-color: #ffffff;
    background: var(--fab-bg);
    color: var(--fab-color);
    font-size: 14px;
    line-height: 1.2;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10002;
}

/* Décaler le header quand la bande annonce est présente */
body:has(.front-announcement-bar) .header_wrap.fixed-top {
    top: 52px !important;
}

body:has(.front-announcement-bar) {
    padding-top: 52px;
}

.front-announcement-bar .fab-inner {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 0;
}

.front-announcement-bar .fab-content {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    display: block;
}

.front-announcement-bar a.fab-content:hover {
    text-decoration: underline;
}

.front-announcement-bar .fab-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 6px;
    line-height: 0;
    opacity: 0.9;
}

.front-announcement-bar .fab-close:hover {
    opacity: 1;
}

@media (max-width: 575.98px) {
    .front-announcement-bar {
        font-size: 12px;
    }

    .front-announcement-bar .fab-inner {
        min-height: 32px;
        padding: 6px 0;
    }

    body:has(.front-announcement-bar) .header_wrap.fixed-top {
        top: 44px !important;
    }

    body:has(.front-announcement-bar) {
        padding-top: 44px;
    }
}

/* ============================================
   DESKTOP (>= 992px)
   ============================================ */

@media (min-width: 992px) {
    .container {
        padding-left: var(--desktop-padding);
        padding-right: var(--desktop-padding);
    }
    
    /* Hover effects only on desktop */
    .product:hover .product_img img {
        transform: scale(1.05);
        transition: transform var(--transition-speed);
    }
    
    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        transition: all var(--transition-speed);
    }
}

/* ============================================
   LANDSCAPE ORIENTATION
   ============================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .banner_section .carousel-item {
        height: 200px !important;
    }
}

/* ============================================
   HIGH DPI SCREENS
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize images for retina displays */
    .product_img img,
    .banner_section img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color, #007bff);
    color: #fff;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-hover, #0056b3);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.back-to-top i {
    font-size: 20px;
}

@media (max-width: 767px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* ============================================
   QUANTITY BUTTONS
   ============================================ */

.quantity {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.qty-btn {
    width: 35px;
    height: 35px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #333;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.qty-btn:hover {
    background: #e9ecef;
    border-color: #ccc;
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-minus {
    border-radius: 4px 0 0 4px;
}

.qty-plus {
    border-radius: 0 4px 4px 0;
}

.quantity input[type="number"] {
    width: 60px;
    height: 35px;
    text-align: center;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
    appearance: textfield;
    -moz-appearance: textfield;
    -webkit-appearance: textfield;
}

.quantity input[type="number"]::-webkit-outer-spin-button,
.quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

@media (max-width: 575px) {
    .qty-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .quantity input[type="number"] {
        width: 50px;
        height: 32px;
    }
}

/* ============================================
   SEARCH ENHANCEMENTS
   ============================================ */

.search_form.focused {
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
}

.search-clear {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.search-clear:hover {
    background: #c82333;
    transform: translateY(-50%) scale(1.1);
}

/* ============================================
   STICKY HEADER
   ============================================ */

.header_wrap {
    transition: transform 0.3s ease;
}

.header_wrap.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    background: #fff;
}

/* ============================================
   TOUCH DEVICE ENHANCEMENTS
   ============================================ */

.touch-device .product.touch-active {
    transform: scale(0.98);
    transition: transform 0.2s;
}

.touch-device .product.touch-active .product_action_box {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   LOADING STATES
   ============================================ */

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   SKELETON LOADING (Lazy Load)
   ============================================ */

img[data-src] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   IMPROVED FORM VALIDATION
   ============================================ */

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* ============================================
   CUSTOM SCROLLBAR (Desktop)
   ============================================ */

@media (min-width: 992px) {
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    ::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 5px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

/* ============================================
   SAFE AREA INSETS (iPhone X+)
   ============================================ */

@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    .header_wrap,
    .footer_wrap {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
    
    .back-to-top {
        right: max(30px, calc(30px + env(safe-area-inset-right)));
        bottom: max(30px, calc(30px + env(safe-area-inset-bottom)));
    }
}
