﻿/*
Theme Name: Handmade by Irina
Description: Storefront theme for Handmade by Irina - handmade resin, pressed-flower and sea-glass jewellery. Products are managed in WooCommerce; shop details live in Appearance > Customize > Shop Settings.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: handmade-by-irina
*/
/* ============================================================
   Handmade by Irina â€” storefront styles  (mobile-first)
   ------------------------------------------------------------
   Base rules target phones. min-width breakpoints below
   progressively enhance the layout for tablet & desktop:
     600px  â†’ larger phones / small tablets
     768px  â†’ tablets (nav appears, 2-col product modal)
     1024px â†’ desktop (wider grid, hover reveals)
   ============================================================ */

:root {
  --cream:      #faf6f0;
  --cream-2:    #f3ebdf;
  --ink:        #34302b;
  --ink-soft:   #6f675e;
  --line:       #e6ddcf;
  --terracotta: #c1694f;
  --terracotta-dark: #a9543d;
  --sage:       #8ba17c;
  --whatsapp:   #25d366;
  --whatsapp-dark: #1da851;
  --white:      #ffffff;
  --shadow-sm:  0 2px 10px rgba(52, 48, 43, .06);
  --shadow-md:  0 12px 30px rgba(52, 48, 43, .12);
  --shadow-lg:  0 24px 60px rgba(52, 48, 43, .22);
  --radius:     16px;
  --radius-sm:  10px;
  --ease:       cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

.container {
  width: min(1140px, 100% - 2rem);
  margin-inline: auto;
}

.section-title {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(1.5rem, 6vw, 2.3rem);
  letter-spacing: -.01em;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: .9rem 1.6rem;
  cursor: pointer;
  transition: transform .15s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;          /* comfortable touch target */
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn--primary {
  background: var(--terracotta);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn--whatsapp {
  background: var(--whatsapp);
  color: #fff;
  width: 100%;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(37, 211, 102, .3);
}

.icon-btn {
  background: var(--cream-2);
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink-soft);
  display: grid; place-items: center;
  transition: background .2s var(--ease), color .2s var(--ease);
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 246, 240, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
/* 3 equal-weight columns so the nav is centred on the page, not between the
   brand and the cart (space-between would offset it by half their width gap). */
.header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 60px;
}
/* Columns are pinned explicitly: the nav is display:none on phones, which would
   otherwise pull the cart button into the middle column. */
.header__inner .brand { grid-column: 1; justify-self: start; }
.header__inner .nav { grid-column: 2; justify-self: center; }
.header__inner .cart-btn { grid-column: 3; justify-self: end; }
.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  font-weight: 600;
}
.brand__mark { color: var(--terracotta); font-size: 1.2rem; }

.nav { display: none; gap: 1.6rem; }      /* hidden on phones */
.nav__link {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .95rem;
  position: relative;
  cursor: pointer;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 2px;
  background: var(--terracotta);
  transition: width .25s var(--ease);
}

.cart-btn {
  position: relative;
  background: var(--cream-2);
  border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s var(--ease), transform .15s var(--ease);
}
.cart-btn.pulse { animation: pulse .4s var(--ease); }
@keyframes pulse { 50% { transform: scale(1.18); } }

.cart-btn__count {
  position: absolute;
  top: -3px; right: -3px;
  background: var(--terracotta);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  min-width: 20px; height: 20px;
  border-radius: 999px;
  display: grid; place-items: center;
  padding: 0 5px;
  border: 2px solid var(--cream);
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--cream-2), var(--cream));
  padding: clamp(2.5rem, 9vw, 6rem) 0 clamp(2.5rem, 8vw, 5rem);
  text-align: center;
}
.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .72rem;
  font-weight: 600;
  color: var(--terracotta);
  margin-bottom: .9rem;
}
.hero__title {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 8vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -.02em;
}
.hero__title br { display: none; }         /* let it flow on phones */
.hero__sub {
  max-width: 540px;
  margin: 1rem auto 0;
  color: var(--ink-soft);
  font-size: 1rem;
}
.hero__cta { margin-top: 1.8rem; }

/* ---------- Shop ---------- */
#shop { padding: clamp(2rem, 8vw, 4.5rem) 0; scroll-margin-top: 64px; }
.shop__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.filters {
  display: flex;
  gap: .5rem;
  width: 100%;
  overflow-x: auto;             /* swipeable filter row on phones */
  padding-bottom: .25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: .5rem 1rem;
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: all .2s var(--ease);
}
.filter.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* 2-up on phones */
  gap: 1rem;
}

