/* Global styles shared across all userside pages */
:root {
  --primary: #2e8b46;
  --primary-hover: #1f6b32;
  --primary-soft: #e5efe6;
  --primary-gradient: linear-gradient(
    135deg,
    #56b86e 0%,
    #2e8b46 48%,
    #1a5c28 100%
  );
  --primary-gradient-hover: linear-gradient(
    135deg,
    #6bc982 0%,
    #358f4f 48%,
    #226b38 100%
  );
  --accent: #1e3a8a;
  --success: #258635;
  --danger: #ba1b1b;
  --warning: #c97700;

  --bg: #f8faf8;
  --card-bg: #ffffff;
  --nav-bg: #ffffff;
  --soft-bg: #edf2eb;
  --hover-bg: #e4ebe2;
  --text: #222222;
  --text-dim: #595959;
  --text-mute: #8a8a8a;
  --border: #dde5da;
  --border-strong: #c4cec3;
  --input-bg: #ffffff;

  --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.04);
  --shadow-md: 0 6px 18px rgba(20, 20, 20, 0.08);
  --shadow-lg: 0 14px 36px rgba(20, 20, 20, 0.14);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --font-sans:
    "Helvetica Neue", "Segoe UI", Roboto, "Open Sans", Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", "Iowan Old Style", serif;

  --shop-header-height: 64px;
  --shop-filter-gap: 12px;
  --shop-sticky-top: 64px;
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: clip;
}

html {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  margin: 0;
  padding: 0;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 12px;
}

h1 {
  font-size: 32px;
  font-weight: 700;
}
h2 {
  font-size: 24px;
  font-weight: 600;
}
h3 {
  font-size: 18px;
  font-weight: 600;
}

a {
  color: var(--text);
  text-decoration: none;
}
a:hover {
  color: var(--primary);
}

