/* ===================================================================
   RESPONSIVE & MOBILE DESIGN SYSTEM
   Professional Responsive Styles for Ammp Store & Auto Parts
   Breakpoints: 1199px (Laptops), 991px (Tablets), 767px (Phones), 480px (Small Phones)
   =================================================================== */

/* Prevent accidental horizontal overflow across entire layout */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}

/* ===================================================================
   1. TABLET & DESKTOP ADJUSTMENTS (max-width: 991px)
   =================================================================== */
@media only screen and (max-width: 991px) {
  /* Header & Logo */
  .header .inner {
    display: block;
  }
  .header .logo {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 8px;
  }
  .header .logo img {
    max-height: 52px;
    height: auto;
    width: auto;
    margin: 10px auto !important;
    display: inline-block;
  }
  .header .right {
    display: block;
    width: 100%;
  }
  .header .right ul {
    float: none;
    text-align: center;
    margin-bottom: 15px;
    padding-left: 0;
  }
  .header .right ul li {
    float: none;
    display: inline-block;
    margin: 0 8px 6px;
    font-size: 13.5px;
  }
  .header .search-area {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    padding: 0 15px;
  }
  .header .search-area form {
    display: flex;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }
  .header .search-area .form-group {
    flex: 1;
    margin-bottom: 0;
    display: block;
  }
  .header .search-area .search-top {
    width: 100%;
    border-radius: 4px 0 0 4px !important;
    height: 40px;
  }
  .header .search-area button[type="submit"] {
    border-radius: 0 4px 4px 0 !important;
    height: 40px;
    padding: 0 18px;
    flex-shrink: 0;
  }

  /* Catalog Layout */
  .catalog-sidebar-filter {
    margin-bottom: 25px;
  }
  .catalog-toolbar {
    padding: 12px 15px;
  }
  .catalog-toolbar .catalog-results-count {
    font-size: 13px;
  }

  /* Ammp Sections */
  .ammp-re-row {
    display: block;
  }
  .ammp-re-col-media {
    margin-top: 30px;
  }
  .ammp-re-heading {
    font-size: 32px;
  }
}

/* ===================================================================
   2. MOBILE PHONES (max-width: 767px)
   =================================================================== */