/* ---------- Product card ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--cream-2);
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.card__badge {
  position: absolute;
  top: .6rem; left: .6rem;
  background: var(--white);
  color: var(--terracotta);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .26rem .6rem;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.card__quick {
  position: absolute;
  inset: auto .6rem .6rem .6rem;
  background: rgba(255, 255, 255, .95);
  color: var(--ink);
  text-align: center;
  font-weight: 600;
  font-size: .82rem;
  padding: .55rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}
.card__body { padding: .8rem .85rem 1rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.card__cat { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.card__name { font-family: "Fraunces", serif; font-size: 1rem; font-weight: 600; line-height: 1.25; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-top: auto; padding-top: .5rem; }
.card__price { font-weight: 600; font-size: 1rem; }
.card__swatches { display: flex; gap: .25rem; }
.card__swatch { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.08); }
.card__swatch--more { font-size: .68rem; color: var(--ink-soft); width: auto; border: none; }

/* ---------- About ---------- */
.about { background: var(--cream-2); padding: clamp(2.5rem, 9vw, 4.5rem) 0; scroll-margin-top: 64px; }
.about__inner { max-width: 680px; text-align: center; }
.about__inner p { margin-top: 1rem; color: var(--ink-soft); font-size: 1rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 1.5rem 0; }
.footer__inner { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; color: var(--ink-soft); font-size: .9rem; }
.footer__dot { opacity: .5; }
.footer__credit { width: 100%; font-size: .82rem; opacity: .8; }

/* ---------- States ---------- */
.state { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); }
.state h3 { font-family: "Fraunces", serif; margin-bottom: .5rem; }
.state p { margin-top: .5rem; }
.state code {
  background: var(--cream-2);
  padding: .15rem .45rem;
  border-radius: 6px;
  font-size: .85em;
  word-break: break-all;
}

/* ============================================================
   Modal â€” bottom sheet on phones
   ============================================================ */
.modal, .drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.modal[aria-hidden="false"], .drawer[aria-hidden="false"] { visibility: visible; }

.modal__overlay, .drawer__overlay {
  position: absolute; inset: 0;
  background: rgba(40, 36, 32, .5);
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.modal[aria-hidden="false"] .modal__overlay,
.drawer[aria-hidden="false"] .drawer__overlay { opacity: 1; }

.modal__panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--white);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform .35s var(--ease);
}
.modal[aria-hidden="false"] .modal__panel { transform: translateY(0); }
.modal__close { position: absolute; top: .8rem; right: .8rem; z-index: 2; background: rgba(255,255,255,.9); }

.pm { display: flex; flex-direction: column; }
.pm__media { background: var(--cream-2); aspect-ratio: 4 / 3; position: relative; }
.pm__media img { width: 100%; height: 100%; object-fit: cover; }
.pm__thumbs {
  position: absolute; left: .5rem; right: .5rem; bottom: .5rem;
  display: flex; gap: .4rem; overflow-x: auto; padding: .2rem;
  scrollbar-width: none;
}
.pm__thumbs::-webkit-scrollbar { display: none; }
.pm__thumb {
  flex: 0 0 auto;
  width: 54px; height: 54px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0; background: var(--white);
  cursor: pointer;
  transition: border-color .18s var(--ease), transform .18s var(--ease);
  box-shadow: var(--shadow-sm);
}
.pm__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm__thumb.is-active { border-color: var(--terracotta); }
.pm__info { padding: 1.4rem 1.3rem calc(1.4rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: .65rem; }
.pm__category { font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.pm__name { font-family: "Fraunces", serif; font-size: 1.5rem; font-weight: 600; line-height: 1.15; }
.pm__price { font-size: 1.25rem; font-weight: 600; color: var(--terracotta); }
.pm__desc { color: var(--ink-soft); font-size: .95rem; }
.pm__group { margin-top: .2rem; }
.pm__label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
.pm__chosen { font-weight: 400; color: var(--ink-soft); }

.swatches { display: flex; flex-wrap: wrap; gap: .55rem; }
.swatch {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid var(--white);
  outline: 2px solid var(--line);
  cursor: pointer;
  transition: outline-color .2s var(--ease), transform .15s var(--ease);
}
.swatch.is-active { outline-color: var(--ink); }

.sizes { display: flex; flex-wrap: wrap; gap: .5rem; }
.size {
  min-width: 52px;
  min-height: 44px;
  padding: .5rem .9rem;
  border: 1.5px solid var(--line);
  background: var(--white);
  border-radius: var(--radius-sm);
  font: inherit; font-size: .92rem; font-weight: 500;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.size.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty__btn { width: 46px; height: 46px; border: none; background: var(--white); font-size: 1.3rem; cursor: pointer; color: var(--ink); transition: background .15s var(--ease); }
.qty__num { min-width: 38px; text-align: center; font-weight: 600; }

.pm__add { margin-top: .7rem; }
.pm__hint { color: var(--terracotta); font-size: .85rem; font-weight: 500; }

/* ============================================================
   Cart drawer â€” full width on phones
   ============================================================ */
.drawer__panel {
  position: absolute;
  top: 0; right: 0;
  height: 100%;
  width: 100%;
  background: var(--cream);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s var(--ease);
}
.drawer[aria-hidden="false"] .drawer__panel { transform: translateX(0); }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.drawer__head h3 { font-family: "Fraunces", serif; font-weight: 600; font-size: 1.25rem; }
.drawer__body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 1rem; }

.cart-line { display: grid; grid-template-columns: 60px 1fr auto; gap: .8rem; align-items: start; }
.cart-line__img { width: 60px; height: 60px; border-radius: var(--radius-sm); object-fit: cover; background: var(--cream-2); }
.cart-line__name { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.cart-line__meta { font-size: .8rem; color: var(--ink-soft); margin-top: .15rem; }
.cart-line__price { font-weight: 600; font-size: .9rem; margin-top: .3rem; }
.cart-line__right { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.cart-line__remove { background: none; border: none; color: var(--ink-soft); cursor: pointer; font-size: .8rem; text-decoration: underline; padding: 0; }
.miniqty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); }
.miniqty button { width: 32px; height: 32px; border: none; background: none; cursor: pointer; font-size: 1.1rem; color: var(--ink); }
.miniqty span { min-width: 22px; text-align: center; font-size: .85rem; font-weight: 600; }

.cart-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; color: var(--ink-soft); padding: 2rem; }

.drawer__foot { border-top: 1px solid var(--line); padding: 1.1rem 1.2rem calc(1.2rem + env(safe-area-inset-bottom)); background: var(--cream); }
.cart-total { display: flex; align-items: center; justify-content: space-between; font-size: 1.05rem; margin-bottom: .3rem; }
.cart-total strong { font-family: "Fraunces", serif; font-size: 1.3rem; }
.cart-note { font-size: .8rem; color: var(--ink-soft); margin-bottom: 1rem; }
.checkout { display: flex; flex-direction: column; gap: .7rem; }
.input {
  font-family: inherit;
  font-size: 16px;            /* 16px stops iOS from auto-zooming on focus */
  width: 100%;
  padding: .8rem .9rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  resize: vertical;
}
.input:focus { outline: none; border-color: var(--terracotta); }
.input::placeholder { color: #b3a999; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 150%);
  background: var(--ink);
  color: #fff;
  padding: .8rem 1.2rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 80;
  opacity: 0;
  transition: transform .35s var(--ease), opacity .35s var(--ease);
  pointer-events: none;
  max-width: calc(100vw - 2rem);
  text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ============================================================
   â‰¥ 600px â€” larger phones / small tablets
   ============================================================ */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.3rem; }
  .shop__head { flex-direction: row; align-items: center; justify-content: space-between; }
  .filters { width: auto; flex-wrap: wrap; overflow: visible; }
  .footer__credit { width: auto; margin-left: auto; }
  .hero__title br { display: inline; }

  /* cart becomes a side drawer instead of full screen */
  .drawer__panel { width: min(420px, 100vw); }
}

