/* ======= CSS RESET AND NORMALIZATION ======= */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  box-sizing: border-box;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1.5;
  background: #fff;
  color: #232323;
}
ol, ul {
  list-style: none;
}
a {
  background-color: transparent;
  color: inherit;
  text-decoration: none;
}
img {
  border: none;
  max-width: 100%;
  display: block;
  height: auto;
}
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* ======= BRAND & CSS VARIABLES / FALLBACKS ======= */
:root {
  --color-black: #191919;
  --color-dark: #232323;
  --color-mid: #5a5a5a;
  --color-grey: #dadada;
  --color-light: #f8f8f8;
  --color-white: #fff;
  /* Brand Palette */
  --primary: #191919;
  --secondary: #5A4327;
  --accent: #FDF6ED;
  --button-text: #191919;
  --button-bg: #fff;
  --button-border: #232323;
  --hover-bg: #232323;
  --hover-text: #fff;
  --shadow: 0 4px 20px rgba(40,40,40,0.08), 0 1.5px 6px rgba(10,10,10,0.07);
  --radius-lg: 22px;
  --radius-md: 12px;
  --radius-sm: 7px;
}

/* ======= FONTS ======= */
@import url('https://fonts.googleapis.com/css?family=Merriweather:700,900&display=swap');
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700&display=swap');
body {
  font-family: 'Open Sans', Arial, Helvetica, sans-serif;
  font-size: 16px;
  background: var(--color-white);
  color: var(--primary);
}
h1, h2, h3, h4, .cta-btn {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.5px;
}
h1 { font-size: 2.7rem; line-height: 1.13; margin-bottom: 20px; }
h2 { font-size: 2rem; margin-bottom: 20px; font-weight: 900; }
h3 { font-size: 1.22rem; font-weight: 700; margin-bottom: 8px; }
h4, h5, h6 { font-size: 1rem; font-weight: 700; }
p, ul, ol, li, span, blockquote, small {
  font-family: 'Open Sans', Arial, Helvetica, sans-serif;
  color: var(--primary);
}
p { font-size: 1rem; margin-bottom: 14px; }
blockquote {
  font-style: italic;
  padding: 18px 30px;
  margin: 22px 0;
  border-left: 4px solid var(--secondary);
  background: var(--accent);
  color: var(--secondary);
  border-radius: var(--radius-sm);
}
small { font-size: 0.86rem; color: var(--color-mid); }

/* ======= LAYOUT (FLEXBOX ONLY) ======= */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
.content-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: flex-start;
}

.section {
  margin-bottom: 60px;
  padding: 40px 20px;
  background: none;
  border-radius: var(--radius-lg);
}

.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 20px;
}
.card {
  margin-bottom: 20px;
  position: relative;
  background: var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  min-width: 250px;
  max-width: 340px;
  flex: 1 1 260px;
  transition: box-shadow 0.28s, transform 0.22s;
}
.card:hover { box-shadow: 0 8px 30px rgba(40,40,40,0.14); transform: translateY(-4px) scale(1.017); }

.content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.text-image-section {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}
.testimonial-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  padding: 20px 30px 20px 22px;
  margin-bottom: 20px;
  background: var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--secondary);
}
.testimonial-card p {
  font-size: 1.18rem;
  font-style: italic;
  margin-bottom: 0.5em;
  color: var(--color-dark);
}
.testimonial-card span {
  font-size: 0.96rem;
  color: var(--color-mid);
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}