@media only screen and (max-width: 767px) {
  /* Prevent zoom on iOS input focus */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Top Contact & Social Bar */
  .top {
    height: auto;
    padding: 8px 0;
    overflow: hidden;
    background: #0b1120;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .top .left {
    float: none;
    text-align: center;
  }
  .top .left ul {
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
  }
  .top .left ul li {
    float: none;
    display: inline-block;
    font-size: 12px;
    line-height: 1.4;
    color: #94a3b8;
  }
  .top .left ul li a {
    color: #cbd5e1;
  }
  .top .right {
    float: none;
    margin-top: 6px;
  }
  .top .right ul {
    text-align: center;
    margin-bottom: 0;
    padding: 0;
  }
  .top .right ul li {
    float: none;
    display: inline-block;
    margin: 0 5px;
  }
  .top .right ul li a {
    width: 28px;
    height: 28px;
    line-height: 28px;
    font-size: 13px;
    display: inline-block;
  }

  /* Main Header Area */
  .header {
    padding: 10px 0 12px;
  }
  .header .logo img {
    max-height: 44px;
    margin: 8px auto !important;
  }
  .header .right ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 12px;
    margin: 6px 0 14px 0;
    padding: 0;
  }
  .header .right ul li {
    margin: 0;
    font-size: 12.5px;
  }
  .header .right ul li a {
    padding: 4px 10px;
    background: #f1f5f9;
    border-radius: 20px;
    display: inline-block;
    color: #1e293b;
    font-weight: 600;
    transition: all 0.2s ease;
  }
  .header .right ul li a:hover {
    background: #dc2626;
    color: #fff;
    text-decoration: none;
  }
  .header .search-area {
    padding: 0 10px;
  }
  .header .search-area form {
    max-width: 100%;
  }

  /* Megamenu Navigation */
  .nav {
    background: #0f172a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .menu-mobile {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px !important;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #ffffff !important;
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none !important;
  }
  .menu-mobile i.fa-bars {
    font-size: 18px;
    margin-right: 8px;
    color: #ef4444;
  }
  .menu-mobile:after {
    font-family: "FontAwesome";
    content: "\f078"; /* Chevron Down */
    font-size: 13px;
    float: none;
    position: static;
    transform: none;
    color: #94a3b8;
    transition: transform 0.25s ease;
  }
  .menu-mobile.active:after {
    content: "\f077"; /* Chevron Up */
    color: #ef4444;
  }
  .menu-dropdown-icon:before {
    display: none !important; /* Remove legacy white box button */
  }

  .menu > ul {
    background: #090e1a;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 0;
  }
  .menu > ul > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .menu > ul > li > a {
    padding: 12px 18px !important;
    font-size: 14px;
    color: #e2e8f0 !important;
    font-weight: 600;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
  }
  .menu > ul > li > a:hover,
  .menu > ul > li.active > a {
    color: #ef4444 !important;
    background: rgba(255, 255, 255, 0.03);
  }

  /* Parts Dropdown inside Mobile Menu */
  .menu-parts-item > ul {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: #0f172a !important;
    padding: 10px 14px !important;
    box-shadow: none !important;
    border: none !important;
    display: none;
  }
  .menu-parts-item.open > ul {
    display: block !important;
  }
  .menu-col {
    width: 100% !important;
    float: none !important;
    border-right: none !important;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1) !important;
    padding: 10px 0 12px !important;
  }
  .menu-col:last-child {
    border-bottom: none !important;
  }
  .menu-col-title {
    font-size: 13.5px !important;
    color: #f87171 !important;
    font-weight: 700 !important;
    padding: 4px 0 !important;
    display: block !important;
  }
  .menu-mid-title {
    font-size: 12px !important;
    padding: 6px 10px !important;
    margin: 4px 0 !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #cbd5e1 !important;
  }
  .menu-end-list {
    padding-left: 10px !important;
  }
  .menu-end-link {
    font-size: 12px !important;
    padding: 4px 6px !important;
    color: #94a3b8 !important;
  }

  /* Slider on Mobile */
  .bs-slider,
  .bs-slider .item {
    height: 280px !important;
    min-height: 280px !important;
    max-height: 280px !important;
  }
  .bs-slider .slide-text {
    padding: 10px 15px !important;
  }
  .bs-slider .slide-text h1 {
    font-size: 20px !important;
    margin-bottom: 8px !important;
    line-height: 1.25 !important;
  }
  .bs-slider .slide-text p {
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    margin-bottom: 12px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .bs-slider .slide-text .btn {
    padding: 7px 18px !important;
    font-size: 12px !important;
  }
  .bs-slider .carousel-control {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }

  /* Looking For Highest Quality Parts Banner */
  .ammp-quality-parts-wrap {
    padding: 24px 0 16px 0;
  }
  .ammp-quality-parts-card {
    flex-direction: column !important;
    border-radius: 14px;
  }
  .ammp-quality-parts-content {
    padding: 24px 20px 16px !important;
    text-align: center !important;
  }
  .ammp-red-pill {
    margin: 0 auto 12px auto !important;
  }
  .ammp-quality-parts-title {
    font-size: 22px !important;
    margin-bottom: 18px !important;
    line-height: 1.3 !important;
  }
  .ammp-quality-parts-btn-wrap {
    justify-content: center !important;
  }
  .ammp-quality-parts-media {
    width: 100% !important;
    padding: 0 16px 20px !important;
  }
  .ammp-quality-parts-media img {
    max-width: 280px !important;
    margin: 0 auto;
  }

  /* Royal Enfield Parts by Ammp Store Banner */
  .ammp-re-parts-section {
    padding: 35px 0 30px;
    margin-top: 25px;
    margin-bottom: 15px;
  }
  .ammp-re-heading {
    font-size: 26px !important;
    text-align: center;
    line-height: 1.25 !important;
  }
  .ammp-re-desc {
    font-size: 14px !important;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 18px !important;
  }
  .ammp-re-features {
    justify-content: center !important;
    gap: 12px 16px !important;
    margin-bottom: 20px;
  }
  .ammp-re-media-card {
    padding: 16px !important;
    border-radius: 16px !important;
  }
  .ammp-re-media-card img {
    max-width: 290px !important;
  }

  /* Our Services Section 2x2 Grid on Mobile */
  .service.pt_70 {
    padding-top: 40px !important;
  }
  .service.pb_70 {
    padding-bottom: 40px !important;
  }
  .service .service-grid-2x2 {
    margin-left: -8px;
    margin-right: -8px;
  }
  .service .service-col-item {
    width: 100% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    margin-bottom: 20px !important;
  }
  .service .service-card .photo {
    height: 190px !important;
  }
  .service .service-card .service-body {
    padding: 18px 18px 22px !important;
  }
  .service .service-card .service-body h3 {
    font-size: 18px !important;
    margin-bottom: 8px !important;
  }
  .service .service-card .service-body p {
    font-size: 13.5px !important;
    line-height: 1.5 !important;
  }

  /* Parallax Driving CTA Banner */
  .ammp-parallax-wrap {
    padding: 15px 0 40px 0 !important;
  }
  .ammp-parallax-card {
    padding: 48px 18px !important;
    border-radius: 14px !important;
  }
  .ammp-parallax-title {
    font-size: 23px !important;
    line-height: 1.25 !important;
    margin-bottom: 12px !important;
  }
  .ammp-parallax-subtitle {
    font-size: 14px !important;
    line-height: 1.5 !important;
    margin-bottom: 22px !important;
  }
  .ammp-btn-pill-red {
    padding: 11px 30px !important;
    font-size: 14px !important;
  }

  /* ===================================================================
     CATALOG & CATEGORY LISTING (product-category.php)
     =================================================================== */
  .page-banner {
    height: 140px !important;
  }
  .page-banner .inner h1 {
    font-size: 22px !important;
    letter-spacing: 0;
  }
  .page-banner .inner {
    padding-top: 36px !important;
  }

  /* Mobile Filter Toggle Button */
  .mobile-filter-btn-container {
    margin-bottom: 15px;
  }
  .btn-mobile-filter {
    background: #0f172a !important;
    color: #ffffff !important;
    border: 1px solid #1e293b !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
  }
  .btn-mobile-filter i.fa-sliders {
    color: #ef4444;
    margin-right: 8px;
    font-size: 16px;
  }
  .btn-mobile-filter .badge {
    background: #dc2626 !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 12px;
    padding: 4px 8px;
  }
  .btn-mobile-filter.active {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
  }
  .btn-mobile-filter.active i.fa-sliders {
    color: #ffffff;
  }
  .btn-mobile-filter.active .badge {
    background: #ffffff !important;
    color: #dc2626 !important;
  }

  /* Collapse Sidebar by default on small screens */
  #catalogSidebarFilter {
    display: none;
    margin-bottom: 24px;
  }
  .sidebar-filter-card {
    padding: 16px !important;
    border-radius: 10px !important;
  }

  /* Toolbar: Sort & Count on Mobile */
  .catalog-toolbar {
    padding: 10px 12px !important;
    margin-bottom: 16px !important;
  }
  .catalog-toolbar .catalog-results-count {
    font-size: 12px !important;
    text-align: center;
    margin-bottom: 8px;
  }
  .catalog-toolbar .text-right {
    text-align: center !important;
  }
  .catalog-quick-size {
    justify-content: center;
    font-size: 12px;
  }
  .catalog-quick-size a {
    padding: 2px 8px;
  }

  /* Active Filter Chips */
  .active-filter-chips {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    margin-top: 8px;
  }
  .filter-chip {
    font-size: 11.5px !important;
    padding: 3px 8px !important;
  }

  /* 1-Product-Per-Row Grid on Mobile */
  .product-cat .row {
    margin-left: -15px !important;
    margin-right: -15px !important;
  }
  .product-cat .item-product-cat {
    width: 100% !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-bottom: 24px !important;
  }
  .product-cat .item-product-cat .inner {
    border-radius: 10px !important;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
  }
  .product-cat .item-product-cat .thumb {
    height: 220px !important;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    position: relative;
    background: #f8fafc;
  }
  .product-cat .item-product-cat .thumb .photo {
    height: 220px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
  }
  .product-cat .item-product-cat .text {
    padding: 16px 16px 18px !important;
    min-height: auto !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .product-cat .item-product-cat .text h3 {
    margin: 0 0 8px 0 !important;
    line-height: 1.35 !important;
  }
  .product-cat .item-product-cat .text h3 a {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: auto;
    max-height: 44px;
  }
  .product-cat .item-product-cat .text h4 {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #dc2626 !important;
    margin: 0 0 12px 0 !important;
  }
  .product-cat .item-product-cat .text h4 del {
    font-size: 13px !important;
    color: #94a3b8;
    margin-right: 6px;
    font-weight: normal;
  }
  .product-cat .item-product-cat .text p {
    margin-bottom: 0 !important;
  }
  .product-cat .item-product-cat .text p a {
    font-size: 13.5px !important;
    padding: 10px 16px !important;
    display: block;
    width: 100%;
    text-align: center;
    border-radius: 6px !important;
    background: #dc2626 !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.25);
    transition: all 0.2s ease;
  }
  .product-cat .item-product-cat .text p a:hover {
    background: #b91c1c !important;
    color: #fff !important;
  }
  .product-cat .item-product-cat .out-of-stock .inner {
    font-size: 12px !important;
    padding: 6px 10px !important;
    border-radius: 6px;
  }

  /* Pagination on Mobile */
  .catalog-pagination {
    margin-top: 15px !important;
    margin-bottom: 30px !important;
  }
  .catalog-pagination-list li a,
  .catalog-pagination-list li span {
    padding: 6px 11px !important;
    font-size: 13px !important;
  }

  /* ===================================================================
     PRODUCT DETAIL PAGE (product.php)
     =================================================================== */
  .breadcrumb {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 8px 12px !important;
    margin-bottom: 20px !important;
    font-size: 12px !important;
  }
  .breadcrumb ul {
    margin: 0;
    padding: 0;
    display: inline-flex;
    gap: 6px;
    align-items: center;
  }
  .breadcrumb ul li {
    display: inline-block;
    flex-shrink: 0;
  }

  ul.prod-slider li {
    height: 290px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
  }
  #prod-pager {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 12px !important;
    padding-bottom: 6px;
  }
  #prod-pager a {
    float: none !important;
    flex-shrink: 0;
    margin-right: 0 !important;
  }
  .prod-pager-thumb {
    width: 60px !important;
    height: 60px !important;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
  }

  .product .p-title h2 {
    font-size: 20px !important;
    margin-top: 18px !important;
    line-height: 1.35 !important;
  }
  .product .p-price span {
    font-size: 20px !important;
  }
  .product .p-quantity {
    margin-bottom: 15px;
  }
  .product .p-quantity input.qty {
    height: 42px !important;
    width: 70px !important;
    font-size: 16px !important;
    text-align: center;
  }
  .product .btn-cart input[type="submit"] {
    width: 100% !important;
    display: block !important;
    padding: 12px 18px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    margin-top: 8px;
  }

  /* Touch-friendly Horizontal Tabs on Mobile */
  ul.nav-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
    border-bottom: 2px solid #e2e8f0 !important;
    margin-top: 30px !important;
    padding-bottom: 0 !important;
  }
  ul.nav-tabs > li {
    float: none !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
  }
  ul.nav-tabs > li > a {
    padding: 10px 15px !important;
    font-size: 13.5px !important;
    margin-right: 4px !important;
    border-radius: 6px 6px 0 0 !important;
  }
  .tab-content {
    padding-top: 15px !important;
  }
  .tab-content .tab-pane {
    margin-top: 0 !important;
  }

  /* ===================================================================
     CART & CHECKOUT (cart.php, checkout.php)
     =================================================================== */
  .table-responsive {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
  }
  .cart-buttons,
  .cart-buttons ul {
    width: 100% !important;
    float: none !important;
    padding-left: 0 !important;
    margin: 15px 0 0 !important;
  }
  .cart-buttons li {
    float: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-bottom: 10px !important;
  }
  .cart-buttons li input[type="submit"],
  .cart-buttons li a {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    border-radius: 6px !important;
    font-size: 14.5px !important;
    padding: 12px 16px !important;
  }

  /* Guest Checkout Box on Mobile */
  .guest-checkout-box {
    padding: 16px !important;
    margin-bottom: 30px !important;
  }
  .guest-checkout-box h3.special {
    font-size: 18px !important;
    margin-bottom: 18px !important;
  }
  .guest-checkout-box h4 {
    font-size: 15px !important;
  }

  /* ===================================================================
     FOOTER
     =================================================================== */
  .footer-main {
    padding: 40px 0 20px !important;
  }
  .footer-col {
    margin-bottom: 28px !important;
  }
  .footer-col h3 {
    font-size: 16px !important;
    margin-bottom: 14px !important;
  }
  .footer-social-list {
    margin-bottom: 10px;
  }
  .footer-bottom {
    padding: 16px 0 !important;
  }
  .footer-bottom .copyright,
  .footer-bottom .footer-payment-note {
    text-align: center !important;
    float: none !important;
    font-size: 12px !important;
  }
  .footer-bottom .footer-payment-note {
    margin-top: 8px;
  }
}

