/* ========================================
   PRODUCT PAGE MOBILE OPTIMIZATIONS
   Mobile responsiveness for product.html
   ======================================== */

/* ========== PRODUCT DETAIL SECTION MOBILE ========== */

/* Tablets and below (992px) */
@media (max-width: 992px) {
  .product-detail-section {
    padding: 2rem 1rem;
    margin-top: 72px !important;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }

  .col-md-6,
  .col-lg-6 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  /* Product image gallery */
  .product-image-gallery {
    margin-bottom: 1.5rem;
  }

  .main-product-image {
    height: 350px;
    margin-bottom: 0.875rem;
  }

  .thumbnail-images {
    gap: 0.5rem;
  }

  .thumbnail-image {
    width: 70px;
    height: 70px;
  }

  /* Product info */
  .product-title {
    font-size: 1.625rem;
    margin-bottom: 0.75rem;
  }

  .product-model {
    font-size: 0.95rem;
    margin-bottom: 0.875rem;
  }

  .price-section {
    padding: 1.25rem !important;
    margin-bottom: 1.25rem !important;
  }

  .product-price {
    font-size: 1.875rem;
  }

  .old-price {
    font-size: 1.125rem;
  }

  /* Action buttons */
  .product-actions {
    gap: 0.75rem;
  }

  .btn-add-to-cart,
  .btn-buy-now {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }

  /* Tabs */
  .product-tabs {
    margin-top: 2rem;
  }

  .nav-tabs .nav-link {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
  }

  .tab-content {
    padding: 1.25rem;
  }
}

/* Mobile phones (768px and below) */
@media (max-width: 768px) {
  .product-detail-section {
    padding: 1rem 0.75rem;
    margin-top: 64px !important;
  }

  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  /* Stack product layout vertically */
  .row {
    flex-direction: column;
  }

  .col-md-6,
  .col-lg-6 {
    width: 100%;
    max-width: 100%;
  }

  /* Product image gallery */
  .product-image-gallery {
    margin-bottom: 1.25rem;
  }

  .main-product-image {
    height: 300px;
    border-radius: 12px;
    margin-bottom: 0.75rem;
  }

  .main-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }

  .thumbnail-images {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.25rem 0;
  }

  .thumbnail-images::-webkit-scrollbar {
    display: none;
  }

  .thumbnail-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    scroll-snap-align: start;
  }

  /* Product info */
  .product-info {
    padding: 0 0.25rem;
  }

  .product-title {
    font-size: 1.375rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
  }

  .product-model {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
  }

  .product-badges {
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.875rem;
  }

  .product-badge {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 6px;
  }

  /* Price section */
  .price-section {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    border-radius: 10px;
  }

  .product-price {
    font-size: 1.625rem;
    margin-bottom: 0.5rem;
  }

  .old-price {
    font-size: 1rem;
    margin-bottom: 0.375rem;
  }

  .discount-badge {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
  }

  /* Stock info */
  .stock-info {
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
  }

  /* Action buttons - stack vertically */
  .product-actions {
    flex-direction: column;
    gap: 0.625rem;
    margin-top: 1.25rem;
  }

  .btn-add-to-cart,
  .btn-buy-now,
  .btn-contact {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
    justify-content: center;
  }

  /* Quantity selector */
  .quantity-selector {
    justify-content: center;
    margin-bottom: 0.875rem;
  }

  .quantity-btn {
    width: 40px;
    height: 40px;
    font-size: 1.125rem;
  }

  .quantity-input {
    width: 60px;
    height: 40px;
    font-size: 1rem;
  }

  /* Product tabs */
  .product-tabs {
    margin-top: 1.5rem;
  }

  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    border-bottom: 2px solid var(--border-primary);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tabs .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 0;
  }

  .nav-tabs .nav-link.active {
    border-bottom-color: var(--accent-primary);
    background: transparent;
  }

  .tab-content {
    padding: 1rem 0.5rem;
  }

  .tab-pane h4 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
  }

  .tab-pane p,
  .tab-pane li {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  /* Specifications table */
  .specifications-table {
    font-size: 0.875rem;
  }

  .specifications-table td,
  .specifications-table th {
    padding: 0.625rem 0.75rem;
  }
}

/* Small phones (480px and below) */
@media (max-width: 480px) {
  .product-detail-section {
    padding: 0.875rem 0.5rem;
    margin-top: 56px !important;
  }

  .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  /* Product image */
  .main-product-image {
    height: 250px;
  }

  .thumbnail-image {
    width: 50px;
    height: 50px;
  }

  /* Product info */
  .product-title {
    font-size: 1.1875rem;
  }

  .product-model {
    font-size: 0.8125rem;
  }

  .product-badge {
    padding: 0.3125rem 0.625rem;
    font-size: 0.6875rem;
  }

  /* Price section */
  .price-section {
    padding: 0.875rem !important;
  }

  .product-price {
    font-size: 1.5rem;
  }

  .old-price {
    font-size: 0.9375rem;
  }

  .discount-badge {
    padding: 0.3125rem 0.75rem;
    font-size: 0.75rem;
  }

  /* Action buttons */
  .btn-add-to-cart,
  .btn-buy-now,
  .btn-contact {
    padding: 0.8125rem 1rem;
    font-size: 0.875rem;
  }

  .quantity-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .quantity-input {
    width: 50px;
    height: 36px;
    font-size: 0.9375rem;
  }

  /* Tabs */
  .nav-tabs .nav-link {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }

  .tab-content {
    padding: 0.875rem 0.375rem;
  }

  .specifications-table {
    font-size: 0.8125rem;
  }

  .specifications-table td,
  .specifications-table th {
    padding: 0.5rem 0.625rem;
  }
}