/* ===== GRID-LIKE FLEX LISTS ===== */
.feature-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: flex-start;
}
.feature-grid li {
  background: var(--accent);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  flex: 1 1 235px;
  min-width: 220px;
  padding: 22px 18px 16px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.feature-grid li img {
  width: 36px; height: 36px; margin-bottom: 10px; filter: grayscale(0.85) contrast(1.1);
}
.feature-grid h3 {
  font-size: 1.09rem;
  color: var(--secondary);
  margin-bottom: 7px;
}
.feature-grid p {
  font-size: 0.98rem;
  color: var(--color-dark);
  margin-bottom: 0;
}

/* ===== SPECIAL FLEX SECTIONS ===== */
.features-row, .tips-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: flex-start;
}
.features-row > div, .tips-grid > div {
  background: var(--color-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 24px 20px;
  min-width: 200px;
  flex: 1 1 200px;
  margin-bottom: 20px;
}
.features-row img, .tips-grid img { width: 32px; height: 32px; margin-bottom: 9px; filter: grayscale(0.85) contrast(1.25); }
.features-row strong, .tips-grid strong { font-family: 'Merriweather', serif; font-weight: 700; font-size: 1.07rem; color: var(--secondary); }

/* ===== GENERAL SPACING & TYPOGRAPHY ===== */
main section {
  margin-bottom: 60px;
  padding: 0;
}
section {
  width: 100%;
}
ul, ol {
  padding-left: 22px;
}
ul li, ol li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.text-section ul {
  padding-left: 22px;
}

.text-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.text-section h2 {
  margin-top: 20px;
}
.text-section ul, .text-section ol {
  padding-left: 22px;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding-left: 0;
  margin-bottom: 14px;
}
.contact-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: var(--primary);
}
.contact-list img { width: 18px; height: 18px; filter: grayscale(1) contrast(1.08); }

/* ===== BUTTONS ===== */
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 38px;
  margin-top: 11px;
  font-size: 1.19rem;
  font-weight: 700;
  font-family: 'Merriweather', serif;
  color: var(--button-text);
  background: var(--button-bg);
  border: 2px solid var(--secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s, color 0.25s, box-shadow 0.22s, transform 0.13s;
  outline: none;
}
.cta-btn:hover, .cta-btn:focus {
  background: var(--secondary);
  color: var(--hover-text);
  border-color: var(--secondary);
  box-shadow: 0 8px 30px rgba(40,40,40,0.16);
  transform: translateY(-2px);
}

button,
input[type="button"],
input[type="submit"],
.mobile-menu-toggle,
.mobile-menu-close,
.cookie-banner button,
.cookie-modal button {
  font-family: 'Open Sans', Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
  background: var(--color-white);
  border: 2px solid var(--secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 0.75em 1.75em;
  transition: background 0.2s, color 0.2s, border 0.18s;
}
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
.mobile-menu-toggle:hover,
.mobile-menu-close:hover,
.cookie-banner button:hover,
.cookie-modal button:hover {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

/* ===== HEADER ===== */
header {
  background: var(--color-white);
  box-shadow: 0 2px 20px rgba(30,30,30,0.06);
  position: relative;
  width: 100%;
  z-index: 120;
}
header .container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding-top: 13px;
  padding-bottom: 13px;
}
header img {
  height: 44px;
  width: auto;
  margin-right: 18px;
}
.main-nav {
  display: flex;
  flex-direction: row;
  gap: 22px;
  align-items: center;
}
.main-nav a {
  font-size: 1rem;
  font-family: 'Open Sans', Arial, sans-serif;
  font-weight: 600;
  color: var(--secondary);
  opacity: 0.88;
  transition: color 0.19s, opacity 0.22s;
  padding: 2px 1px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a:focus {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  opacity: 1;
}

/* ===== MOBILE NAVIGATION ===== */
.mobile-menu-toggle {
  display: none;
  background: var(--secondary);
  color: #fff;
  border: none;
  font-size: 2.13rem;
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  z-index: 130;
}
.mobile-menu {
  position: fixed;
  top: 0; left: 0; height: 100vh; width: 90vw; max-width: 340px;
  background: var(--color-white);
  box-shadow: 6px 0 28px rgba(22,22,22,0.24);
  transform: translateX(-100%);
  transition: transform 0.41s cubic-bezier(0.74,0.03,0.42,1.05);
  z-index: 1110;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 38px 25px 28px 25px;
}
.mobile-menu.open {
  transform: translateX(0);
}
.mobile-menu-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  color: var(--secondary);
  border: none;
  font-size: 2.1rem;
  padding: 6px 12px;
  cursor: pointer;
  z-index: 1500;
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 21px;
  margin-top: 32px;
  width: 100%;
}
.mobile-nav a {
  font-size: 1.14rem;
  font-family: 'Open Sans', Arial, sans-serif;
  font-weight: 700;
  color: var(--primary);
  padding: 11px 6px;
  border-radius: var(--radius-md);
  transition: background 0.17s, color 0.2s;
}
.mobile-nav a:hover, .mobile-nav a:focus {
  background: var(--secondary);
  color: #fff;
}

/* ===== MOBILE MENU OVERLAY ===== */
.mobile-menu-overlay {
  position: fixed;
  z-index: 1100;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.23);
  opacity: 1;
  transition: opacity 0.23s;
}
.mobile-menu:not(.open) + .mobile-menu-overlay {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1024px) {
  .main-nav {
    gap: 13px;
  }
}
@media (max-width: 768px) {
  header .container {
    flex-direction: row;
    justify-content: space-between;
    gap: 5px;
  }
  .main-nav {
    display: none;
  }
  .cta-btn {
    margin-left: auto;
  }
  .mobile-menu-toggle {
    display: inline-flex;
    position: relative;
  }
}