.page-wrapper {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-wrapper > main,
.page-wrapper > .static-page-main,
.page-wrapper > .about-main {
  flex: 1 0 auto;
}

body.page-custom-order > .custom-order-main {
  flex: 1 0 auto;
}

body.page-main-menu > .shop-content-zone {
  flex: 1 0 auto;
  width: 100%;
}

/* Header */
header {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.container-header-main {
  display: grid;
  grid-template-areas: "logo Search Account";
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  padding: 5px 32px;
  max-width: 1240px;
  margin: 0 auto;
  align-items: center;
}

.header-logo {
  grid-area: logo;
  display: block;
  line-height: 0;
  flex-shrink: 0;
}

.header-logo img {
  width: 120px;
  height: 52px;
  object-fit: contain;
  display: block;
  border-radius: 6px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.header-logo:hover img {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(30, 90, 45, 0.18);
}

.header-search {
  grid-area: Search;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 720px;
  justify-self: center;
}

.header-search input {
  width: 100%;
  padding: 12px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: 0.2s;
}

.header-search input::placeholder {
  color: var(--text-mute);
}

.header-search input:focus {
  background: #fff;
  border-color: var(--text);
  box-shadow: 0 0 0 4px rgba(34, 34, 34, 0.08);
}

.header-search-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.header-search-link:hover {
  border-color: var(--text);
  color: var(--text);
  text-decoration: none;
}

.header-account {
  grid-area: Account;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  white-space: nowrap;
}

.header-account-primary {
  display: contents;
}

.header-account .btn-primary {
  padding: 10px 22px;
  font-size: 14px;
}

.btn-account {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: 0.2s;
}

.btn-account:hover {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.header-account-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--primary);
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: 0.2s;
  box-sizing: border-box;
}

.header-account-name:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
}

.header-orders-group {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
}

.header-orders-group__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  text-decoration: none;
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.header-orders-group__item + .header-orders-group__item {
  border-left: 1px solid var(--border-strong);
}

.header-orders-group__item:hover {
  background: var(--soft-bg);
  color: var(--text);
  text-decoration: none;
}

.header-orders-group__item.is-active {
  background: var(--text);
  color: #fff;
}

.header-orders-group__item.is-active:hover {
  background: var(--text);
  color: #fff;
}

.btn-account--logout {
  color: var(--danger);
}

.btn-account--logout:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.account-signout-box {
  margin-top: 24px;
}

/* Footer */
footer,
.site-footer {
  flex-shrink: 0;
  margin-top: auto;
  text-align: center;
  padding: 40px 20px 32px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  background: var(--soft-bg);
  font-size: 13px;
  box-sizing: border-box;
}

.page-wrapper > .site-footer,
.page-wrapper > footer.site-footer {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

body > .site-footer,
body > footer.site-footer {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

@media (max-width: 768px) {
  .page-wrapper > header {
    width: calc(100% + 32px);
    max-width: none;
    margin-left: -16px;
    margin-right: -16px;
  }
}

.site-footer-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}

.site-footer-nav a {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.site-footer-nav a:hover {
  color: var(--primary);
}

.site-footer-nav a[aria-current="page"] {
  color: var(--primary);
}

/* Forms and inputs */
.form-group {
  margin-bottom: 16px;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  box-sizing: border-box;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: 0.15s;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-mute);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(34, 34, 34, 0.1);
}

/* Buttons */
.btn-primary {
  background: var(--text);
  color: #fff;
  border: none;
  padding: 12px 26px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.btn-primary:hover {
  background: #000;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Authentication modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(34, 34, 34, 0.55);
  backdrop-filter: blur(2px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.is-open {
  display: flex;
}

.auth-container {
  background: var(--card-bg);
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.close-modal {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
}

.close-modal:hover {
  background: var(--soft-bg);
  color: var(--text);
}

/* Site notice modal (replaces browser alert on customer pages) */
.site-notice-container {
  text-align: center;
}

.site-notice-title {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.25;
}

.site-notice-message {
  margin: 0 0 24px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
}

.site-notice-confirm {
  width: 100%;
  margin-top: 0;
}

.site-notice-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-notice-modal.is-confirm .site-notice-actions {
  flex-direction: row;
}

.site-notice-modal.is-confirm .site-notice-cancel,
.site-notice-modal.is-confirm .site-notice-confirm {
  flex: 1;
  width: auto;
  margin-top: 0;
}

.site-notice-modal.is-confirm .site-notice-confirm {
  background: var(--danger);
  border-color: var(--danger);
}

.site-notice-modal.is-confirm .site-notice-confirm:hover {
  filter: brightness(0.92);
}

.site-notice-modal[data-variant="error"] .site-notice-title {
  color: var(--danger);
}

.site-notice-modal[data-variant="success"] .site-notice-title {
  color: var(--success);
}

.auth-nav {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.auth-nav button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 0 12px;
  margin-bottom: -1px;
  font-family: inherit;
}

.auth-nav button.active-nav {
  color: var(--text);
  border-bottom: 2px solid var(--text);
}

.auth-login-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 20px;
}

.auth-login-method {
  background: var(--soft-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
}

.auth-login-method.is-active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.auth-login-panel[hidden] {
  display: none !important;
}

.auth-section {
  display: none;
}
.auth-section.active {
  display: block;
}

.auth-forgot-link,
.auth-back-link {
  display: block;
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

.auth-forgot-link {
  text-align: right;
  margin: 8px 0 12px;
}

.auth-back-link {
  width: 100%;
  text-align: center;
  margin-top: 14px;
  color: var(--text-dim);
}

.auth-forgot-link:hover,
.auth-back-link:hover {
  text-decoration: underline;
}

.auth-section-hint {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 20px;
  line-height: 1.5;
}

.auth-inline-error,
.auth-inline-success {
  text-align: center;
  font-size: 14px;
  margin: 0 0 10px;
}

.auth-inline-error {
  color: var(--danger);
}

.auth-inline-success {
  color: var(--success);
}

.auth-section-submit {
  width: 100%;
  margin-top: 10px;
}

.auth-container h2 {
  color: var(--text);
  margin-top: 0;
  font-size: 24px;
  margin-bottom: 18px;
}

/* Shared content layout */
.product-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  background: var(--card-bg);
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 40px;
  box-shadow: var(--shadow-sm);
}

.info-box {
  border: 1px solid var(--border);
  padding: 18px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  background: var(--soft-bg);
}

.section-title {
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: none;
  padding-bottom: 0;
}

.product-desc {
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 15px;
  margin: 0;
}

.product-container--single {
  grid-template-columns: 1fr;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.product-container--basket {
  gap: 0;
}

.basket-checkout {
  margin-top: 0;
}

.basket-checkout .order-footer {
  margin-top: 0;
  padding-top: 20px;
}

.account-field {
  margin-bottom: 15px;
}

.account-field-label {
  display: block;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.account-field-value {
  font-size: 16px;
  margin-top: 5px;
  word-break: break-word;
}

.account-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 24px;
  font-size: 14px;
}

.account-links a {
  color: var(--primary-hover);
  font-weight: 600;
}

.account-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.btn-full-width {
  width: 100%;
  margin-top: 10px;
}

.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
}

.cookie-consent p {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
  max-width: 640px;
}

.cookie-consent-accept {
  flex-shrink: 0;
  padding: 10px 22px;
}

@media (max-width: 768px) {
  header {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 16px;
  }

  .page-wrapper {
    padding: 0 16px;
  }

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 20px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .btn-primary {
    padding: 11px 20px;
    font-size: 14px;
  }

  .product-container {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 20px 16px;
    margin-bottom: 24px;
    border-radius: var(--radius-md);
  }

  .product-container.product-container--single {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .info-box {
    padding: 16px;
  }

  .product-container--single {
    gap: 16px;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .auth-container {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92dvh;
    overflow-y: auto;
    padding: 28px 20px calc(24px + env(safe-area-inset-bottom, 0));
    -webkit-overflow-scrolling: touch;
  }

  .auth-nav {
    gap: 16px;
    margin-bottom: 20px;
  }

  .cookie-consent {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0));
    gap: 12px;
  }

  .cookie-consent-accept {
    width: 100%;
  }

  .header-search-link {
    min-height: 42px;
    padding: 0 12px;
    font-size: 13px;
  }

  .container-header-main {
    grid-template-areas:
      "logo Account"
      "Search Search";
    grid-template-columns: auto minmax(0, 1fr);
    padding: 12px 16px;
    gap: 10px;
    align-items: center;
  }

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

  .header-search input {
    background: #fff;
    border: 1px solid var(--border-strong);
    padding: 11px 16px;
    font-size: 16px;
  }

  .header-account {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "user basket"
      "orders orders";
    gap: 8px;
    align-items: center;
    width: 100%;
    white-space: normal;
  }

  .header-account-name,
  .header-account > .btn-account--sign-in {
    grid-area: user;
    justify-self: stretch;
    min-width: 0;
    max-width: none;
  }

  .header-account > a[href="basket.html"] {
    grid-area: basket;
    justify-self: end;
  }

  .header-orders-group {
    grid-area: orders;
    width: 100%;
  }

  .header-account-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 7px 12px;
    font-size: 12px;
  }

  .header-orders-group__item {
    flex: 1;
    padding: 8px 10px;
    font-size: 11px;
    text-align: center;
  }

  .header-account .btn-account,
  .header-account .btn-primary {
    padding: 7px 12px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .site-footer {
    padding: 28px 16px 24px;
    font-size: 12px;
  }

  .site-footer-nav {
    flex-wrap: wrap;
    gap: 10px 14px;
    line-height: 1.4;
  }

  .account-signout-box .btn-account {
    width: 100%;
    justify-content: center;
  }

  .page-wrapper > footer.site-footer,
  .page-wrapper > .site-footer {
    width: calc(100% + 32px);
    max-width: none;
    margin-left: -16px;
    margin-right: -16px;
  }
}

@media (min-width: 769px) {
  .header-account {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    max-width: none;
  }

  .header-account-name {
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-orders-group {
    width: auto;
    flex-shrink: 0;
  }

  .header-orders-group__item {
    flex: 0 0 auto;
    padding: 9px 16px;
    font-size: 13px;
    text-align: center;
  }
}
