/* ==========================================================================
   responsive.css - Media Queries & Breakpoints for liteco.ro
   Birotica, Papetarie & Ambalare E-Commerce
   ========================================================================== */

/* ==========================================================================
   LARGE DESKTOP (max-width: 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
  .shop-grid.grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }

  .related-products-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .benefits-bar {
    gap: 1rem;
  }

  .benefit-item {
    padding: 0.5rem 0.625rem;
  }
}

/* ==========================================================================
   DESKTOP (max-width: 992px)
   ========================================================================== */
@media (max-width: 991.98px) {
  /* Typography scale down */
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .section-title {
    font-size: 1.5rem;
  }

  /* Shop layout collapses sidebar */
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .shop-sidebar {
    position: static;
    display: none;
  }

  .shop-sidebar.sidebar-open {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    z-index: var(--z-overlay);
    background: var(--color-white);
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideFromLeft 0.3s ease;
  }

  @keyframes slideFromLeft {
    from {
      transform: translateX(-100%);
    }
    to {
      transform: translateX(0);
    }
  }

  .sidebar-overlay {
    display: none;
  }

  .sidebar-overlay.active {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: calc(var(--z-overlay) - 1);
  }

  /* Mobile filter toggle button */
  .shop-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background: var(--color-white);
    color: var(--color-text);
    cursor: pointer;
  }

  /* Product detail single column */
  .product-detail {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .product-gallery {
    position: static;
  }

  /* Related products */
  .related-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Benefits bar wraps */
  .benefits-bar {
    gap: 0.75rem;
    padding: 1.25rem 0;
  }

  /* Cart table responsive */
  .cart-table thead {
    display: none;
  }

  .cart-table tbody tr {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 0.5rem 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
    align-items: center;
  }

  .cart-table tbody td {
    border: none;
    padding: 0;
  }

  .cart-table tbody td:first-child {
    grid-row: 1 / 3;
  }

  /* Checkout layout */
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-summary {
    position: static;
    order: -1;
  }

  /* Newsletter */
  .newsletter-form {
    max-width: 100%;
  }

  /* WhatsApp and back to top */
  .whatsapp-float {
    right: 1.25rem;
    bottom: 1.25rem;
    width: 48px;
    height: 48px;
  }

  .back-to-top {
    right: 1.25rem;
    bottom: 5rem;
    width: 40px;
    height: 40px;
  }
}

/* ==========================================================================
   TABLET (max-width: 768px)
   ========================================================================== */
@media (max-width: 767.98px) {
  /* Typography */
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.375rem; }
  .section-title { font-size: 1.375rem; }

  /* Container padding */
  .container,
  .container-wide {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Section spacing reduced */
  .section {
    padding: 2.5rem 0;
  }

  .section-sm {
    padding: 1.75rem 0;
  }

  .section-lg {
    padding: 3.5rem 0;
  }

  /* Shop grid: 2 columns */
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .shop-grid.grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .shop-grid.list-view {
    grid-template-columns: 1fr;
  }

  .shop-grid.list-view .product-card {
    flex-direction: column;
  }

  .shop-grid.list-view .product-card-image {
    width: 100%;
  }

  /* Shop header stacks */
  .shop-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .shop-header-controls {
    width: 100%;
    justify-content: space-between;
  }

  /* Product card adjustments */
  .product-card-body {
    padding: 0.75rem;
  }

  .product-card-title {
    font-size: var(--font-size-xs);
  }

  .product-card-price .current-price {
    font-size: var(--font-size-base);
  }

  .product-card-overlay {
    opacity: 1;
    transform: translateY(0);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.2));
  }

  .product-card-wishlist {
    opacity: 1;
  }

  /* Product detail page */
  .product-title {
    font-size: var(--font-size-2xl);
  }

  .product-price .current-price {
    font-size: var(--font-size-3xl);
  }

  .product-gallery-thumbs {
    gap: 0.375rem;
  }

  .product-gallery-thumb {
    width: 56px;
    height: 56px;
  }

  .product-actions {
    flex-direction: column;
  }

  .product-favorite-btn {
    width: 100%;
    height: 48px;
  }

  /* Product tabs */
  .product-tabs .nav-tabs .nav-link {
    padding: 0.75rem 1rem;
    font-size: var(--font-size-xs);
  }

  /* Review summary */
  .review-summary {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .review-summary-score {
    padding: 0;
  }

  /* Related products */
  .related-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  /* Benefits bar vertical on tablet */
  .benefits-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .benefit-item {
    width: 100%;
    max-width: 320px;
  }

  /* Breadcrumbs */
  .breadcrumbs {
    padding: 0.75rem 0;
    font-size: var(--font-size-xs);
  }

  /* Pagination */
  .shop-pagination a,
  .shop-pagination span {
    width: 36px;
    height: 36px;
    font-size: var(--font-size-xs);
  }

  /* Mini cart */
  .mini-cart-dropdown {
    width: 100%;
    max-width: 100%;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    border-radius: 0;
  }

  /* Toast notifications */
  .toast-container {
    top: auto;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }

  /* Cookie banner */
  .cookie-banner {
    flex-direction: column;
    text-align: center;
    gap: 0.875rem;
    padding: 1rem;
  }

  .cookie-banner-text {
    font-size: var(--font-size-xs);
  }
}