/* ===== HERO / SECTIONS ===== */
main {
  min-height: 500px;
  padding-bottom: 50px;
  margin-top: 0;
}
section {
  margin-bottom: 60px;
}
.section:last-child { margin-bottom: 0; }

/* ===== FOOTER ===== */
footer {
  background: var(--color-light);
  padding: 45px 0 18px 0;
  border-top: 1.5px solid var(--color-grey);
}
footer .container {
  display: flex;
  flex-direction: column;
}
.footer-social {
  display: flex;
  flex-direction: row;
  gap: 15px;
  margin-top: 13px;
}
.footer-social a img {
  width: 25px; height: 25px;
  filter: grayscale(0.8) contrast(1.25);
  transition: filter 0.18s;
}
.footer-social a:hover img { filter: grayscale(0.1) contrast(1.44); }
.footer-menu {
  display: flex;
  flex-direction: row;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.footer-menu a {
  color: var(--secondary);
  font-size: 1rem;
  font-weight: 600;
  transition: color 0.23s;
}
.footer-menu a:hover { color: var(--primary); text-decoration: underline; }
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 7px;
}
.footer-contact p {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: var(--primary);
}
.footer-newsletter {
  margin-bottom: 4px;
}
.footer-newsletter small { color: var(--color-mid); font-size: 0.92rem; }

footer .content-wrapper {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 32px 64px;
  align-items: flex-start;
  justify-content: flex-start;
}
footer .content-wrapper > * {
  min-width: 140px;
}
footer img[alt='Rustykalny Blask'], footer img[alt='Rustykalny Blask logo'] {
  width: 58px; height: auto; margin-bottom: 8px;
}

@media (max-width: 1024px) {
  footer .content-wrapper {
    gap: 20px 28px;
  }
}
@media (max-width: 800px) {
  footer .content-wrapper {
    flex-wrap: wrap;
    flex-direction: column;
    gap: 22px;
  }
  .footer-menu {
    gap: 12px;
    margin-bottom: 8px;
  }
}

/* ===== COOKIE CONSENT BANNER ===== */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--color-white);
  border-top: 1.5px solid var(--secondary);
  box-shadow: 0 -4px 32px rgba(40,40,40,0.10);
  z-index: 3020;
  padding: 21px 16px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
  max-width: 100vw;
  transition: transform 0.37s cubic-bezier(.41,1.1,.86,1.02), opacity 0.18s;
}
.cookie-banner.hide {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}
.cookie-banner .cookie-content {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 12px;
}
.cookie-banner .cookie-buttons {
  display: flex;
  flex-direction: row;
  gap: 13px;
  margin-top: 0;
}
.cookie-banner button {
  padding: 10px 22px;
  font-size: 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--secondary);
  background: var(--color-white);
  color: var(--secondary);
}
.cookie-banner button.accept {
  background: var(--secondary);
  color: #fff;
}
.cookie-banner button.reject {
  border-color: var(--color-mid);
  color: var(--color-mid);
  background: var(--color-light);
}
.cookie-banner button.settings {
  border-color: var(--color-mid);
  color: var(--secondary);
  background: var(--color-white);
}
.cookie-banner button:hover, .cookie-banner button:focus {
  box-shadow: 0 3px 11px rgba(120,120,120,0.09);
}

