/* ===================================================
   ORA-TECH GLOBAL RESPONSIVE STYLES
   Loaded after the main stylesheets, so equal-specificity
   rules here override the default desktop styles.
   =================================================== */

/* ---------- UP TO 1200px (Large tablets / small laptops) ---------- */
@media (max-width: 1200px) {
  .wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
  .product-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .cat-grid {
    grid-template-columns: repeat(6, 1fr) !important;
  }
  .usp-strip .wrap {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* ---------- UP TO 992px (Tablets) ---------- */
@media (max-width: 992px) {
  header.main .wrap {
    flex-wrap: wrap;
    gap: 16px;
  }
  .search-bar {
    max-width: 100%;
    order: 3;
    flex-basis: 100%;
  }
  .head-actions {
    gap: 16px;
    margin-left: auto;
  }
  .hero-grid {
    grid-template-columns: 1fr !important;
  }
  .hero-side {
    flex-direction: row !important;
    flex-wrap: wrap;
  }
  .hero-side .side-card {
    flex: 1 1 calc(50% - 8px);
    min-height: 160px;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .cat-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  .usp-strip .wrap {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .usp-item {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

/* ---------- UP TO 768px (Small tablets / large phones) ---------- */
@media (max-width: 768px) {
  .wrap {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Topbar */
  .topbar .wrap {
    height: auto;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 8px 0;
  }
  .topbar .left {
    width: 100%;
    text-align: center;
    margin-bottom: 4px;
  }
  .topbar .left span {
    margin: 0 8px;
    display: inline-block;
    font-size: 11px;
  }
  .topbar .right {
    width: 100%;
    text-align: center;
  }
  .topbar .right a {
    margin: 0 8px;
    font-size: 11px;
  }

  /* Public header */
  header.main .wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 0;
  }
  .logo {
    justify-content: center;
    margin-bottom: 4px;
  }
  .logo img {
    max-height: 32px;
  }
  .search-bar {
    width: 100%;
    order: 2;
  }
  .search-bar input {
    font-size: 14px;
    padding: 10px 12px;
  }
  .search-bar button {
    padding: 0 14px;
  }
  .head-actions {
    justify-content: space-between;
    flex-wrap: nowrap;
    width: 100%;
    gap: 8px;
    padding: 0 4px;
  }
  .head-actions .item {
    gap: 4px;
    flex: 1;
    min-width: 0;
    justify-content: center;
  }
  .head-actions .item svg {
    width: 20px;
    height: 20px;
  }
  .head-actions .item .lbl {
    display: none;
  }
  .head-actions .contact-btn {
    display: none;
  }
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #e6ecf5;
    font-size: 22px;
    padding: 6px;
    cursor: pointer;
    flex-shrink: 0;
  }
  .mobile-menu-btn svg {
    stroke: #e6ecf5;
    width: 24px;
    height: 24px;
  }

  /* Hero */
  .hero-main {
    min-height: 320px;
  }
  .hero-copy {
    padding: 28px 24px;
    max-width: 100%;
  }
  .hero-copy h1 {
    font-size: 26px;
  }
  .hero-copy p {
    font-size: 13px;
  }
  .hero-img {
    width: 80%;
    height: auto;
    right: -20px;
    opacity: 0.45;
  }
  .hero-side .side-card {
    flex: 1 1 100%;
  }

  /* Category nav / dropdown */
  .cat-item > a {
    padding: 10px 12px;
    font-size: 13px;
  }
  .cat-dropdown {
    min-width: 240px;
    max-width: 280px;
    padding: 10px;
  }

  /* Product grid */
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .product-thumb {
    height: 150px;
  }
  .product-body {
    padding: 12px;
  }
  .product-title {
    font-size: 13px;
    min-height: 36px;
  }
  .price-now {
    font-size: 15px;
  }
  .add-cart-btn {
    padding: 8px;
    font-size: 12px;
  }

  /* Category tiles */
  .cat-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }
  .cat-tile .cat-img {
    width: 52px;
    height: 52px;
  }
  .cat-tile .cat-name {
    font-size: 11px;
  }

  /* Section header */
  .section-head h2 {
    font-size: 22px;
  }
  .section-head p {
    font-size: 12.5px;
  }

  /* USP */
  .usp-strip .wrap {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .usp-item {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
}

/* ---------- UP TO 576px (Phones) ---------- */
@media (max-width: 576px) {
  .logo .logo-text .name {
    font-size: 18px;
  }
  .logo .logo-text .tag {
    font-size: 8px;
    letter-spacing: 1.5px;
  }
  .logo img {
    width: 38px;
    height: 38px;
  }

  .search-bar input,
  .search-container .search-input {
    padding: 9px 12px;
    font-size: 13px;
  }
  .search-bar button,
  .search-container .search-button {
    padding: 0 14px;
  }

  .head-actions .item .lbl {
    display: none;
  }
  .head-actions .item svg {
    width: 24px;
    height: 24px;
  }
  .contact-btn {
    display: none;
  }

  .hero-main {
    min-height: 280px;
  }
  .hero-copy {
    padding: 22px 16px;
  }
  .hero-copy h1 {
    font-size: 22px;
  }
  .hero-copy .eyebrow {
    font-size: 10px;
  }
  .hero-btn {
    padding: 10px 18px;
    font-size: 13px;
  }
  .hero-dots {
    bottom: 12px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .product-thumb {
    height: 180px;
  }

  .cat-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .cat-tile {
    padding: 12px 8px;
  }
  .cat-tile .cat-img {
    width: 48px;
    height: 48px;
  }
  .cat-tile .cat-name {
    font-size: 10.5px;
  }

  .section {
    padding: 8px 0 30px;
  }
  .section-head h2 {
    font-size: 20px;
  }
  .section-head p {
    font-size: 12px;
  }

  .usp-item svg {
    width: 26px;
    height: 26px;
  }
  .usp-item .t {
    font-size: 12.5px;
  }
  .usp-item .s {
    font-size: 10.5px;
  }

  .see-all-wrap {
    margin-top: 22px;
  }
  .see-all-btn {
    padding: 10px 22px;
    font-size: 13px;
  }
}

/* ---------- UP TO 480px (Small phones) ---------- */
@media (max-width: 480px) {
  .wrap {
    padding-left: 10px;
    padding-right: 10px;
  }
  .product-thumb {
    height: 160px;
  }
  .product-title {
    font-size: 12px;
    min-height: 32px;
  }
  .price-now {
    font-size: 14px;
  }
  .price-old {
    font-size: 11px;
  }
  .cat-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  .cat-tile .cat-name {
    font-size: 10px;
  }
}

/* ===================================================
   PUBLIC SITE HEADER (partials/header.blade.php)
   =================================================== */
@media (max-width: 992px) {
  .header-top {
    flex-wrap: wrap;
    gap: 12px;
  }
  .main-header .container .header-top .search-container {
    order: 3;
    width: 100%;
    max-width: 100%;
  }
  .main-header .container .header-top .user-actions {
    margin-left: auto;
  }
}

@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 0;
  }
  .main-header .logo {
    justify-content: center;
  }
  .search-container .search-input-group,
  .search-form .search-input-group {
    width: 100%;
  }
  .main-header .container .header-top .user-actions {
    justify-content: center;
    width: 100%;
    margin: 0;
    gap: 12px;
  }
  .login-btn,
  .contact-link,
  .cart-link {
    font-size: 13px;
  }
  .cart-link {
    gap: 4px;
  }
  .cart-text {
    display: none;
  }
  .cart-count-badge {
    top: -4px;
    right: -6px;
  }
}

/* ===================================================
   ADMIN PANEL RESPONSIVE TWEAKS
   (AdminLTE is already responsive, but these tighten
    up tables, filter forms and cards on mobile.)
   =================================================== */
@media (max-width: 992px) {
  .content .container-fluid .form-row,
  .content .container-fluid form .form-row {
    flex-direction: column !important;
  }
  .card-header .btn,
  .card-footer .btn {
    margin-bottom: 4px;
  }
}

@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table td,
  .table th {
    font-size: 12px;
    padding: 8px;
    white-space: nowrap;
  }
  .card-title {
    font-size: 16px;
  }
  .card-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .small-box .inner h3 {
    font-size: 20px;
  }
  .main-sidebar {
    width: 250px;
  }
  .brand-link .brand-text {
    font-size: 14px;
  }
}

@media (max-width: 576px) {
  .table td,
  .table th {
    padding: 6px;
    font-size: 11px;
  }
  .btn-sm {
    padding: 0.25rem 0.4rem;
    font-size: 11px;
  }
  .pagination .page-link {
    padding: 0.2rem 0.4rem;
    font-size: 12px;
  }
  .content-header h1 {
    font-size: 18px;
  }
  .login-box,
  .register-box {
    width: 92% !important;
    max-width: 360px;
  }
}

/* ===================================================
   EXTRA MOBILE FIXES
   =================================================== */
@media (max-width: 768px) {
  .checkout-page .container,
  .checkout-container {
    padding-left: 14px;
    padding-right: 14px;
  }
  .checkout-form {
    padding: 18px;
  }
  .order-item {
    flex-wrap: wrap;
    gap: 10px;
  }
  .order-item-info,
  .order-item-total {
    width: 100%;
  }
  .order-item-total {
    text-align: right;
  }
  .offers-container {
    grid-template-columns: 1fr !important;
  }
  .offers-hero h1 {
    font-size: 24px;
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .products-page h1 {
    font-size: 26px;
  }
  .banner-content {
    flex-direction: column;
  }
  .pd-image-frame img {
    padding: 12px;
  }
  .pd-title {
    font-size: 22px;
  }
  .pd-price-current {
    font-size: 24px;
  }
  .pd-size-grid,
  .pd-color-grid {
    gap: 8px;
  }
  .pd-size-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
  .pd-color-btn {
    width: 36px;
    height: 36px;
  }
  .pd-qty-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .cat-dropdown {
    display: none;
  }
}

@media (max-width: 576px) {
  .pd-container,
  .cart-container,
  .products-page .container,
  .checkout-page .container {
    padding-left: 12px;
    padding-right: 12px;
  }
  .pd-image-frame {
    aspect-ratio: 4 / 3;
  }
  .pd-title {
    font-size: 20px;
  }
  .pd-cart-btn {
    width: 100%;
  }
  .cart-item {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .cart-item__image {
    width: 100% !important;
    height: 180px !important;
    max-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #fafbfc;
  }
  .cart-item__image img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }
  .cart-item__total {
    grid-column: auto !important;
    justify-content: flex-start !important;
  }
  .cart-summary__body {
    padding: 16px;
  }
  .cart-summary__row {
    font-size: 13px;
  }
  .products-grid {
    gap: 12px;
  }
  .product-image {
    height: 160px;
  }
  .product-details {
    padding: 12px;
  }
  .filter-options {
    gap: 8px;
  }
}

/* ===================================================
   MOBILE MENU OVERRIDES
   The multi-level mobile drawer is styled inline in
   resources/views/partials/header.blade.php.
   =================================================== */
@media (max-width: 768px) {
  .category-nav {
    display: none;
  }
  .category-nav.open {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.5) !important;
    z-index: 100001 !important;
  }
}

/* ===================================================
   SEARCH AUTOCOMPLETE SUGGESTIONS
   =================================================== */
.search-bar {
  position: relative;
}
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e7e9ee;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,.1);
  z-index: 1000;
  max-height: 340px;
  overflow-y: auto;
  display: none;
}
.search-suggestions.active {
  display: block;
}
.suggestion-group {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f9fafb;
  border-bottom: 1px solid #eef2f7;
}
.search-suggestions a {
  display: block;
  padding: 10px 12px;
  color: #1a2233;
  text-decoration: none;
  font-size: 13px;
  transition: background .1s;
  border-bottom: 1px solid #f3f4f6;
}
.search-suggestions a:hover,
.search-suggestions a:focus {
  background: #f3f4f6;
  outline: none;
}
.search-suggestions .empty {
  padding: 14px 12px;
  color: #6b7280;
  font-size: 13px;
  text-align: center;
}

/* ===================================================
   PRODUCT PAGE MOBILE
   =================================================== */
@media (max-width: 768px) {
  .products-page .container h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }
  .products-banner {
    margin-bottom: 1.5rem;
  }
  .products-banner .banner-content {
    flex-direction: column;
    align-items: stretch;
  }
  .products-banner .banner-text {
    padding: 20px;
    text-align: center;
  }
  .products-banner .banner-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 20px;
  }
  .products-banner .banner-image {
    order: -1;
    margin: 0 auto;
    max-width: 100%;
  }
  .category-filter .filter-options {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .category-filter .filter-option {
    white-space: nowrap;
    flex-shrink: 0;
  }
}