/* ==========================================================================
   MOBILE (max-width: 576px)
   ========================================================================== */
@media (max-width: 575.98px) {
  /* Font size adjustments */
  body {
    font-size: 0.9375rem;
  }

  h1 { font-size: 1.375rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.125rem; }
  .section-title { font-size: 1.25rem; }

  /* Container flush */
  .container,
  .container-wide {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }

  /* Shop grid single column option */
  .shop-grid.mobile-single {
    grid-template-columns: 1fr;
  }

  /* Narrower product card spacing */
  .shop-grid {
    gap: 0.625rem;
  }

  .product-card-body {
    padding: 0.625rem;
  }

  .product-card-category {
    font-size: 0.625rem;
  }

  .product-card-badge {
    font-size: 0.625rem;
    padding: 0.1875rem 0.5rem;
  }

  /* Product detail spacing */
  .product-detail {
    gap: 1.5rem;
  }

  .product-title {
    font-size: var(--font-size-xl);
  }

  .product-price .current-price {
    font-size: var(--font-size-2xl);
  }

  .product-price .old-price {
    font-size: var(--font-size-base);
  }

  .product-quantity {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .product-add-to-cart {
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-sm);
  }

  .product-tabs .nav-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .product-tabs .nav-tabs .nav-link {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Header adjustments */
  .header-inner {
    padding: 0.75rem 0.875rem;
  }

  .header-logo img {
    height: 32px;
  }

  .header-action-btn {
    width: 36px;
    height: 36px;
  }

  .header-actions {
    gap: 0;
  }

  /* Newsletter stacked */
  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form .btn {
    width: 100%;
  }

  /* Empty state compact */
  .empty-state {
    padding: 2.5rem 1.25rem;
  }

  .empty-state-icon {
    font-size: 2.5rem;
  }

  /* Checkout adjustments */
  .checkout-step {
    padding: 1rem;
  }

  .checkout-payment-method {
    padding: 0.875rem;
  }

  /* Footer compact */
  .footer-grid {
    gap: 1.5rem;
  }
}

/* ==========================================================================
   VISIBILITY HELPERS
   ========================================================================== */
/* Show only on mobile (max 576px) */
.show-mobile-only {
  display: none !important;
}

@media (max-width: 575.98px) {
  .show-mobile-only {
    display: block !important;
  }

  .hide-mobile {
    display: none !important;
  }
}

/* Show only on tablet and below (max 768px) */
.show-tablet-down {
  display: none !important;
}

@media (max-width: 767.98px) {
  .show-tablet-down {
    display: block !important;
  }

  .hide-tablet-down {
    display: none !important;
  }
}

/* Show only on desktop and below (max 992px) */
.show-desktop-down {
  display: none !important;
}

@media (max-width: 991.98px) {
  .show-desktop-down {
    display: block !important;
  }

  .hide-desktop-down {
    display: none !important;
  }
}

/* Hide on desktop (992px and above) */
@media (min-width: 992px) {
  .hide-desktop-up {
    display: none !important;
  }

  .shop-filter-toggle {
    display: none !important;
  }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    padding: 0;
    margin: 0;
  }

  a,
  a:visited {
    text-decoration: underline;
    color: #000 !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  /* Hide non-essential elements */
  .site-header,
  .utility-bar,
  .top-bar,
  .back-to-top,
  .whatsapp-float,
  .cookie-banner,
  .toast-container,
  .newsletter-section,
  .benefits-bar,
  .mini-cart-dropdown,
  .shop-sidebar,
  .shop-view-toggle,
  .shop-sort-select,
  .product-card-overlay,
  .product-card-wishlist,
  .product-actions,
  .review-form,
  footer {
    display: none !important;
  }

  /* Full width layout */
  .container,
  .container-wide {
    max-width: 100%;
    padding: 0;
  }

  .shop-layout {
    grid-template-columns: 1fr;
  }

  .product-detail {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .shop-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .product-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  /* Page breaks */
  h1, h2, h3 {
    page-break-after: avoid;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  .page-content {
    animation: none;
  }
}