/* ===================================================================
   3. SMALL MOBILE PHONES (max-width: 480px)
   =================================================================== */
@media only screen and (max-width: 480px) {
  /* Slider */
  .bs-slider,
  .bs-slider .item {
    height: 240px !important;
    min-height: 240px !important;
    max-height: 240px !important;
  }
  .bs-slider .slide-text h1 {
    font-size: 17px !important;
  }
  .bs-slider .slide-text p {
    display: none !important; /* Hide paragraph on tiny screens for clarity */
  }

  /* Product Catalog Cards */
  .product-cat .item-product-cat .thumb {
    height: 190px !important;
  }
  .product-cat .item-product-cat .thumb .photo {
    height: 190px !important;
  }
  .product-cat .item-product-cat .text h3 a {
    font-size: 14px !important;
  }
  .product-cat .item-product-cat .text h4 {
    font-size: 14px !important;
  }

  /* Product Detail */
  ul.prod-slider li {
    height: 250px !important;
  }
  .product .p-title h2 {
    font-size: 18px !important;
  }

  /* Ammp Headings */
  .ammp-quality-parts-title {
    font-size: 20px !important;
  }
  .ammp-re-heading {
    font-size: 22px !important;
  }
  .ammp-parallax-title {
    font-size: 20px !important;
  }
}

/* ===================================================================
   4. DESKTOP SPECIFIC (min-width: 992px)
   =================================================================== */
@media only screen and (min-width: 992px) {
  .product .text {
    min-height: 190px;
  }
  .header .inner {
    width: 100%;
  }
  .header .search-area {
    padding-right: 0;
  }
  .header .search-area form {
    padding-right: 0;
  }
  .header .container {
    padding-right: 0;
  }
}