/* ============================================================
   â‰¥ 768px â€” tablets
   ============================================================ */
@media (min-width: 768px) {
  .nav { display: flex; }
  .header__inner { height: 68px; }
  .brand { font-size: 1.3rem; }

  .card__body { padding: 1rem 1.1rem 1.2rem; }
  .card__name { font-size: 1.12rem; }
  .card__cat { font-size: .76rem; }

  /* product modal becomes a centered dialog with side-by-side layout */
  .modal__panel {
    left: 50%; top: 50%; right: auto; bottom: auto;
    width: min(880px, 94vw);
    border-radius: var(--radius);
    transform: translate(-50%, -46%);
    opacity: 0;
    transition: opacity .3s var(--ease), transform .3s var(--ease);
  }
  .modal[aria-hidden="false"] .modal__panel { transform: translate(-50%, -50%); opacity: 1; }
  .modal__close { background: rgba(255,255,255,.85); }
  .pm { display: grid; grid-template-columns: 1fr 1fr; }
  .pm__media { aspect-ratio: 1 / 1; }
  .pm__info { padding: 2rem; gap: .7rem; }
  .pm__name { font-size: 1.7rem; }
  .pm__price { font-size: 1.3rem; }
}

/* ============================================================
   â‰¥ 1024px â€” desktop
   ============================================================ */
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.6rem; }
}

/* ============================================================
   Hover-capable devices only (no sticky hover on touchscreens)
   ============================================================ */
@media (hover: hover) {
  .btn--primary:hover { background: var(--terracotta-dark); }
  .btn--ghost:hover { background: var(--cream-2); }
  .btn--whatsapp:hover { background: var(--whatsapp-dark); }
  .icon-btn:hover { background: var(--line); color: var(--ink); }
  .nav__link:hover { color: var(--ink); }
  .nav__link:hover::after { width: 100%; }
  .cart-btn:hover { background: var(--line); }
  .filter:hover { border-color: var(--terracotta); color: var(--ink); }
  .swatch:hover { transform: scale(1.08); }
  .size:hover { border-color: var(--terracotta); }
  .qty__btn:hover { background: var(--cream-2); }
  .miniqty button:hover { color: var(--terracotta); }
  .cart-line__remove:hover { color: var(--terracotta); }
  .footer__inner a:hover { color: var(--terracotta); }

  .card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
  .card:hover .card__media img { transform: scale(1.06); }

  /* reveal "Quick view" on hover instead of always showing it */
  .card__quick { opacity: 0; transform: translateY(8px); transition: all .25s var(--ease); }
  .card:hover .card__quick { opacity: 1; transform: translateY(0); }
}