/* ========== PROMO BANNER MOBILE ========== */

@media (max-width: 768px) {
  .promo-banner-small {
    padding: 1.5rem 0.75rem;
    margin: 1.5rem 0;
  }

  .promo-banner-content {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .promo-banner-content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.375rem;
  }

  .promo-banner-content p {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
  }

  .promo-banner-content .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .promo-banner-small {
    padding: 1.25rem 0.5rem;
  }

  .promo-banner-content {
    padding: 1rem;
  }

  .promo-banner-content h3 {
    font-size: 1rem;
  }

  .promo-banner-content p {
    font-size: 0.8125rem;
  }
}

/* ========== SIMILAR PRODUCTS SECTION MOBILE ========== */

@media (max-width: 992px) {
  .similar-products-section {
    padding: 2rem 1rem;
  }

  .section-header {
    margin-bottom: 1.5rem;
  }

  .section-title {
    font-size: 1.625rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }

  .similar-products-slider {
    gap: 1rem;
    padding: 0.5rem 0;
  }
}

@media (max-width: 768px) {
  .similar-products-section {
    padding: 1.5rem 0.75rem;
  }

  .section-header {
    margin-bottom: 1.25rem;
    padding: 0 0.25rem;
  }

  .section-title {
    font-size: 1.375rem;
  }

  .section-subtitle {
    font-size: 0.875rem;
  }

  /* Make slider scrollable horizontally */
  .similar-products-slider {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0.875rem;
    padding: 0.75rem 0.5rem;
    scrollbar-width: thin;
  }

  .similar-products-slider::-webkit-scrollbar {
    height: 4px;
  }

  .similar-products-slider::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
  }

  .similar-products-slider::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-primary-rgb), 0.5);
    border-radius: 2px;
  }

  .similar-product-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
  }

  .similar-product-card .product-image-container {
    height: 180px;
  }

  .similar-product-card h4 {
    font-size: 1rem;
  }

  .similar-product-card .price {
    font-size: 1.125rem;
  }

  .similar-product-card .btn {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  .similar-products-section {
    padding: 1.25rem 0.5rem;
  }

  .section-title {
    font-size: 1.1875rem;
  }

  .similar-products-slider {
    gap: 0.75rem;
    padding: 0.625rem 0.375rem;
  }

  .similar-product-card {
    flex: 0 0 240px;
  }

  .similar-product-card .product-image-container {
    height: 160px;
  }

  .similar-product-card h4 {
    font-size: 0.9375rem;
  }

  .similar-product-card .price {
    font-size: 1.0625rem;
  }
}

/* ========== BREADCRUMB MOBILE ========== */

@media (max-width: 768px) {
  .breadcrumb-container {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .breadcrumb {
    font-size: 0.8125rem;
  }

  .breadcrumb-item {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .breadcrumb-container {
    padding: 0.625rem 0.5rem;
  }

  .breadcrumb {
    font-size: 0.75rem;
  }

  .breadcrumb-item {
    max-width: 80px;
  }
}

/* ========== IMAGE ZOOM MODAL MOBILE ========== */

@media (max-width: 768px) {
  .image-zoom-modal {
    padding: 1rem;
  }

  .image-zoom-container {
    max-width: 100%;
    max-height: 80vh;
  }

  .image-zoom-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
  }
}

/* ========== TOUCH OPTIMIZATIONS ========== */

@media (hover: none) and (pointer: coarse) {
  .btn-add-to-cart,
  .btn-buy-now,
  .btn-contact,
  .quantity-btn,
  .thumbnail-image,
  .nav-tabs .nav-link {
    min-height: 44px;
  }

  /* Remove hover effects */
  .thumbnail-image:hover,
  .btn-add-to-cart:hover,
  .similar-product-card:hover {
    transform: none;
  }

  /* Active states */
  .btn-add-to-cart:active,
  .btn-buy-now:active {
    transform: scale(0.98);
  }

  .quantity-btn:active {
    transform: scale(0.95);
  }

  .thumbnail-image:active {
    opacity: 0.8;
  }
}

/* ========== LANDSCAPE ORIENTATION ========== */

@media (max-width: 768px) and (orientation: landscape) {
  .product-detail-section {
    margin-top: 56px !important;
  }

  .row {
    flex-direction: row;
  }

  .col-md-6,
  .col-lg-6 {
    width: 50%;
    max-width: 50%;
  }

  .main-product-image {
    height: 300px;
  }
}

/* ========== ACCESSIBILITY ========== */

@media (max-width: 768px) {
  .btn-add-to-cart:focus,
  .btn-buy-now:focus,
  .quantity-btn:focus,
  .nav-tabs .nav-link:focus {
    outline: 2px solid rgba(var(--accent-primary-rgb), 0.8);
    outline-offset: 2px;
  }
}

/* ========== PREVENT OVERSCROLL ========== */

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  html {
    -webkit-overflow-scrolling: touch;
  }
}
