/* =============================================================================
   ALLANI MOBILE HEADER FIXES — Mobile-Only Improvements
   Desktop version stays UNTOUCHED. All rules are mobile-first or max-width.
   ============================================================================= */

/* ══════════════════════════════════════════════════════════════════════════
   1. MOBILE TOPBAR FIXES (< 768px only)
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  /* Topbar: reduce clutter, show only essential info */
  #dor-topbar01.allani-topbar {
    font-size: 0.75rem;
    padding: 6px 0;
  }

  .allani-topbar-inner {
    padding: 0;
  }

  .allani-topbar-row {
    align-items: center;
    gap: 8px;
  }

  /* Left side: hide address, show only phone */
  .allani-topbar-left {
    flex: 1;
    min-width: 0;
  }

  .allani-topbar-left-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
  }

  /* Hide address/email on mobile, keep phone */
  .allani-topbar-left-inner .dor-topbar-text-info {
    font-size: 0.7rem;
    white-space: nowrap;
  }

  .allani-topbar-left-inner .dor-topbar-text-info i {
    font-size: 12px;
    margin-right: 4px;
  }

  /* If there are multiple info items, hide all except phone */
  .allani-topbar-left-inner .dor-topbar-text-info:not(:has(i.material-icons:contains("phone"))):not(:has([class*="phone"])) {
    display: none;
  }

  /* Right side: compact language/currency/account */
  .allani-topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .allani-topbar-right .dortopbar-setting-lists {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* Make dropdowns smaller on mobile */
  .allani-topbar-right .selection-options-wrapper {
    font-size: 0.7rem;
  }

  .allani-topbar-right .line-selected {
    padding: 4px 8px;
    min-width: auto;
  }

  .allani-topbar-right .line-selected i {
    font-size: 10px;
    margin-left: 2px;
  }

  /* Account dropdown: adjust for mobile */
  #dor-topbar01 .user-info.open.allani-open .toogle_content,
  #dor-topbar01 .user-info.open.allani-open .allani-account-dropdown {
    min-width: 200px !important;
    right: 0 !important;
    left: auto !important;
    font-size: 0.85rem !important;
  }

  #dor-topbar01 .user-info.open.allani-open .toogle_content li a,
  #dor-topbar01 .user-info.open.allani-open .allani-account-dropdown li a {
    padding: 8px 16px !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   2. MOBILE HEADER FIXES (< 768px only)
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  /* Header: better spacing and touch targets */
  #dor-header01.allani-header {
    padding: 0;
  }

  .allani-header-top {
    padding: 12px 0;
  }

  .allani-header-row {
    align-items: center;
    gap: 12px;
  }

  /* Logo: smaller on mobile */
  .allani-logo-col {
    flex: 0 0 auto;
    width: auto;
    padding: 0 8px;
  }

  .allani-logo-col .logo {
    max-width: 120px;
    height: auto;
  }

  /* Search: full width on mobile */
  .allani-search-col {
    flex: 1;
    min-width: 0;
    padding: 0 8px;
  }

  /* Search input: better mobile UX */
  .allani-search-col input[type="text"],
  .allani-search-col input[type="search"] {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 8px;
  }

  /* Search button: touch-friendly */
  .allani-search-col button[type="submit"] {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }

  /* Actions: compact icons */
  .allani-actions-col {
    flex: 0 0 auto;
    width: auto;
    padding: 0 8px;
  }

  .allani-actions-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .allani-right-nav {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Icon buttons: touch-friendly size */
  .allani-right-nav a,
  .allani-right-nav button,
  .allani-nav-cart a {
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
  }

  .allani-right-nav i,
  .allani-nav-cart i {
    font-size: 20px;
  }

  /* Cart badge: visible on mobile */
  .allani-nav-cart .cart-products-count {
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
  }

  /* Bottom header: hide on mobile (menu is in hamburger) */
  .allani-header-bottom {
    display: none;
  }

  /* Mobile menu: better styling */
  .allani-mobile-top-menu {
    background: #fff;
    border-top: 1px solid #e4d8c0;
    padding: 16px;
  }

  .allani-mobile-top-menu.show {
    display: flex !important;
  }

  /* Mobile menu items: touch-friendly */
  .allani-mobile-top-menu a {
    display: block;
    padding: 12px 16px;
    font-size: 15px;
    color: #1e1e2e;
    border-bottom: 1px solid #f0f0f0;
  }

  .allani-mobile-top-menu a:hover,
  .allani-mobile-top-menu a:active {
    background: #f8f5f0;
    color: #c9a84c;
  }

  /* Hamburger menu icon: better visibility */
  #menu-icon {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  #menu-icon i {
    font-size: 24px;
    color: #1e1e2e;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   3. EXTRA SMALL MOBILE (< 450px)
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 450px) {
  /* Topbar: even more compact */
  #dor-topbar01.allani-topbar {
    font-size: 0.7rem;
    padding: 4px 0;
  }

  .allani-topbar-left-inner .dor-topbar-text-info {
    font-size: 0.65rem;
  }

  /* Header: tighter spacing */
  .allani-header-top {
    padding: 8px 0;
  }

  .allani-header-row {
    gap: 8px;
  }

  /* Logo: even smaller */
  .allani-logo-col .logo {
    max-width: 100px;
  }

  /* Search: adjust for tiny screens */
  .allani-search-col input[type="text"],
  .allani-search-col input[type="search"] {
    font-size: 13px;
    padding: 8px 10px;
  }

  /* Actions: smaller icons */
  .allani-right-nav a,
  .allani-right-nav button,
  .allani-nav-cart a {
    min-width: 36px;
    min-height: 36px;
    padding: 6px;
  }

  .allani-right-nav i,
  .allani-nav-cart i {
    font-size: 18px;
  }

  /* Hide less important actions on tiny screens */
  .allani-right-nav > *:not(.allani-nav-cart):not(#_mobile_user_info) {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   4. NAV STRIP MOBILE IMPROVEMENTS
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  #allani-nav-row {
    padding: 8px 0;
  }

  #allani-nav-strip {
    padding: 4px 8px;
    gap: 4px;
  }

  .allani-nav-pill {
    font-size: 0.72rem !important;
    padding: 6px 10px !important;
  }

  /* Add scroll hint on mobile */
  #allani-nav-strip::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to left, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   5. PRODUCT GRID MOBILE IMPROVEMENTS
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  /* 2 columns on mobile */
  .featured-products .products,
  .allani-hook-related-products .products,
  .product-miniature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Product cards: better mobile layout */
  .product-miniature {
    padding: 8px;
  }

  .product-miniature .product-title {
    font-size: 0.85rem;
    line-height: 1.3;
  }

  .product-miniature .product-price-and-shipping {
    font-size: 0.9rem;
  }

  /* Product images: maintain aspect ratio */
  .product-miniature .product-thumbnail img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
  }
}