/* ===== COOKIE PREFERENCES MODAL ===== */
.cookie-modal-overlay {
  position: fixed; left: 0; right:0; top:0; bottom:0;
  background: rgba(30,30,30,0.18);
  z-index: 4000;
  transition: opacity 0.22s;
}
.cookie-modal {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-white);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  padding: 36px 24px 28px 26px;
  min-width: 330px;
  max-width: 90vw;
  z-index: 4010;
  display: flex;
  flex-direction: column;
  gap: 17px;
  animation: cookieModalFadeIn 0.32s cubic-bezier(.26,.97,.98,.43);
}
@keyframes cookieModalFadeIn {
  from { transform: translate(-50%, -55%); opacity: 0; }
  to   { transform: translate(-50%, -50%); opacity: 1; }
}
.cookie-modal h2 {
  font-size: 1.37rem;
}
.cookie-modal .cookie-categories {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 8px;
}
.cookie-modal .cookie-category {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  padding: 11px 0;
  border-bottom: 1px solid var(--color-grey);
}
.cookie-modal .cookie-category:last-child {
  border-bottom: 0;
}
.cookie-modal .cookie-toggle {
  margin-left: auto;
}
.cookie-modal .cookie-toggle input[type="checkbox"] { accent-color: var(--secondary); width: 18px; height: 18px; }
.cookie-modal .cookie-category .desc { margin-bottom: 0; color: var(--color-mid); font-size: 0.96rem; }
.cookie-modal .modal-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: row;
  gap: 13px;
}
.cookie-modal button {
  padding: 10px 19px;
  font-size: 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--secondary);
  background: var(--secondary);
  color: #fff;
}
.cookie-modal button.secondary {
  background: var(--color-white);
  color: var(--secondary);
  border-color: var(--secondary);
}

/* ===== ANIMATIONS & MICRO-INTERACTIONS ===== */
.card, .testimonial-card, .feature-grid li, .features-row > div, .tips-grid > div {
  transition: box-shadow 0.18s, transform 0.17s, filter 0.17s;
}
.card:hover, .feature-grid li:hover, .features-row > div:hover, .tips-grid > div:hover {
  box-shadow: 0 8px 30px rgba(65,65,68,0.16) !important;
  transform: translateY(-6px) scale(1.01);
}

.cta-btn:active {
  transform: scale(0.97);
}

/* ===== FORMS (if needed) ===== */
input[type="text"], input[type="email"], textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--color-grey);
  border-radius: var(--radius-md);
  background: var(--color-white);
  margin-bottom: 15px;
  font-size: 1rem;
  transition: border 0.17s;
}
input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
  border-color: var(--secondary);
  outline: none;
}

/* ======= RESPONSIVE BREAKPOINTS ======= */
@media (max-width: 1150px) {
  .container { max-width: 1000px; }
  .content-wrapper { gap: 27px; }
}
@media (max-width: 900px) {
  h1 { font-size: 2.1rem; }
}
@media (max-width: 800px) {
  .container { max-width: 94vw; }
  .section, main section { padding-left: 8px; padding-right: 8px; }
  .content-wrapper, .card-container, .content-grid, .features-row, .tips-grid {
    gap: 16px;
  }
  .feature-grid { gap: 14px; }
}
@media (max-width: 768px) {
  html { font-size: 15px; }
  .container { max-width: 99vw; padding-left: 2vw; padding-right: 2vw; }
  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.19rem; }
  .content-wrapper, .card-container, .content-grid, .features-row, .tips-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .card, .feature-grid li, .features-row > div, .tips-grid > div {
    min-width: 90vw;
    width: 100%;
    max-width: 100vw;
    padding: 17px 10px;
  }
  main section { margin-bottom: 42px; }
}
@media (max-width: 520px) {
  .section, main section {
    padding-left: 0px; padding-right: 0px;
  }
  html { font-size: 14px; }
  .testimonial-card, .card, .feature-grid li {
    padding-left: 8px; padding-right: 8px;
  }
}

/* ======= ACCESSIBILITY ======= */
a:focus, button:focus, input:focus {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
  z-index: 70;
}

/* ======= SPECIAL UTILITY CLASSES ======= */
.hide { display: none !important; }

/* ======= PRINT OPTIMIZATION ======= */
@media print {
  header, footer, .cookie-banner, .mobile-menu { display: none !important; }
  main { padding: 0; }
}
