/* DIRTY KLAB storefront — responsive + Inter typography (Figma) */

body.dk-store {
  --dk-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --dk-font-display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --dk-container: 1040px;
  --dk-gutter: 16px;
  font-family: var(--dk-font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body.dk-store h1,
body.dk-store h2,
body.dk-store h3,
body.dk-store h4,
body.dk-store .dk-pdp__title,
body.dk-store .dk-page-head h1,
body.dk-store .dk-cart-page h1,
body.dk-store .status-page__head h1,
body.dk-store .dk-account-card h1,
body.dk-store .dk-checkout-section__title,
body.dk-store .dk-checkout-section__head h2 {
  font-family: var(--dk-font-display);
  letter-spacing: -0.02em;
}

/* ── Container gutters ── */

body.dk-store .container,
body.dk-store .dk-store-nav__bar--desktop,
body.dk-store .dk-store-nav__bar {
  width: min(var(--dk-container), calc(100% - var(--dk-gutter) * 2));
}

@media (min-width: 640px) {
  body.dk-store {
    --dk-gutter: 20px;
  }
}

@media (min-width: 1024px) {
  body.dk-store {
    --dk-gutter: 24px;
  }
}

/* ── Announcement ── */

body.dk-store .dk-announce {
  font-size: 10px;
  padding: 7px 12px;
  line-height: 1.35;
}

@media (min-width: 640px) {
  body.dk-store .dk-announce {
    font-size: 11px;
    padding: 8px 16px;
  }
}

/* ── Header / nav ── */

@media (max-width: 859px) {
  body.dk-store .dk-store-nav__bar--mobile {
    min-height: 56px;
  }

  body.dk-store .dk-store-nav .nav__logo,
  body.dk-store .dk-store-nav .nav__logo img {
    width: 48px;
    height: 48px;
  }
}

@media (min-width: 860px) {
  body.dk-store .nav__logo--hero,
  body.dk-store .nav__logo--hero img {
    width: 72px;
    height: 72px;
    max-width: 72px;
  }

  body.dk-store .dk-store-nav__bar--desktop {
    padding: 14px 0 10px;
  }

  body.dk-store .dk-store-nav .nav__links a {
    font-size: 13px;
  }
}

@media (min-width: 860px) and (max-width: 1023px) {
  body.dk-store .nav__logo--hero,
  body.dk-store .nav__logo--hero img {
    width: 68px;
    height: 68px;
    max-width: 68px;
  }

  body.dk-store .dk-store-nav .nav__links {
    gap: 24px;
  }
}

/* ── Home hero ── */

@media (max-width: 639px) {
  body.dk-store .dk-home-hero{
    margin: 8px 0 28px;
    gap: 6px;
  }

  body.dk-store .dk-home-hero img{
    max-height: 220px;
  }

  body.dk-store .dk-home-hero figure:first-child img{
    max-height: 260px;
  }

  body.dk-store .dk-home-hero__cap{
    left: 12px;
    bottom: 12px;
    font-size: 1.25rem;
  }
}

@media (min-width: 640px) and (max-width: 899px) {
  body.dk-store .dk-home-hero{
    grid-template-columns: 1.45fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    height: 320px;
    max-height: 320px;
  }

  body.dk-store .dk-home-hero figure:first-child{
    grid-column: auto;
    grid-row: 1 / 3;
  }

  .dk-home-hero figure,
  body.dk-store .dk-home-hero img{
    height: 100%;
    aspect-ratio: auto;
    min-height: 0;
    max-height: none;
  }
}

@media (min-width: 900px) and (max-width: 1023px) {
  body.dk-store .dk-home-hero{
    height: 360px;
    max-height: 360px;
  }
}

@media (max-width: 639px) {
  body.dk-store .dk-catalog-page {
    padding-top: 16px;
    padding-bottom: 36px;
  }

  body.dk-store .dk-home-products {
    padding-bottom: 40px;
  }

  body.dk-store .dk-home-products__title {
    font-size: 11px;
    margin-bottom: 14px;
  }

  body.dk-store .dk-faq__item {
    padding: 18px 16px;
  }

  body.dk-store .dk-faq__item h2 {
    font-size: 15px;
  }
}

@media (min-width: 640px) and (max-width: 899px) {
  body.dk-store .dk-catalog-page {
    padding-top: 22px;
  }
}

/* ── Product grid ── */

@media (max-width: 479px) {
  body.dk-store .dk-card-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
  }

  body.dk-store .dk-card__name{
    font-size: 11px;
  }

  body.dk-store .dk-card__price{
    font-size: 11px;
  }

  body.dk-store .dk-card__badge{
    font-size: 8px;
    padding: 2px 6px;
  }
}

@media (min-width: 640px) and (max-width: 859px) {
  body.dk-store .dk-card-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 14px;
  }
}