@media (max-width: 450px) {
  /* 1 column on very small screens */
  .featured-products .products,
  .allani-hook-related-products .products,
  .product-miniature-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Larger cards on single column */
  .product-miniature {
    padding: 12px;
  }

  .product-miniature .product-title {
    font-size: 0.95rem;
  }

  .product-miniature .product-price-and-shipping {
    font-size: 1rem;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   6. FOOTER MOBILE IMPROVEMENTS
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  /* Footer: accordion-style on mobile */
  .footer-container .block {
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .footer-container .block .title {
    cursor: pointer;
    position: relative;
    padding: 16px 0;
    user-select: none;
  }

  .footer-container .block .title::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: 300;
    transition: transform 0.3s ease;
  }

  .footer-container .block.allani-footer-open .title::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
  }

  /* Footer content: hidden by default on mobile */
  .footer-container .block .block_content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
  }

  .footer-container .block.allani-footer-open .block_content {
    max-height: 500px;
    opacity: 1;
    padding-bottom: 16px;
  }

  /* Footer links: better spacing */
  .footer-container .block_content ul li {
    margin-bottom: 12px;
  }

  .footer-container .block_content ul li a {
    font-size: 0.9rem;
    padding: 4px 0;
    display: inline-block;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   7. TOUCH IMPROVEMENTS (all mobile devices)
   ══════════════════════════════════════════════════════════════════════════ */

@media (hover: none) and (pointer: coarse) {
  /* All clickable elements: minimum 44x44px touch target */
  a, button, input[type="submit"], input[type="button"], .clickable {
    min-height: 44px;
    min-width: 44px;
  }

  /* Remove hover effects on touch devices */
  a:hover, button:hover {
    opacity: 1;
  }

  /* Add active state for better feedback */
  a:active, button:active {
    opacity: 0.7;
    transform: scale(0.98);
  }

  /* Prevent text selection on buttons */
  button, .btn, .clickable {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
  }

  /* Smooth scrolling on touch */
  * {
    -webkit-overflow-scrolling: touch;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   8. DESKTOP PROTECTION — Ensure desktop stays perfect
   ══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
  /* Reset any mobile-specific changes */
  #dor-topbar01.allani-topbar,
  #dor-header01.allani-header,
  .allani-header-bottom,
  .allani-nav-strip,
  .footer-container {
    /* Desktop uses original styles from allaninewui.css */
    /* This file only adds mobile improvements */
  }
}
