/*
Theme Name: Motta Child Theme
Theme URI: http://motta.uix.store/
Author: UIX Themes
Author URI: http://uix.store
Description: A fully responsive Premium WordPress Theme with a pixel perfect design and extensive functionality
Version: 1.0.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: motta
Tags: one-column, two-columns, right-sidebar, custom-colors, custom-menu, featured-images, flexible-header, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready
Template: motta
*/

/* ==========================================================================
   1. WOOCOMMERCE MY ACCOUNT LAYOUT FIX (Desktop - SOLO PARA USUARIOS LOGUEADOS)
   Previene que el contenido principal caiga debajo de la barra lateral.
   USAR .logged-in y selector específico solo dentro de .motta-myaccount__wrapper
   ========================================================================== */
@media (min-width: 768px) {
  /* Contenedor wrapper DT24 Customs */
  .dt24-account-grid-wrapper {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 24px !important;
    width: 100% !important;
  }

  .dt24-account-grid-wrapper > .dt24-custom-navigation {
    flex: 0 0 280px !important;
    width: 280px !important;
    max-width: 280px !important;
    box-sizing: border-box !important;
  }

  .dt24-account-grid-wrapper > main {
    flex: 1 1 0% !important;
    width: calc(100% - 304px) !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

@media (min-width: 992px) {
  body.woocommerce-account.logged-in .site-content > .container > .woocommerce,
  body.woocommerce-account.logged-in .entry-content > .woocommerce {
    display: flex !important;
    align-items: flex-start !important;
    gap: 24px !important;
    float: none !important;
    width: 100% !important;
  }

  body.woocommerce-account.logged-in .site-content > .container > .woocommerce::before,
  body.woocommerce-account.logged-in .site-content > .container > .woocommerce::after,
  body.woocommerce-account.logged-in .entry-content > .woocommerce::before,
  body.woocommerce-account.logged-in .entry-content > .woocommerce::after {
    display: none !important;
  }

  body.woocommerce-account.logged-in .motta-myaccount__wrapper {
    flex: 0 0 280px !important;
    width: 280px !important;
    float: none !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    box-sizing: border-box !important;
  }

  body.woocommerce-account.logged-in .woocommerce-MyAccount-content {
    flex: 1 1 0% !important;
    width: auto !important;
    min-width: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
  }
}

/* ==========================================================================
   2. REGLA ESTRICTA DE COMPATIBILIDAD CON MOTTA MODAL (modal--open)
   Motta usa .modal--open al llamar a motta.openModal()
   ========================================================================== */
.modal.modal--open,
.modal.modal--open.woocommerce,
#motta-popup-add-to-cart.modal--open,
.motta-popup-add-to-cart-modal.modal--open {
  display: flex !important;
}

/* ==========================================================================
   3. UNSET MIN-WIDTH ON ORDERS TABLE BUTTONS (Evita botones gigantes)
   ========================================================================== */
.woocommerce-account .woocommerce-orders-table .button,
.woocommerce-account .woocommerce-orders-table a.button,
.woocommerce-account .woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions a,
.woocommerce-account .woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions .button {
  min-width: unset !important;
  max-width: unset !important;
  width: auto !important;
  padding: 8px 20px !important;
  height: auto !important;
  line-height: 1.4 !important;
  font-size: 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  border-radius: 8px !important;
}

/* ==========================================================================
   4. UNSET MOTTA STYLES FOR DT24 WIDGETS & MODALS
   ========================================================================== */
#dt24-global-delivery-bar,
#dt24-global-delivery-bar * {
  box-sizing: border-box !important;
}

#dt24-global-delivery-bar button,
#dt24-global-delivery-bar a.button,
#dt24-global-delivery-bar .button {
  min-width: unset !important;
  max-width: unset !important;
  box-shadow: none !important;
}

.dt24-delivery-modal-portal button,
.dt24-delivery-modal-portal a.button,
.dt24-delivery-modal-portal .button {
  min-width: unset !important;
  max-width: unset !important;
}