/* ── Catalog head ── */

@media (max-width: 639px) {
  body.dk-store .dk-page-head{
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  body.dk-store .dk-page-head h1{
    font-size: 1.35rem;
  }

  body.dk-store .dk-sort{
    width: 100%;
    justify-content: space-between;
  }

  body.dk-store .dk-sort select{
    flex: 1;
    max-width: 200px;
  }
}

/* ── PDP ── */

@media (max-width: 899px) {
  body.dk-store .dk-pdp{
    padding: 12px 0 32px;
    gap: 20px;
  }

  body.dk-store .dk-pdp__stage{
    min-height: 220px;
    max-height: min(72vw, 420px);
  }

  body.dk-store .dk-pdp__stage img{
    max-height: min(70vw, 400px);
  }

  body.dk-store .dk-pdp__title{
    font-size: 1.25rem;
  }

  body.dk-store .dk-pdp__buy{
    padding: 16px 14px !important;
  }

  body.dk-store .dk-pdp__thumbs{
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  body.dk-store .dk-pdp__thumbs button{
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
  }

  body.dk-store .dk-pdp__details-grid{
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 24px;
  }

  body.dk-store .dk-pdp__actions {
    display: grid;
    gap: 8px;
  }

  body.dk-store .dk-related {
    margin-top: 32px;
  }

  body.dk-store .dk-related .dk-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

@media (min-width: 640px) and (max-width: 899px) {
  body.dk-store .dk-pdp__stage{
    min-height: 320px;
  }
}

/* ── Cart ── */

@media (max-width: 767px) {
  body.dk-store .dk-cart-head{
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }

  body.dk-store .dk-cart-page{
    padding: 16px 0 40px;
  }

  body.dk-store .dk-cart-table thead {
    display: none;
  }

  body.dk-store .dk-cart-table,
  body.dk-store .dk-cart-table tbody {
    display: block;
    width: 100%;
    overflow: visible;
  }

  body.dk-store .dk-cart-table tr.dk-cart-line {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "product product"
      "qty price";
    gap: 10px 12px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #e8e8e8;
    background: #fafafa;
  }

  body.dk-store .dk-cart-table td {
    display: block;
    border: 0;
    padding: 0;
  }

  body.dk-store .dk-cart-table td:first-child {
    grid-area: product;
  }

  body.dk-store .dk-cart-table td:nth-child(2) {
    grid-area: qty;
    align-self: center;
  }

  body.dk-store .dk-cart-table td:nth-child(3) {
    grid-area: price;
    align-self: center;
    text-align: right;
    font-weight: 700;
    font-size: 14px;
  }

  .dk-cart-line__product img,
  body.dk-store .dk-cart-table td img {
    width: 56px;
    height: 56px;
  }

  body.dk-store .dk-cart-summary{
    text-align: left;
    padding: 14px;
  }

  body.dk-store .dk-cart-summary .btn--primary{
    width: 100%;
    text-align: center;
  }

  body.dk-store .dk-cart-drawer__panel {
    width: min(100%, 100vw) !important;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  body.dk-store .dk-cart-page{
    padding: 20px 0 44px;
  }

  body.dk-store .dk-cart-table td img {
    width: 72px;
    height: 72px;
  }
}

/* ── Checkout ── */

@media (max-width: 959px) {
  body.dk-store .dk-checkout-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  body.dk-store .dk-checkout-summary {
    position: static;
    order: 0;
    padding: 14px;
  }

  body.dk-store .dk-checkout-page__head {
    flex-wrap: wrap;
    margin-bottom: 16px;
  }

  body.dk-store .dk-checkout-page__logo {
    width: 48px;
    height: 48px;
  }

  body.dk-store .dk-checkout-section__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  body.dk-store .dk-order-line {
    grid-template-columns: 56px 1fr;
    gap: 10px;
  }

  body.dk-store .dk-order-line__thumb {
    width: 56px;
    height: 56px;
  }
}

@media (min-width: 560px) and (max-width: 959px) {
  body.dk-store .dk-checkout-form .form__row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

@media (max-width: 560px) {
  body.dk-store .dk-checkout-form .form__row {
    grid-template-columns: 1fr;
  }

  body.dk-store .checkout-page {
    padding: 12px 0 40px;
  }
}

/* ── Tracking / account / success ── */

  @media (max-width: 639px) {
  body.dk-store .dk-track .status-page__head h1,
  body.dk-store .status-page__head h1 {
    font-size: 1.5rem;
  }

  body.dk-store.lunas-page .lunas-page__inner {
    padding: 0;
  }

  body.dk-store.lunas-page .dk-page-head h1 {
    font-size: 1.5rem;
  }

  body.dk-store.lunas-page .dp-rules {
    padding: 14px;
    margin: 16px 0;
  }

  body.dk-store.success-page .dk-success-page {
    padding: 16px 0 40px;
  }

  body.dk-store .dk-receipt--page {
    padding: 16px 14px;
  }

  body.dk-store .dk-receipt__actions {
    grid-template-columns: 1fr;
  }

  body.dk-store .dk-track__search-pill{
    flex-wrap: wrap;
    border-radius: 12px;
    padding: 8px;
  }

  body.dk-store .dk-track__search-pill .btn{
    width: 100%;
  }

  body.dk-store .dk-track__phone{
    max-width: none;
    width: 100%;
  }

  body.dk-store .dk-account-card{
    padding: 20px 16px;
  }

  body.dk-store .dk-receipt__page-head{
    flex-direction: column;
    align-items: flex-start;
  }

  .dk-receipt__actions,
  body.dk-store .dk-receipt__secondary{
    grid-template-columns: 1fr;
  }

  .dk-receipt__actions .btn,
  body.dk-store .dk-receipt__secondary .btn{
    width: 100%;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .dk-track,
  .dk-success-page,
  body.dk-store .dk-account-page{
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ── Footer ── */

@media (max-width: 719px) {
  body.dk-store .dk-store-footer {
    padding: 40px 0 28px;
    margin-top: 48px;
  }

  body.dk-store .dk-store-footer__grid {
    text-align: left;
    gap: 16px;
  }

  body.dk-store .dk-store-footer__col,
  body.dk-store .dk-store-footer__col--end,
  body.dk-store .dk-store-footer__col--center {
    align-items: flex-start;
    text-align: left;
  }

  body.dk-store .dk-store-footer__powered {
    display: flex;
    justify-content: flex-end;
    text-align: right;
  }
}

body.dk-store .dk-store-footer__powered {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #e8e8e8;
  display: flex;
  justify-content: flex-end;
  text-align: right;
}

body.dk-store .dk-store-footer__powered a {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #999 !important;
  text-decoration: none;
  line-height: 1.2;
}

body.dk-store .dk-store-footer__powered a:hover {
  color: #666;
  text-decoration: underline;
}

/* ── Safe areas (notched phones) ── */

@supports (padding: max(0px)) {
  body.dk-store .dk-store-nav__bar--mobile,
  body.dk-store .dk-announce {
    padding-left: max(var(--dk-gutter), env(safe-area-inset-left));
    padding-right: max(var(--dk-gutter), env(safe-area-inset-right));
  }

  body.dk-store .dk-store-footer {
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
}

/* ── News page ── */

@media (max-width: 639px) {
  body.dk-store .dk-news-grid{
    grid-template-columns: 1fr;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  body.dk-store .dk-news-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Partnership page ── */

@media (max-width: 560px) {
  body.dk-store .dk-partnership-page {
    padding: 32px 0 56px;
  }

  body.dk-store .dk-partnership-form .form__row {
    grid-template-columns: 1fr;
  }
}
