/* ============================================
   PAGES FIX — Cart, Notre Histoire, Contact
   Mobile-first responsive
   ============================================ */

/* CRITICAL: Force body visible (Shoptimizer preloader) */
body.woocommerce-cart, body.woocommerce-cart #page,
body.woocommerce-checkout, body.woocommerce-checkout #page {
  display: block !important;
}

/* ===== GLOBAL: Edge to edge ===== */
@media(max-width:767px) {
  .page-id-28172 .col-full,
  .page-id-28156 .col-full,
  .page-id-28157 .col-full,
  .woocommerce-cart .col-full,
  .woocommerce-checkout .col-full {
    padding: 0 !important;
  }
  .page-id-28172 .content-area,
  .page-id-28156 .content-area,
  .page-id-28157 .content-area,
  .woocommerce-cart .content-area,
  .woocommerce-checkout .content-area,
  .page-id-28172 #primary,
  .page-id-28156 #primary,
  .page-id-28157 #primary {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }
  .page-id-28172 .entry-header, .page-id-28172 h1.entry-title,
  .woocommerce-cart .entry-header,
  .page-id-28157 .entry-header, .page-id-28157 h1.entry-title {
    display: none !important;
  }
}

/* ===== CART PAGE — Clean & Simple ===== */
@media(max-width:767px) {
  .woocommerce-cart .entry-content { padding: 0 12px !important; }

  /* Hide step bar 1-2-3, shipping progress */
  .checkout-wrap, .checkout-bar { display: none !important; }
  .cc-shipping-progress { display: none !important; }
  .shoptimizer-cart-wrapper { padding: 0 !important; }

  /* Let Shoptimizer responsive table work — just clean up */
  .woocommerce table.shop_table { border: none !important; }
  .woocommerce table.shop_table thead { display: none !important; }
  .woocommerce table.shop_table td { border: none !important; border-bottom: 1px solid #f0ebe5 !important; }

  /* Hide: unit price, quantity, actions row */
  .woocommerce table.shop_table .product-price { display: none !important; }
  .woocommerce table.shop_table .product-quantity { display: none !important; }
  .woocommerce table.shop_table td.actions { display: none !important; }

  /* Hide "Sous-total:" label on subtotal cells */
  .woocommerce table.shop_table .product-subtotal::before { display: none !important; }

  /* Product name — show full text */
  .woocommerce table.shop_table .product-name { font-size: 14px !important; font-family: 'DM Sans', sans-serif !important; }
  .woocommerce table.shop_table .product-name::before { display: none !important; }
  .woocommerce table.shop_table .product-name a { color: #2C2421 !important; text-decoration: none !important; font-weight: 500 !important; }
  .woocommerce table.shop_table .product-name dl.variation { margin: 4px 0 0 !important; }
  .woocommerce table.shop_table .product-name dl.variation dt,
  .woocommerce table.shop_table .product-name dl.variation dd { display: inline !important; font-size: 12px !important; color: #8B7E74 !important; margin: 0 !important; }
  .woocommerce table.shop_table .product-name dl.variation dd p { margin: 0 !important; display: inline !important; }

  /* Subtotal — bold price */
  .woocommerce table.shop_table .product-subtotal { font-size: 15px !important; font-weight: 600 !important; color: #2C2421 !important; text-align: right !important; }

  /* Thumbnail */
  .woocommerce table.shop_table .product-thumbnail img { border-radius: 6px !important; object-fit: cover !important; }

  /* Remove button — subtle */
  .woocommerce table.shop_table .product-remove a { color: #ccc !important; font-size: 16px !important; }
  .woocommerce table.shop_table .product-remove::before { display: none !important; }

  /* Cart totals */
  .woocommerce .cart-collaterals { width: 100% !important; float: none !important; padding: 0 14px !important; box-sizing: border-box !important; }
  .woocommerce .cart_totals {
    width: 100% !important; float: none !important; padding: 0 !important; margin-top: 0 !important;
  }
  .woocommerce .cart_totals h2 { display: none !important; }
  .woocommerce .cart_totals table {
    width: 100% !important; border: none !important; font-family: 'DM Sans', sans-serif !important;
  }
  .woocommerce .cart_totals table th,
  .woocommerce .cart_totals table td {
    padding: 10px 0 !important; border: none !important;
    border-bottom: 1px solid #f0ebe5 !important; font-size: 14px !important;
  }
  .woocommerce .cart_totals table th {
    color: #8B7E74 !important; font-weight: 400 !important; font-size: 13px !important;
  }
  .woocommerce .cart_totals table td { text-align: right !important; }

  /* Hide "Forfait", calculator, shipping note */
  .woocommerce .cart_totals .shipping #shipping_method li:not(:first-child) { display: none !important; }
  .woocommerce .cart_totals .shipping .woocommerce-shipping-calculator { display: none !important; }
  .woocommerce .cart_totals .shipping td > p { display: none !important; }
  /* Hide [Enlever] link on coupon row */
  .woocommerce .cart_totals .cart-discount td a { display: none !important; }

  /* Total row — big and bold */
  .woocommerce .cart_totals .order-total td {
    font-size: 26px !important; font-weight: 700 !important; color: #2C2421 !important;
  }
  .woocommerce .cart_totals .order-total th {
    font-size: 14px !important; font-weight: 600 !important; color: #2C2421 !important;
    vertical-align: middle !important;
  }

  /* Checkout button */
  .wc-proceed-to-checkout { padding: 0 !important; margin-top: 14px !important; }
  .wc-proceed-to-checkout .checkout-button, .wc-proceed-to-checkout a {
    display: block !important; width: 100% !important;
    background: #2C2421 !important; color: #FDFBF9 !important;
    padding: 16px !important; border-radius: 6px !important;
    font-size: 14px !important; font-weight: 600 !important; letter-spacing: 2px !important;
    text-transform: uppercase !important; text-align: center !important;
    text-decoration: none !important; font-family: 'DM Sans', sans-serif !important;
    border: none !important; box-sizing: border-box !important;
  }

  /* Savings banner — compact */
  .cc-cart-savings {
    background: #2C2421 !important; border: none !important;
    border-radius: 8px !important; padding: 10px 14px !important;
    margin: 10px 0 !important; text-align: center !important;
  }
  .cc-cart-savings .label { color: #C4A882 !important; font-size: 10px !important; }
  .cc-cart-savings .amount { color: #FDFBF9 !important; font-size: 16px !important; }

  /* Reassurance */
  .cc-cart-reassurance { padding: 12px 0 16px !important; text-align: center !important; }

  /* WC notices */
  .woocommerce-message, .woocommerce-info {
    font-size: 12px !important; padding: 8px 12px !important;
    border-radius: 6px !important; margin: 6px 0 !important;
  }

  /* Express payment buttons spacing */
  #wc-stripe-express-checkout-element { margin-top: 10px !important; }
}

/* ===== NOTRE HISTOIRE PAGE ===== */
@media(max-width:767px) {
  /* NUCLEAR: kill ALL grids and force block on EVERY element */
  .page-id-28156 .entry-content *:not(.kh-grid2-cards) {
    display: block !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    float: none !important;
  }
  /* Only the top wrapper gets padding */
  .page-id-28156 .entry-content > div {
    padding: 0 16px !important;
  }
  /* Kill ALL inner padding/margin that stacks */
  .page-id-28156 .entry-content section,
  .page-id-28156 .entry-content > div > div,
  .page-id-28156 .entry-content > div div,
  .page-id-28156 .entry-content > div section {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }
  /* Value cards grid — keep as 2 columns */
  .page-id-28156 .entry-content .kh-grid2-cards {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  html.page-id-28156, body.page-id-28156 { overflow-x: hidden !important; width: 100% !important; }
  .page-id-28156 .cc-an { overflow: hidden !important; }
  .page-id-28156 .cc-an-t { overflow: hidden !important; max-width: 100vw !important; }
  .page-id-28156 #page, .page-id-28156 #content, .page-id-28156 .col-full { overflow-x: hidden !important; }
  .page-id-28156 .entry-content { font-family: 'DM Sans', sans-serif !important; }
  /* Center all text sections */
  .page-id-28156 .entry-content section,
  .page-id-28156 .entry-content > div > section,
  .page-id-28156 .entry-content > div > div,
  .page-id-28156 .entry-content p,
  .page-id-28156 .entry-content h1,
  .page-id-28156 .entry-content h2,
  .page-id-28156 .entry-content h3,
  .page-id-28156 .entry-content span,
  .page-id-28156 .entry-content li {
    text-align: center !important;
  }
  .page-id-28156 .entry-content ul {
    list-style-position: inside !important;
    padding-left: 0 !important;
    text-align: center !important;
  }

  /* Images full width */
  .page-id-28156 .entry-content img {
    width: 100% !important; height: auto !important; border-radius: 0 !important; margin: 0 !important;
  }

  /* Typography */
  .page-id-28156 .entry-content h1 { font-size: 28px !important; line-height: 1.2 !important; }
  .page-id-28156 .entry-content h2 { font-size: 22px !important; line-height: 1.3 !important; }
  .page-id-28156 .entry-content h3 { font-size: 16px !important; }
  .page-id-28156 .entry-content p {
    font-size: 15px !important; line-height: 1.7 !important; color: #4A4440 !important;
    max-width: 100% !important;
  }

  /* Grids → stack on mobile */
  .page-id-28156 .entry-content .kh-grid2,
  .page-id-28156 .entry-content .kh-grid2-cards {
    grid-template-columns: 1fr !important;
  }

  /* Dark sections full bleed */
  .page-id-28156 .entry-content [style*="background:#2C2421"],
  .page-id-28156 .entry-content [style*="background: #2C2421"],
  .page-id-28156 .entry-content div[style*="background:linear-gradient"] {
    margin-left: -16px !important; margin-right: -16px !important;
    padding: 30px 20px !important; border-radius: 0 !important;
    width: calc(100% + 32px) !important;
  }

  /* Cards inside sections — remove extra padding */
  .page-id-28156 .entry-content [style*="border-radius:12px"],
  .page-id-28156 .entry-content [style*="border-radius: 12px"] {
    border-radius: 0 !important;
    margin-left: -16px !important; margin-right: -16px !important;
    width: calc(100% + 32px) !important;
    padding: 24px 20px !important;
  }
}

/* ===== CONTACT PAGE ===== */
@media(max-width:767px) {
  .page-id-28157 .entry-content {
    padding: 0 14px !important; font-family: 'DM Sans', sans-serif !important;
  }
  .page-id-28157 .entry-content h1,
  .page-id-28157 .entry-content h2 {
    font-size: 22px !important; text-align: center !important; margin-bottom: 8px !important;
  }
  .page-id-28157 .entry-content > p {
    text-align: center !important; font-size: 14px !important; color: #8B7E74 !important;
  }
  .page-id-28157 .entry-content .wp-block-columns,
  .page-id-28157 .entry-content [style*="display:grid"],
  .page-id-28157 .entry-content [style*="display: grid"],
  .page-id-28157 .entry-content [style*="display:flex"],
  .page-id-28157 .entry-content [style*="display: flex"] {
    display: flex !important; flex-direction: column !important; gap: 10px !important;
  }
  .page-id-28157 .entry-content .wp-block-column,
  .page-id-28157 .entry-content [style*="background:#F5EDE6"],
  .page-id-28157 .entry-content [style*="background: #F5EDE6"],
  .page-id-28157 .entry-content [style*="background:#FDFBF9"],
  .page-id-28157 .entry-content [style*="background: #FDFBF9"] {
    width: 100% !important; flex: none !important;
    border-radius: 10px !important; padding: 20px !important;
    text-align: center !important; box-sizing: border-box !important;
  }
  /* Contact card icons — small */
  .page-id-28157 .entry-content img {
    width: 48px !important; height: 48px !important;
    margin: 0 auto 8px !important; display: block !important;
    border-radius: 0 !important;
  }
  .page-id-28157 .entry-content input,
  .page-id-28157 .entry-content textarea {
    width: 100% !important; padding: 12px !important;
    border: 1px solid #C4B5A8 !important; border-radius: 6px !important;
    font-size: 14px !important; font-family: 'DM Sans', sans-serif !important;
    box-sizing: border-box !important; margin-bottom: 8px !important;
  }
  .page-id-28157 .entry-content button[type="submit"],
  .page-id-28157 .entry-content input[type="submit"] {
    width: 100% !important; background: #2C2421 !important; color: #FDFBF9 !important;
    padding: 14px !important; border: none !important; border-radius: 6px !important;
    font-size: 13px !important; letter-spacing: 1.5px !important;
    text-transform: uppercase !important; font-family: 'DM Sans', sans-serif !important;
  }
  .page-id-28157 .entry-content img {
    width: 100% !important; height: auto !important; border-radius: 8px !important;
  }
}
