/* Mobile overrides for the compiled Vue storefront. */

html,
body {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
}

@media (max-width: 768px) {
  .container {
    width: 100%;
    max-width: 100%;
    padding-right: 16px;
    padding-left: 16px;
  }

  .header-inner {
    min-width: 0;
    height: 54px !important;
  }

  .page-title {
    overflow: hidden;
    font-size: 17px !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .placeholder {
    width: 52px !important;
    flex: 0 0 52px;
  }

  .back-btn,
  .nav-link {
    min-height: 44px;
  }

  /* Product detail */
  .product-detail-page {
    padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important;
  }

  .product-detail-page .logo {
    font-size: 18px;
  }

  .product-detail-page .main {
    padding-top: 12px;
  }

  .product-detail-page .product-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 16px;
    border-radius: 10px;
  }

  .product-detail-page .product-images {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .product-detail-page .main-image {
    width: 100%;
    height: auto;
    margin-bottom: 12px;
    aspect-ratio: 1 / 1;
  }

  .product-detail-page .image-thumbs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .product-detail-page .thumb-item {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .product-detail-page .product-info {
    min-width: 0;
  }

  .product-detail-page .product-name {
    font-size: 21px;
    line-height: 1.35;
  }

  .product-detail-page .product-subtitle {
    margin-bottom: 14px;
    line-height: 1.6;
  }

  .product-detail-page .price-section {
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 12px;
  }

  .product-detail-page .price-section .price {
    font-size: 29px;
  }

  .product-detail-page .sales-info {
    gap: 18px;
    margin-bottom: 18px;
    padding-bottom: 18px;
  }

  .product-detail-page .product-desc,
  .product-detail-page .product-specs {
    margin-bottom: 20px;
  }

  .product-detail-page .specs-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .product-detail-page .spec-item {
    min-width: 0;
    line-height: 1.55;
  }

  .product-detail-page .spec-label {
    width: 76px;
  }

  .product-detail-page .spec-value {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .product-detail-page .service-tags {
    gap: 10px 14px;
    padding-top: 18px;
  }

  /* Fixed bottom bars */
  .bottom-bar {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-inner {
    height: auto !important;
    min-height: 68px;
    gap: 12px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .bottom-price,
  .bottom-total {
    min-width: 0;
  }

  .bottom-price .label,
  .bottom-total .label {
    display: block;
    margin: 0 0 2px !important;
    font-size: 12px !important;
  }

  .bottom-price .price,
  .bottom-total .price {
    font-size: 21px !important;
  }

  .btn-buy,
  .btn-submit {
    min-width: 138px;
    min-height: 46px;
    padding: 12px 24px !important;
    border-radius: 10px !important;
    white-space: nowrap;
  }

  /* Order confirmation */
  .order-confirm-page {
    padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important;
  }

  .order-confirm-page .main {
    padding-top: 12px;
  }

  .order-confirm-page .card {
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .order-confirm-page .card-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .order-confirm-page .form-row {
    display: block;
  }

  .order-confirm-page .region-selects {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .order-confirm-page .form-input,
  .order-confirm-page .form-select,
  .order-confirm-page .form-textarea {
    min-height: 46px;
    font-size: 16px;
  }

  .order-confirm-page .product-item {
    gap: 12px;
  }

  .order-confirm-page .product-image {
    width: 84px;
    height: 84px;
  }

  .order-confirm-page .product-detail {
    min-width: 0;
  }

  .order-confirm-page .product-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  /* Payment page */
  .order-pay-page .main {
    width: 100%;
    max-width: none;
    padding-top: 12px;
  }

  .order-pay-page .pay-card {
    padding: 16px;
    border-radius: 10px;
  }

  .order-pay-page .order-info {
    margin-bottom: 22px;
    padding-bottom: 18px;
  }

  .order-pay-page .info-row {
    gap: 14px;
  }

  .order-pay-page .info-row .label {
    flex: 0 0 auto;
  }

  .order-pay-page .info-row .value,
  .order-pay-page .info-row .price {
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .order-pay-page .pay-methods {
    margin-bottom: 22px;
  }

  .order-pay-page .method-item {
    gap: 12px;
    min-height: 72px;
    padding: 12px;
  }

  .order-pay-page .method-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .order-pay-page .method-info {
    min-width: 0;
  }

  .order-pay-page .pay-action {
    margin-bottom: 16px;
  }

  .order-pay-page .btn-pay {
    min-height: 50px;
    padding: 14px;
    font-size: 17px;
  }

  .order-pay-page .pay-tips {
    padding: 13px;
  }

  /* Payment result */
  .order-result-page .main {
    width: 100%;
    max-width: none;
    padding-top: 12px;
  }

  .order-result-page .result-card {
    padding: 18px 16px;
    border-radius: 10px;
  }

  .order-result-page .status-section {
    margin-bottom: 20px;
    padding: 28px 0;
  }

  .order-result-page .status-text {
    font-size: 22px;
  }

  .order-result-page .order-info {
    margin-bottom: 22px;
  }

  .order-result-page .info-row {
    gap: 16px;
  }

  .order-result-page .info-row .value {
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .order-result-page .actions {
    gap: 10px;
  }

  .order-result-page .actions a {
    min-height: 46px;
    padding: 12px 10px;
  }

  /* Order list */
  .order-list-page .main {
    width: 100%;
    max-width: none;
    padding-top: 12px;
  }

  .order-list-page .order-card {
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .order-list-page .order-header {
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .order-list-page .order-no {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .order-list-page .status-tag {
    flex: 0 0 auto;
  }

  .order-list-page .order-content {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
  }

  .order-list-page .product-image {
    width: 72px;
    height: 72px;
  }

  .order-list-page .product-info {
    min-width: 0;
  }

  .order-list-page .product-name {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .order-list-page .order-amount {
    flex: 0 0 auto;
  }

  .order-list-page .order-amount .price {
    font-size: 16px;
  }

  .order-list-page .order-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding-top: 12px;
  }

  .order-list-page .order-actions {
    justify-content: flex-end;
  }

  .order-list-page .order-actions button {
    min-height: 40px;
  }

  /* Order detail */
  .order-detail-page .main {
    width: 100%;
    max-width: none;
    padding-top: 12px;
  }

  .order-detail-page .status-section,
  .order-detail-page .card {
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .order-detail-page .status-section {
    gap: 12px;
  }

  .order-detail-page .status-text {
    font-size: 18px;
  }

  .order-detail-page .product-item {
    gap: 12px;
  }

  .order-detail-page .product-image {
    width: 84px;
    height: 84px;
  }

  .order-detail-page .product-detail {
    min-width: 0;
  }

  .order-detail-page .product-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .order-detail-page .info-row,
  .order-detail-page .fee-item,
  .order-detail-page .fee-total {
    gap: 16px;
  }

  .order-detail-page .info-row .value,
  .order-detail-page .fee-item > :last-child,
  .order-detail-page .fee-total > :last-child {
    min-width: 0;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .order-detail-page .actions {
    gap: 10px;
    margin-top: 16px;
  }

  .order-detail-page .actions button {
    min-height: 48px;
    padding: 12px 8px;
  }
}

@media (max-width: 360px) {
  .container {
    padding-right: 12px;
    padding-left: 12px;
  }

  .product-detail-page .product-card,
  .order-confirm-page .card,
  .order-pay-page .pay-card,
  .order-result-page .result-card,
  .order-list-page .order-card,
  .order-detail-page .status-section,
  .order-detail-page .card {
    padding: 14px;
  }

  .btn-buy,
  .btn-submit {
    min-width: 122px;
    padding-right: 18px !important;
    padding-left: 18px !important;
  }

  .order-pay-page .method-desc {
    font-size: 11px;
  }

  .order-result-page .actions,
  .order-detail-page .actions {
    flex-direction: column;
  }
}
