/* 响应式设计样式 */
/* 移动端适配 */

/* 通用响应式设置 */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }
}

@media (max-width: 992px) {
  .container {
    max-width: 720px;
  }
}

@media (max-width: 768px) {
  .container {
    max-width: 540px;
  }
}

@media (max-width: 576px) {
  .container {
    max-width: 100%;
    padding: 0 15px;
  }
}

/* 头部响应式 */
@media (max-width: 768px) {
  .header {
    padding: 10px 0;
  }

  .header__logo {
    max-width: 120px;
  }

  .header__nav {
    display: none;
  }

  .header__mobile-menu {
    display: block;
  }

  .header__actions {
    gap: 10px;
  }

  .header__action {
    padding: 8px;
    font-size: 0.9rem;
  }
}

/* 首页响应式 */
@media (max-width: 768px) {
  .hero__slide-content {
    flex-direction: column;
    text-align: center;
  }

  .hero__slide-text {
    order: 2;
    margin-top: 20px;
  }

  .hero__slide-image {
    order: 1;
  }

  .hero__slide-title {
    font-size: 1.8rem;
  }

  .hero__slide-description {
    font-size: 1rem;
  }

  .categories__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .featured-products__header,
  .new-arrivals__header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .features__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .newsletter__form-group {
    flex-direction: column;
    gap: 15px;
  }

  .newsletter__input,
  .newsletter__button {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .categories__grid {
    grid-template-columns: 1fr;
  }

  .features__grid {
    grid-template-columns: 1fr;
  }

  .hero__slide-title {
    font-size: 1.5rem;
  }
}

/* 商品列表页响应式 */
@media (max-width: 992px) {
  .shop__content {
    flex-direction: column;
  }

  .shop__sidebar {
    width: 100%;
    margin-bottom: 30px;
  }

  .shop__main {
    width: 100%;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-filters {
    flex-direction: column;
    gap: 15px;
  }

  .filter-group {
    width: 100%;
  }

  .view-toggle {
    justify-content: center;
  }

  .pagination {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* 商品详情页样式 */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.product-gallery__main {
  position: relative;
  background: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  width: 100%;
  box-sizing: border-box;
  padding: 20px;
}

.product-gallery__main img {
  width: auto;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.3s ease;
  display: block;
}

.product-gallery__main img:hover {
  transform: scale(1.02);
}

.product-gallery__thumbnails {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.product-thumbnail {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.product-thumbnail:hover {
  border-color: #3C2807;
  transform: translateY(-2px);
}

.product-thumbnail.active {
  border-color: #3C2807;
  box-shadow: 0 4px 12px rgba(60, 40, 7, 0.2);
}

.product-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-thumbnail:hover img {
  transform: scale(1.05);
}

/* 商品详情页响应式 */
@media (max-width: 992px) {
  .product-detail__content {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-direction: column;
  }

  .product-gallery {
    width: 100%;
    margin-bottom: 30px;
  }

  .product-info {
    width: 100%;
  }

  .product-gallery__main {
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    padding: 15px;
    box-sizing: border-box;
  }

  .product-gallery__main img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    display: block;
  }

  .product-gallery__thumbnails {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .product-options {
    flex-direction: column;
    gap: 15px;
  }

  .product-actions {
    flex-direction: column;
    gap: 15px;
  }

  .product-actions .btn {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .product-gallery__main {
    height: 300px;
    margin-bottom: 12px;
    padding: 12px;
  }

  .product-gallery__main img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
  }

  .product-gallery__thumbnails {
    gap: 8px;
    padding: 8px 0;
  }

  .product-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 6px;
  }

  .product-title {
    font-size: 1.5rem;
  }
}

/* 超小屏幕优化 (320px - 480px) */
@media (max-width: 480px) {
  .product-gallery__main {
    height: 280px;
    margin-bottom: 10px;
    padding: 10px;
  }

  .product-gallery__main img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
  }

  .product-gallery__thumbnails {
    gap: 6px;
    padding: 6px 0;
  }

  .product-thumbnail {
    width: 45px;
    height: 45px;
    border-radius: 4px;
  }

  .product-price {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}

/* 移动端商品卡片操作按钮优化 */
@media (max-width: 768px) {
  .product-card__actions {
    opacity: 1 !important;
    transform: translateX(0) !important;
    position: absolute;
    top: 8px;
    left: 8px;
    gap: 6px;
  }

  .product-card__action {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .product-card__action svg {
    width: 16px;
    height: 16px;
  }

  /* 确保按钮在移动端可点击 */
  .product-card__action--wishlist {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

/* 购物车页面响应式 */
@media (max-width: 768px) {
  .cart-content {
    flex-direction: column;
  }

  .cart-items {
    width: 100%;
    margin-bottom: 30px;
  }

  .cart-summary {
    width: 100%;
  }

  .cart-item {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .cart-item__image {
    width: 100px;
    height: 100px;
    margin: 0 auto;
  }

  .cart-item__details {
    width: 100%;
  }

  .cart-item__actions {
    justify-content: center;
    gap: 10px;
  }

  .quantity-selector {
    justify-content: center;
  }
}

/* 结账页面响应式 */
@media (max-width: 992px) {
  .checkout__content {
    flex-direction: column;
  }

  .checkout__form {
    width: 100%;
    margin-bottom: 30px;
  }

  .checkout__summary {
    width: 100%;
  }

  .form-row {
    flex-direction: column;
    gap: 15px;
  }

  .form-group {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .checkout-form {
    padding: 20px;
  }

  .form-section {
    padding: 20px;
  }

  .form-section__title {
    font-size: 1.3rem;
  }

  .place-order-btn {
    width: 100%;
  }
}

/* 心愿单页面响应式 */
@media (max-width: 768px) {
  .wishlist-content {
    flex-direction: column;
  }

  .wishlist-items {
    width: 100%;
    margin-bottom: 30px;
  }

  .wishlist-summary {
    width: 100%;
  }

  .wishlist-item {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .wishlist-item__image {
    width: 100px;
    height: 100px;
    margin: 0 auto;
  }

  .wishlist-item__details {
    width: 100%;
  }

  .wishlist-item__actions {
    justify-content: center;
    gap: 10px;
  }
}

/* 登录页面响应式 */
@media (max-width: 768px) {
  .auth-container {
    padding: 20px;
  }

  .auth-tabs {
    flex-direction: column;
    gap: 10px;
  }

  .auth-tab {
    width: 100%;
    text-align: center;
  }

  .auth-form {
    padding: 20px;
  }

  .form-group {
    margin-bottom: 20px;
  }

  .auth-actions {
    flex-direction: column;
    gap: 15px;
  }

  .auth-actions .btn {
    width: 100%;
  }
}

/* 订单确认页面响应式 */
@media (max-width: 768px) {
  .confirmation-card {
    padding: 30px 20px;
    margin: 20px;
  }

  .confirmation-title {
    font-size: 2rem;
  }

  .action-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

/* 商品卡片响应式 */
@media (max-width: 768px) {
  .product-card {
    padding: 15px;
  }

  .product-card__title {
    font-size: 1rem;
  }

  .product-card__price {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .product-card__buttons {
    flex-direction: column;
    gap: 10px;
  }

  .product-card__buttons .btn {
    width: 100%;
  }
}

/* 通知消息响应式 */
@media (max-width: 576px) {
  .notification {
    left: 10px;
    right: 10px;
    width: auto;
  }

  .notification__content {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
}

/* 页脚响应式 */
@media (max-width: 768px) {
  .footer__content {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
}

@media (max-width: 576px) {
  .footer__content {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* 面包屑导航响应式 */
@media (max-width: 576px) {
  .breadcrumb {
    flex-wrap: wrap;
    gap: 5px;
  }

  .breadcrumb-separator {
    display: none;
  }
}

/* 搜索框响应式 */
@media (max-width: 576px) {
  .search-input {
    width: 100%;
    margin-bottom: 10px;
  }

  .search-button {
    width: 100%;
  }
}

/* 按钮组响应式 */
@media (max-width: 576px) {
  .btn-group {
    flex-direction: column;
    gap: 10px;
  }

  .btn-group .btn {
    width: 100%;
  }
}

/* 表格响应式 */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
  }

  .table {
    min-width: 600px;
  }
}

/* 模态框响应式 */
@media (max-width: 576px) {
  .modal {
    margin: 10px;
    width: auto;
  }

  .modal__content {
    padding: 20px;
  }

  .modal__header {
    padding: 15px 20px;
  }

  .modal__body {
    padding: 20px;
  }

  .modal__footer {
    padding: 15px 20px;
    flex-direction: column;
    gap: 10px;
  }
}

/* 加载状态响应式 */
@media (max-width: 576px) {
  .loading-spinner {
    width: 40px;
    height: 40px;
  }

  .loading-text {
    font-size: 1rem;
  }
}

/* 错误页面响应式 */
@media (max-width: 576px) {
  .error-page {
    padding: 40px 20px;
  }

  .error-page__title {
    font-size: 2rem;
  }

  .error-page__message {
    font-size: 1rem;
  }
}

/* 工具提示响应式 */
@media (max-width: 768px) {
  .tooltip {
    display: none;
  }
}

/* 滚动条响应式 */
@media (max-width: 768px) {
  ::-webkit-scrollbar {
    width: 6px;
  }

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

  ::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
  }

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

/* 打印样式 */
@media print {

  .header,
  .footer,
  .sidebar,
  .btn,
  .modal,
  .notification {
    display: none !important;
  }

  .main {
    margin: 0 !important;
    padding: 0 !important;
  }

  .container {
    max-width: none !important;
    width: 100% !important;
  }
}

/* ===== 移动端Swiper导航按钮优化 ===== */
@media (max-width: 768px) {

  /* 增大移动端Swiper导航按钮 */
  .swiper-button-next,
  .swiper-button-prev {
    width: 44px !important;
    height: 44px !important;
    background-size: 24px 24px !important;
  }

  .swiper-button-next::after,
  .swiper-button-prev::after {
    font-size: 18px !important;
    font-weight: bold !important;
  }

  /* 首页hero section的导航按钮 */
  .hero__swiper-button {
    width: 48px !important;
    height: 48px !important;
    background-size: 28px 28px !important;
  }

  .hero__swiper-button::after {
    font-size: 20px !important;
  }

  /* 商品区域的导航按钮 */
  .featured-products-swiper-button,
  .new-arrivals-swiper-button {
    width: 44px !important;
    height: 44px !important;
    background-size: 24px 24px !important;
  }

  .featured-products-swiper-button::after,
  .new-arrivals-swiper-button::after {
    font-size: 18px !important;
  }
}

@media (max-width: 480px) {

  /* 小屏幕设备进一步优化 */
  .swiper-button-next,
  .swiper-button-prev {
    width: 40px !important;
    height: 40px !important;
    background-size: 22px 22px !important;
  }

  .swiper-button-next::after,
  .swiper-button-prev::after {
    font-size: 16px !important;
  }

  .hero__swiper-button {
    width: 44px !important;
    height: 44px !important;
    background-size: 26px 26px !important;
  }

  .hero__swiper-button::after {
    font-size: 18px !important;
  }

  .featured-products-swiper-button,
  .new-arrivals-swiper-button {
    width: 40px !important;
    height: 40px !important;
    background-size: 22px 22px !important;
  }

  .featured-products-swiper-button::after,
  .new-arrivals-swiper-button::after {
    font-size: 16px !important;
  }
}