/* ====================================
   RUNNER - MOBILE RESPONSIVE STYLES
   Comprehensive Mobile Optimization
   ==================================== */

/* ========== TABLET & MOBILE (768px and below) ========== */
@media (max-width: 768px) {
  
  /* ----- GLOBAL MOBILE SETTINGS ----- */
  * {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
  }
  
  html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
  }
  
  body {
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
  }
  
  .container {
    padding: 0 15px;
    max-width: 100%;
  }
  
  /* ----- MOBILE HEADER ----- */
  .header {
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 999;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  }
  
  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  /* Hamburger on left */
  .mobile-menu-toggle {
    order: -1;
    margin-right: 12px;
  }
  
  .logo {
    flex: 1;
  }
  
  .logo h1 {
    font-size: 18px !important;
    margin: 0;
  }
  
  .logo a {
    color: white !important;
  }
  
  /* Mobile Header Actions (Cart + Menu) */
  .mobile-header-actions {
    display: flex !important; /* Show on mobile */
    align-items: center;
    gap: 15px;
  }
  
  .mobile-cart-btn {
    color: white;
    font-size: 20px;
    position: relative;
    padding: 5px;
  }
  
  .mobile-cart-btn .cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #ff6b6b;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
  }
  
  /* Mobile menu styles are now in header.php */
  
  /* Cart Badge */
  .cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    font-size: 10px;
    line-height: 18px;
  }
  
  .user-dropdown {
    width: 100%;
  }
  
  .user-button {
    width: 100%;
    justify-content: flex-start;
    padding: 16px 20px !important;
    color: white !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
    font-size: 16px !important;
  }
  
  .user-menu {
    position: static !important;
    box-shadow: none !important;
    background: rgba(0,0,0,0.15) !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: none;
  }
  
  .user-menu.show {
    display: block !important;
  }
  
  .user-menu a {
    padding: 14px 20px 14px 50px !important;
    color: rgba(255,255,255,0.9) !important;
    font-size: 14px !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  }
  
  .nav .btn-login,
  .nav .btn-register {
    display: block !important;
    width: calc(100% - 40px) !important;
    margin: 15px 20px !important;
    text-align: center !important;
    padding: 14px 20px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
  }
  
  .nav .btn-login {
    background: rgba(255,255,255,0.2) !important;
    color: white !important;
    border: 2px solid rgba(255,255,255,0.5) !important;
  }
  
  .nav .btn-register {
    background: white !important;
    color: #667eea !important;
  }
  
  /* ----- HERO SECTION MOBILE ----- */
  .hero {
    padding: 40px 0 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  }
  
  .hero-content {
    text-align: center;
  }
  
  .hero-content h1 {
    font-size: 24px !important;
    line-height: 1.3 !important;
    margin-bottom: 15px !important;
  }
  
  .hero-content p {
    font-size: 14px !important;
    margin-bottom: 20px !important;
  }
  
  .hero .btn-lg {
    display: inline-block;
    padding: 12px 30px !important;
    font-size: 14px !important;
  }
  
  /* ----- SECTIONS MOBILE ----- */
  section {
    padding: 30px 0 !important;
  }
  
  .section-header {
    margin-bottom: 25px !important;
    text-align: center;
  }
  
  .section-header h2 {
    font-size: 22px !important;
    margin-bottom: 8px !important;
  }
  
  .section-header p {
    font-size: 13px !important;
    color: #666;
  }
  
  /* ----- PRODUCTS GRID MOBILE ----- */
  .products-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  
  .product-card {
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  }
  
  .product-card:active {
    transform: scale(0.98);
  }
  
  .product-image {
    height: 180px !important;
    border-radius: 12px 12px 0 0;
  }
  
  .product-badge {
    top: 8px;
    right: 8px;
    padding: 5px 10px;
    font-size: 10px;
    border-radius: 12px;
  }
  
  .product-info {
    padding: 12px !important;
  }
  
  .product-info h3 {
    margin-bottom: 6px;
  }
  
  .product-info h3 a {
    font-size: 13px !important;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .product-category {
    font-size: 11px;
    margin-bottom: 8px;
  }
  
  .product-price {
    font-size: 17px !important;
    margin: 10px 0 !important;
  }
  
  .price-old {
    font-size: 13px;
  }
  
  .product-info .btn {
    padding: 10px 12px !important;
    font-size: 12px !important;
    border-radius: 8px;
    font-weight: 600;
  }
  
  /* Touch-friendly buttons */
  .btn {
    min-height: 44px;
    padding: 12px 20px !important;
    font-size: 14px !important;
    touch-action: manipulation;
  }
  
  .btn-block {
    width: 100%;
  }
  
  /* ----- FEATURES SECTION MOBILE ----- */
  .features-section {
    background: white;
    padding: 40px 0 !important;
  }
  
  .features-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
  }
  
  .feature-box {
    text-align: center;
    padding: 20px 10px;
  }
  
  .feature-icon {
    width: 50px !important;
    height: 50px !important;
    font-size: 22px !important;
    margin: 0 auto 12px !important;
  }
  
  .feature-box h4 {
    font-size: 14px !important;
    margin-bottom: 5px !important;
  }
  
  .feature-box p {
    font-size: 12px !important;
  }
  
  /* ----- CART PAGE MOBILE ----- */
  .cart-content {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  
  .cart-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
  }
  
  .cart-table table {
    min-width: 100%;
    font-size: 12px;
  }
  
  .cart-table th,
  .cart-table td {
    padding: 10px 8px !important;
  }
  
  .cart-product {
    flex-direction: row;
    gap: 10px;
  }
  
  .cart-product img {
    width: 60px !important;
    height: 60px !important;
    border-radius: 8px;
  }
  
  .cart-product h4 {
    font-size: 13px;
  }
  
  .quantity-control {
    gap: 8px;
  }
  
  .qty-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 14px !important;
    border-radius: 6px;
    min-height: 32px;
  }
  
  .qty-input {
    width: 45px !important;
    padding: 6px !important;
    text-align: center;
    font-size: 13px;
    border-radius: 6px;
  }
  
  .cart-summary {
    padding: 20px;
    border-radius: 12px;
    position: sticky;
    bottom: 0;
  }
  
  .cart-summary h3 {
    font-size: 18px;
  }
  
  .summary-row {
    font-size: 14px;
    margin-bottom: 12px;
  }
  
  .summary-row.total {
    font-size: 20px !important;
    padding-top: 12px;
  }
  
  /* ----- CHECKOUT PAGE MOBILE ----- */
  .checkout-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  
  .checkout-section {
    padding: 20px !important;
    border-radius: 12px;
  }
  
  .checkout-section h3 {
    font-size: 17px;
    margin-bottom: 20px;
  }
  
  .form-group {
    margin-bottom: 18px;
  }
  
  .form-group label {
    font-size: 13px;
    margin-bottom: 6px;
    font-weight: 600;
  }
  
  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 12px 15px !important;
    font-size: 14px !important;
    border-radius: 8px;
    min-height: 44px;
  }
  
  .form-group textarea {
    min-height: 100px;
  }
  
  /* ----- PRODUCT PAGE MOBILE - Handled in product.php ----- */
  /* Minimal overrides only */
  
  body.product-page .footer {
    padding-bottom: 30px !important;
  }

  
  /* ----- FILTERS MOBILE ----- */
  .filters-bar {
    flex-direction: column !important;
    gap: 12px !important;
    padding: 15px !important;
    border-radius: 12px;
  }
  
  .filter-group {
    width: 100% !important;
  }
  
  .filter-group label {
    font-size: 13px;
    margin-bottom: 6px;
    display: block;
  }
  
  .filter-group select {
    width: 100% !important;
    padding: 12px 15px !important;
    font-size: 14px;
    border-radius: 8px;
    min-height: 44px;
  }
  
  /* ----- PAGINATION MOBILE ----- */
  .pagination {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }
  
  .pagination .btn {
    padding: 10px 15px !important;
    font-size: 13px !important;
    min-width: 44px;
  }
  
  .pagination-info {
    width: 100%;
    text-align: center;
    font-size: 12px;
    order: -1;
    margin-bottom: 10px;
  }
  
  /* ----- PAGE HEADER MOBILE ----- */
  .page-header {
    margin: 20px 0;
    padding: 0;
  }
  
  .page-header h1 {
    font-size: 22px !important;
  }
  
  /* ----- EMPTY STATES MOBILE ----- */
  .empty-cart {
    padding: 50px 20px !important;
  }
  
  .empty-cart i {
    font-size: 60px !important;
  }
  
  .empty-cart h3 {
    font-size: 22px !important;
  }
  
  /* ----- RESULT PAGES MOBILE ----- */
  .result-box {
    padding: 30px 20px !important;
    border-radius: 12px;
  }
  
  .result-icon {
    font-size: 60px !important;
  }
  
  .result-box h1 {
    font-size: 22px !important;
    line-height: 1.4;
  }
  
  .result-box p {
    font-size: 14px !important;
  }
  
  .result-actions {
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  .result-actions .btn {
    width: 100%;
  }
  
  .order-details,
  .order-info {
    padding: 15px !important;
    font-size: 13px;
    border-radius: 10px;
  }
  
  .order-detail-row {
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 0;
  }
  
  /* ----- FOOTER MOBILE ----- */
  .footer {
    padding: 30px 0 20px !important;
    margin-top: 40px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 25px !important;
  }
  
  .footer-col {
    text-align: center;
  }
  
  .footer-col h3,
  .footer-col h4 {
    font-size: 16px;
    margin-bottom: 12px;
  }
  
  .footer-col p,
  .footer-col a,
  .footer-col li {
    font-size: 13px;
  }
  
  .social-links {
    justify-content: center;
  }
  
  .footer-bottom {
    font-size: 12px;
    padding-top: 15px;
  }
  
  /* ----- ACCOUNT PAGES MOBILE ----- */
  .account-grid {
    grid-template-columns: 1fr !important;
  }
  
  .account-sidebar {
    margin-bottom: 20px;
  }
  
  /* ----- TABLES MOBILE ----- */
  table {
    font-size: 12px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  table thead {
    display: table-header-group;
  }
  
  table th,
  table td {
    padding: 10px 8px !important;
    white-space: nowrap;
  }
  
  /* ----- UTILITY CLASSES ----- */
  .hide-mobile {
    display: none !important;
  }
  
  .show-mobile {
    display: block !important;
  }
  
  .text-center-mobile {
    text-align: center !important;
  }
  
  /* ----- TYPOGRAPHY MOBILE ----- */
  h1 { font-size: 24px !important; }
  h2 { font-size: 20px !important; }
  h3 { font-size: 18px !important; }
  h4 { font-size: 16px !important; }
  h5 { font-size: 14px !important; }
  
  /* ----- SPACING MOBILE ----- */
  .mb-mobile-10 { margin-bottom: 10px !important; }
  .mb-mobile-20 { margin-bottom: 20px !important; }
  .mb-mobile-30 { margin-bottom: 30px !important; }
  
  .mt-mobile-10 { margin-top: 10px !important; }
  .mt-mobile-20 { margin-top: 20px !important; }
  .mt-mobile-30 { margin-top: 30px !important; }
  
  .p-mobile-10 { padding: 10px !important; }
  .p-mobile-15 { padding: 15px !important; }
  .p-mobile-20 { padding: 20px !important; }
}

/* ========== SMALL MOBILE (480px and below) ========== */
@media (max-width: 480px) {
  
  html {
    font-size: 13px;
  }
  
  .container {
    padding: 0 12px;
  }
  
  /* Single Column Products */
  .products-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
  
  .product-image {
    height: 220px !important;
  }
  
  .product-info {
    padding: 15px !important;
  }
  
  .product-info h3 a {
    font-size: 14px !important;
  }
  
  /* Single Column Features */
  .features-grid {
    grid-template-columns: 1fr !important;
  }
  
  .feature-box {
    padding: 15px;
  }
  
  /* Hero */
  .hero-content h1 {
    font-size: 20px !important;
  }
  
  .hero-content p {
    font-size: 13px !important;
  }
  
  /* Buttons */
  .btn {
    font-size: 13px !important;
    padding: 10px 18px !important;
  }
  
  /* Mobile Menu Wider */
  .nav {
    width: 85%;
    max-width: 300px;
  }
  
  /* Section Headers */
  .section-header h2 {
    font-size: 20px !important;
  }
  
  .section-header p {
    font-size: 12px !important;
  }
}

/* ========== LANDSCAPE MODE FIXES ========== */
@media (max-height: 500px) and (orientation: landscape) {
  .nav {
    padding-top: 20px;
  }
  
  .nav a {
    padding: 10px 25px;
  }
  
  .hero {
    padding: 30px 0 !important;
  }
}
