/**
 * 2024 E-DEM
 *
 * E-DEM Mobile Bottom Bar
 * Styles for mobile fixed bottom bar on product pages
 *
 * @author    E-DEM <morgan@e-dem.com>
 * @copyright 2024 E-DEM
 * @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/* Hide by default on desktop */
.edem-mobile-bottom-bar {
  display: none;
}

/* Mobile styles */
@media (max-width: 767px) {
  .edem-mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    padding: 12px 15px;
    z-index: 999; /* Below modals (1050) but above most content */
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    animation: slideUpIn 0.3s ease-out;
  }

  /* Animation for bar appearance */
  @keyframes slideUpIn {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  /* Price Section */
  .edem-mobile-price-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 0 0 auto;
    min-width: 100px;
  }

  .edem-mobile-old-price {
    font-size: 0.85rem;
    color: #999;
    text-decoration: line-through;
    line-height: 1.2;
  }

  .edem-mobile-current-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
    line-height: 1.2;
  }

  .edem-mobile-discount-badge {
    display: inline-block;
    background: #ae0011;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 6px;
    margin-top: 2px;
  }

  /* Action Section */
  .edem-mobile-action-section {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
  }

  /* Adjust for safe areas (iOS notch) */
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    .edem-mobile-bottom-bar {
      padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
  }

  /* Small screens adjustments */
  @media (max-width: 375px) {
    .edem-mobile-bottom-bar {
      padding: 10px 12px;
      gap: 10px;
    }

    .edem-mobile-current-price {
      font-size: 1.2rem;
    }

    .edem-mobile-btn {
      padding: 8px 12px;
      font-size: 0.85rem;
    }

    .edem-mobile-btn i.material-icons {
      font-size: 1rem;
    }
  }

  /* Very small screens */
  @media (max-width: 320px) {
    .edem-mobile-bottom-bar {
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
    }

    .edem-mobile-price-section {
      align-items: center;
    }

    .edem-mobile-action-section {
      justify-content: center;
    }

    .edem-mobile-btn {
      width: 100%;
    }
  }
}

/* Landscape orientation adjustments */
@media (max-width: 767px) and (orientation: landscape) {
  .edem-mobile-bottom-bar {
    padding: 8px 15px;
  }

  .edem-mobile-current-price {
    font-size: 1.1rem;
  }

  .edem-mobile-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    min-height: 40px;
  }
}
