/* DRPT - SITE-WIDE RESPONSIVE DESIGN */

/* All screen sizes */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  max-width: 100%;
  overflow-x: clip;
}

img, video, iframe {
  max-width: 100%;
}

.container,
.page-body,
.admin {
  min-width: 0;
}

.products-grid > *,
.feature-grid > *,
.story-band > *,
.product-detail > *,
.brew-grid > * {
  min-width: 0;
}

@media (max-width: 900px) {

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brew-grid,
  .product-detail {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 28px;
  }

  .admin-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phones */
@media (max-width: 720px) {

  .container {
    width: 100%;
    max-width: 100%;
    padding-inline: 16px;
  }

  .section {
    padding-block: 48px;
  }

  h1 {
    font-size: clamp(2.3rem, 10vw, 3.6rem);
    line-height: 1.12;
    overflow-wrap: break-word;
  }

  h2 {
    font-size: clamp(1.8rem, 7.5vw, 2.5rem);
    line-height: 1.2;
  }

  /* HEADER AND LOGO */

  .header {
    height: 68px !important;
    padding-inline: 10px !important;
    gap: 0 !important;
  }

  .header .logo {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 120px !important;
    max-width: 31vw !important;
    margin: 0 !important;
  }

  .header .brand-logo {
    display: block;
    width: 100% !important;
    height: 52px !important;
    max-height: 52px !important;
    object-fit: contain !important;
    transform: none !important;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 0 !important;
    position: relative;
    z-index: 2;
  }

  .header .icon-btn {
    padding: 5px !important;
    min-width: 35px;
    min-height: 42px;
    justify-content: center;
  }

  .header-actions a[aria-label="Search"] {
    width: 36px !important;
    min-width: 36px !important;
    height: 42px !important;
  }

  .header-actions a[aria-label="Search"] svg {
    width: 24px !important;
    height: 24px !important;
  }

  /* ANNOUNCEMENT */

  .notice {
    padding: 10px 12px !important;
    font-size: 10px !important;
    letter-spacing: .06em !important;
    line-height: 1.5;
  }

  /* NAVIGATION DRAWER */

  .nav-drawer {
    width: min(360px, 100vw);
    max-width: 100vw;
    max-height: 100dvh;
    overflow-y: auto;
    padding: 20px;
  }

  .drawer-links a {
    font-size: 1.2rem;
    padding: 13px 0;
  }

  .drawer-sublinks {
    gap: 12px;
  }

  /* HOMEPAGE HERO */

  .hero {
    min-height: 62svh;
    background-position: center;
  }

  .hero-inner {
    padding: 55px 0 65px !important;
  }

  .hero h1 {
    font-size: clamp(2.45rem, 10vw, 3.7rem);
    max-width: 100%;
  }

  .hero p {
    font-size: .95rem;
    max-width: 100%;
  }

  .hero .btn {
    max-width: 100%;
  }

  /* SECTION TITLES */

  .section-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
  }

  .section-heading h2 {
    font-size: clamp(1.8rem, 7vw, 2.3rem);
  }

  .arrow-link {
    font-size: .78rem;
    white-space: normal;
  }

  /* PRODUCT COLLECTIONS */

  .products-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .product-card {
    width: 100%;
    min-width: 0;
  }

  .product-img {
    width: 100%;
    overflow: hidden;
  }

  .product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .product-info {
    padding: 12px 0;
  }

  .product-info h3 {
    font-size: .9rem;
    overflow-wrap: break-word;
  }

  .product-card .btn {
    width: 100%;
    min-height: 44px;
    padding: 9px 5px;
    font-size: .72rem;
    letter-spacing: 0;
    white-space: normal;
  }

  /* CATEGORY AND SORTING FILTERS */

  .filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex: 0 0 auto;
    min-height: 44px;
    white-space: nowrap;
  }

  .shop-toolbar,
  .shop-controls,
  .sort-row,
  .sort-controls {
    max-width: 100%;
    flex-wrap: wrap;
    gap: 12px;
  }

  .search-bar {
    width: 100%;
    font-size: 16px;
    min-height: 48px;
  }

  /* STORY AND COLLECTION SECTIONS */

  .story-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .story-band img {
    width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: cover;
  }

  .story-copy {
    padding: 38px 22px;
  }

  .feature-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
  }

  /* PRODUCT DETAILS */

  .product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 25px;
    padding-block: 25px 45px;
  }

  .product-detail .big-image {
    width: 100%;
    max-height: 520px;
  }

  .product-detail .btn {
    width: 100%;
    max-width: none;
  }

  .qty-row button {
    min-width: 44px;
    min-height: 44px;
  }

  /* V60 BREWING GUIDE */

  .brew-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px;
  }

  .brew-grid > img {
    width: 100%;
    height: auto !important;
    max-height: 430px;
    object-fit: contain;
  }

  .brew-content,
  .brew-recipe-card {
    min-width: 0;
    max-width: 100%;
  }

  .brew-table-scroll {
    max-width: 100%;
    overflow-x: auto;
  }

  /* FORMS AND CONTACT */

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    max-width: 100%;
    font-size: 16px;
  }

  .form input,
  .form select,
  .form textarea {
    min-width: 0;
    min-height: 48px;
  }

  .page-body {
    width: 100%;
    padding: 25px 16px 60px;
  }

  /* NEWSLETTER */

  .newsletter {
    padding: 50px 16px;
  }

  .newsletter form {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .newsletter input,
  .newsletter button {
    width: 100%;
    min-height: 48px;
  }

  /* FOOTER */

  .footer {
    padding: 40px 16px 0;
  }

  .footer-links {
    gap: 14px;
  }

  .footer-meta {
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
  }

  .footer-logo {
    max-width: 100%;
    margin-inline: 0;
    overflow: hidden !important;
  }

  .footer-logo img {
    width: 100%;
    max-width: 280px;
    height: auto;
    object-fit: contain;
  }

  /* ADMIN DASHBOARD */

  .admin {
    padding: 15px 12px 50px;
  }

  .admin-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-panel,
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
  }

  .admin-fieldset {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-dialog {
    width: 100%;
    padding: 18px;
    max-height: 90dvh;
    overflow-y: auto;
  }
}

/* Very small phones */
@media (max-width: 360px) {

  .header .logo {
    max-width: 27vw !important;
  }

  .products-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-heading {
    align-items: flex-start;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
