/*
 Theme Name:   Fajna Farma
 Theme URI:    https://fajnafarma.pl
 Description:  Custom child theme for Fajna Farma, built on Storefront.
 Author:       ParoSystems
 Template:     storefront
 Version:      1.0.0
 Text Domain:  fajna-farma
*/

:root {
  --nav-bg: #064e3b;
  --nav-border: #d97706;
  --amber-50: #fffbeb;
  --amber-200: #fde68a;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-800: #065f46;
  --emerald-900: #064e3b;
  --rose-600: #e11d48;
  --stone-400: #a8a29e;
  --stone-500: #78716c;
  --stone-600: #57534e;
  --stone-700: #44403c;
  --stone-800: #292524;
  --stone-900: #1c1917;
  --cream: #FAF6F0;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-serif: 'Merriweather', Georgia, serif;
}

body {
  background-color: #FBF9F4;
  color: var(--stone-800);
  font-family: var(--font-body);
  margin: 0;
}

h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--stone-900); }

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

/* ===================== NAVBAR ===================== */
.ff-nav {
  background-color: var(--nav-bg);
  color: var(--amber-50);
  border-bottom: 4px solid var(--nav-border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.ff-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 5rem;
}
.ff-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--amber-400);
  letter-spacing: -0.01em;
}
.ff-logo:hover { color: var(--amber-500); }
.ff-links {
  display: none;
  align-items: center;
  gap: 2rem;
  font-weight: 500;
}
.ff-links a:hover { color: var(--amber-400); }
@media (min-width: 768px) {
  .ff-links { display: flex; }
  .ff-mobile-toggle { display: none !important; }
}
.ff-cart-btn {
  position: relative;
  background: var(--amber-600);
  color: var(--stone-900);
  border: none;
  padding: 0.65rem;
  border-radius: 9999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.ff-cart-btn:hover { background: var(--amber-500); }
.ff-cart-badge {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  background: var(--rose-600);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  border-radius: 9999px;
  height: 1.5rem;
  width: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--nav-bg);
}
.ff-cart-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 3.5rem;
  background: var(--cream);
  color: var(--stone-800);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  border-radius: 0.75rem;
  border: 1px solid var(--amber-200);
  padding: 1.5rem;
  width: 20rem;
  z-index: 50;
}
.ff-cart-dropdown.open { display: block; }
.ff-cart-dropdown h4 {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--amber-200);
  color: var(--emerald-900);
}
.ff-cart-empty { color: var(--stone-500); font-size: 0.9rem; font-style: italic; text-align: center; padding: 1rem 0; }
.ff-cart-items { max-height: 15rem; overflow-y: auto; margin-bottom: 1rem; }
.ff-cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  border-bottom: 1px solid #f5e6c8;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}
.ff-cart-item strong { display: block; color: var(--stone-700); }
.ff-cart-item .qty { font-size: 0.75rem; color: var(--emerald-700); font-weight: 600; }
.ff-cart-item .remove { color: var(--rose-600); background: none; border: none; cursor: pointer; }
.ff-cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--emerald-900);
  border-top: 1px solid var(--amber-200);
  padding-top: 0.75rem;
  margin-bottom: 1rem;
}
.ff-checkout-btn {
  display: block;
  width: 100%;
  background: var(--emerald-700);
  color: var(--amber-50);
  text-align: center;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.ff-checkout-btn:hover { background: var(--emerald-600); }
.ff-mobile-toggle {
  background: none;
  border: none;
  color: var(--amber-50);
  cursor: pointer;
  padding: 0.5rem;
}
.ff-mobile-menu {
  display: none;
  background: #065f46;
  border-top: 1px solid #047857;
  padding: 0.5rem 1rem 1.5rem;
}
.ff-mobile-menu.open { display: block; }
.ff-mobile-menu a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-weight: 500;
}
.ff-mobile-menu a:hover { background: var(--emerald-700); color: var(--amber-400); }

/* ===================== BUTTONS / PRODUCTS (WooCommerce) ===================== */
.button, button, input[type="submit"],
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button {
  background-color: var(--emerald-700);
  color: #fff;
  border-radius: 0.5rem;
  font-weight: 600;
  border: none;
  padding: 0.7em 1.4em;
}
.woocommerce a.button:hover, .woocommerce button.button:hover { background-color: var(--emerald-800); }
ul.products li.product {
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 0.75rem;
  padding: 1rem;
}
ul.products li.product .price { color: var(--emerald-700); font-weight: 600; }

/* ===================== FOOTER ===================== */
.ff-footer {
  background: var(--stone-900);
  color: var(--stone-400);
  border-top: 4px solid var(--emerald-900);
  margin-top: 5rem;
  padding: 3rem 1.5rem;
  text-align: center;
}
.ff-footer-inner { max-width: 56rem; margin: 0 auto; }
.ff-footer h3 { font-family: var(--font-serif); font-size: 1.5rem; color: var(--amber-50); margin-bottom: 1rem; }
.ff-footer p.tagline { margin-bottom: 1.5rem; font-weight: 300; }
.ff-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin-bottom: 2rem; font-size: 0.9rem; }
.ff-footer-links a:hover { color: var(--amber-500); }
.ff-footer .credit { font-size: 0.75rem; color: var(--stone-700); display: flex; align-items: center; justify-content: center; gap: 0.25rem; }

/* content wrapper spacing */
#content.site-content { max-width: 1280px; margin: 0 auto; padding: 2.5rem 1.5rem; }

/* Remove blog sidebar site-wide - not needed for a shop */
#secondary.widget-area { display: none; }
#primary.content-area { width: 100%; float: none; }
.storefront-full-width-content #primary { width: 100%; }

/* ===================== CART PAGE ===================== */
.woocommerce-cart table.shop_table {
  border: 1px solid var(--stone-400, #e7e5e4);
  border-radius: 0.75rem;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}
.woocommerce-cart table.shop_table th {
  background: var(--emerald-900, #064e3b);
  color: var(--amber-50, #fffbeb);
  font-family: var(--font-serif);
  font-weight: 700;
  padding: 1rem;
}
.woocommerce-cart table.shop_table td {
  padding: 1rem;
  border-bottom: 1px solid #f0ede6;
  vertical-align: middle;
}
.woocommerce-cart .product-remove a {
  color: var(--rose-600, #e11d48) !important;
  font-size: 1.4rem;
}
.woocommerce-cart .quantity input.qty {
  border: 1px solid #e7e5e4;
  border-radius: 0.4rem;
  padding: 0.4rem;
  width: 4rem;
}
.woocommerce-cart .cart-collaterals .cart_totals {
  background: var(--cream, #FAF6F0);
  border: 1px solid var(--amber-200, #fde68a);
  border-radius: 0.75rem;
  padding: 1.5rem;
}
.woocommerce-cart .cart_totals h2 {
  font-family: var(--font-serif);
  color: var(--emerald-900, #064e3b);
  border-bottom: 1px solid var(--amber-200, #fde68a);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.woocommerce-cart .cart_totals .order-total .amount {
  color: var(--emerald-700, #047857);
  font-weight: 700;
  font-size: 1.2rem;
}
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
  background: var(--emerald-700, #047857) !important;
  border-radius: 0.5rem;
  font-weight: 700;
  padding: 1rem !important;
  text-align: center;
}
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
  background: var(--emerald-800, #065f46) !important;
}
.woocommerce a.remove {
  color: var(--rose-600, #e11d48) !important;
}

/* Coupon box */
.woocommerce-cart .coupon input#coupon_code {
  border: 1px solid #e7e5e4;
  border-radius: 0.5rem;
  padding: 0.6rem;
}
.woocommerce-cart .coupon button[name="apply_coupon"] {
  background: var(--stone-700, #44403c) !important;
}

/* ===================== SINGLE PRODUCT PAGE ===================== */
.single-product div.product .product_title {
  font-family: var(--font-serif);
  color: var(--stone-900, #1c1917);
}
.single-product div.product p.price {
  color: var(--emerald-700, #047857) !important;
  font-size: 1.6rem;
  font-weight: 700;
}
.single-product div.product .woocommerce-product-details__short-description {
  color: var(--stone-600, #57534e);
  line-height: 1.6;
}
.single-product form.cart .quantity input.qty {
  border: 1px solid #e7e5e4;
  border-radius: 0.5rem;
  padding: 0.6rem;
  width: 4.5rem;
}
.single-product form.cart button.single_add_to_cart_button {
  background: var(--emerald-700, #047857) !important;
  border-radius: 0.5rem;
  font-weight: 700;
  padding: 0.9rem 2rem !important;
  font-size: 1rem;
}
.single-product form.cart button.single_add_to_cart_button:hover {
  background: var(--emerald-800, #065f46) !important;
}
.single-product .woocommerce-tabs ul.tabs li a {
  font-family: var(--font-serif);
  color: var(--stone-700, #44403c);
}
.single-product .woocommerce-tabs ul.tabs li.active a {
  color: var(--emerald-700, #047857);
}
.woocommerce-message,
.woocommerce-info {
  border-top-color: var(--emerald-700, #047857) !important;
}
.woocommerce-message::before,
.woocommerce-info::before {
  color: var(--emerald-700, #047857) !important;
}

/* ===================== SHOP PAGE HEADER ===================== */
.ff-shop-header {
  background: #FBF9F4;
  padding: 2rem 1.5rem 0;
}
.ff-shop-header-inner {
  max-width: 1280px;
  margin: 0 auto 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}
@media (min-width: 768px) {
  .ff-shop-header-inner { flex-direction: row; align-items: center; }
}
.ff-shop-title {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 2.25rem;
  color: var(--emerald-900, #064e3b);
  letter-spacing: -0.02em;
  margin: 0;
}
.ff-shop-subtitle {
  color: var(--stone-600, #57534e);
  font-weight: 500;
  margin-top: 0.5rem;
}
.ff-back-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--stone-700, #44403c);
  background: #fff;
  border: 1px solid #e7e5e4;
  padding: 0.65rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.ff-back-link:hover { background: #fafaf9; }
.ff-shop-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.ff-shop-content ul.products {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 640px) {
  .ff-shop-content ul.products { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .ff-shop-content ul.products { grid-template-columns: repeat(3, 1fr); }
}

/* ===================== SHOP TOOLBAR ===================== */
.ff-shop-toolbar {
  max-width: 1280px;
  margin: 0 auto 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid #e7e5e4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ff-search-wrap { flex: 1; min-width: 220px; }
#ff-search {
  width: 100%;
  padding: 0.65rem 1rem;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 0.75rem;
  font-weight: 500;
  color: var(--stone-700, #44403c);
}
#ff-search:focus { outline: 2px solid var(--emerald-600, #059669); }
#ff-sort {
  padding: 0.65rem 1rem;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 0.75rem;
  font-weight: 500;
  color: var(--stone-700, #44403c);
  cursor: pointer;
}
.ff-cat-tabs {
  max-width: 1280px;
  margin: 0 auto 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ff-cat-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid #e7e5e4;
  background: #fff;
  color: var(--stone-600, #57534e);
  cursor: pointer;
}
.ff-cat-btn:hover { background: #f5f5f4; }
.ff-cat-btn.active {
  background: var(--emerald-800, #065f46);
  color: #fff;
  border-color: var(--emerald-800, #065f46);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* ===================== PRODUCT CARD ===================== */
.ff-shop-content ul.products li.ff-card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e7e5e4;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.25s ease;
  margin: 0 !important;
  padding: 0 !important;
}
.ff-shop-content ul.products li.ff-card:hover {
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}
.ff-card-image {
  height: 14rem;
  background: #f5f5f4;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ff-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.ff-card-image:hover img { transform: scale(1.05); }
.ff-card-placeholder { font-size: 3rem; }
.ff-badge-sale {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--rose-600, #e11d48);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 0.3rem 0.6rem;
  border-radius: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ff-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.ff-card-cat {
  font-size: 0.65rem;
  color: var(--stone-400, #a8a29e);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 0.4rem;
}
.ff-card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--stone-800, #292524);
  line-height: 1.3;
  margin: 0 0 0.5rem;
}
.ff-card-title a { color: inherit; }
.ff-card-bottom {
  margin-top: auto;
  border-top: 1px solid #f5f5f4;
  padding-top: 1rem;
}
.ff-card-price {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.ff-price-current {
  color: var(--emerald-800, #065f46);
  font-weight: 900;
  font-size: 1.4rem;
}
.ff-price-old {
  color: var(--stone-400, #a8a29e);
  text-decoration: line-through;
  font-weight: 600;
  font-size: 0.85rem;
}
.ff-card-stock { margin-bottom: 1rem; }
.ff-stock {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 0.5rem;
}
.ff-stock-ok { background: #ecfdf5; color: var(--emerald-700, #047857); border: 1px solid #d1fae5; }
.ff-stock-out { background: #fff1f2; color: var(--rose-600, #e11d48); border: 1px solid #ffe4e6; }
.ff-card-cta a.button,
.ff-card-cta a.add_to_cart_button {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--emerald-800, #065f46) !important;
  color: #fff !important;
  padding: 0.8rem !important;
  border-radius: 0.75rem !important;
  font-weight: 700 !important;
}
.ff-card-cta a.button:hover { background: var(--emerald-700, #047857) !important; }

/* ===================== SHOP TOOLBAR ===================== */
.ff-shop-toolbar {
  max-width: 1280px;
  margin: 0 auto 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid #e7e5e4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.ff-search-wrap { flex: 1; min-width: 220px; }
#ff-search {
  width: 100%;
  padding: 0.65rem 1rem;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 0.75rem;
  font-weight: 500;
  color: var(--stone-700, #44403c);
}
#ff-search:focus { outline: 2px solid var(--emerald-600, #059669); }
#ff-sort {
  padding: 0.65rem 1rem;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 0.75rem;
  font-weight: 500;
  color: var(--stone-700, #44403c);
  cursor: pointer;
}
.ff-cat-tabs {
  max-width: 1280px;
  margin: 0 auto 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ff-cat-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid #e7e5e4;
  background: #fff;
  color: var(--stone-600, #57534e);
  cursor: pointer;
}
.ff-cat-btn:hover { background: #f5f5f4; }
.ff-cat-btn.active {
  background: var(--emerald-800, #065f46);
  color: #fff;
  border-color: var(--emerald-800, #065f46);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* ===================== PRODUCT CARD ===================== */
.ff-shop-content ul.products li.ff-card {
  background: #fff;
  border-radius: 1rem;
  border: 1px solid #e7e5e4;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.25s ease;
  margin: 0 !important;
  padding: 0 !important;
}
.ff-shop-content ul.products li.ff-card:hover {
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}
.ff-card-image {
  height: 14rem;
  background: #f5f5f4;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ff-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.ff-card-image:hover img { transform: scale(1.05); }
.ff-card-placeholder { font-size: 3rem; }
.ff-badge-sale {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--rose-600, #e11d48);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 0.3rem 0.6rem;
  border-radius: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ff-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.ff-card-cat {
  font-size: 0.65rem;
  color: var(--stone-400, #a8a29e);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 0.4rem;
}
.ff-card-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--stone-800, #292524);
  line-height: 1.3;
  margin: 0 0 0.5rem;
}
.ff-card-title a { color: inherit; }
.ff-card-bottom {
  margin-top: auto;
  border-top: 1px solid #f5f5f4;
  padding-top: 1rem;
}
.ff-card-price {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.ff-price-current {
  color: var(--emerald-800, #065f46);
  font-weight: 900;
  font-size: 1.4rem;
}
.ff-price-old {
  color: var(--stone-400, #a8a29e);
  text-decoration: line-through;
  font-weight: 600;
  font-size: 0.85rem;
}
.ff-card-stock { margin-bottom: 1rem; }
.ff-stock {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 0.5rem;
}
.ff-stock-ok { background: #ecfdf5; color: var(--emerald-700, #047857); border: 1px solid #d1fae5; }
.ff-stock-out { background: #fff1f2; color: var(--rose-600, #e11d48); border: 1px solid #ffe4e6; }
.ff-card-cta a.button,
.ff-card-cta a.add_to_cart_button {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--emerald-800, #065f46) !important;
  color: #fff !important;
  padding: 0.8rem !important;
  border-radius: 0.75rem !important;
  font-weight: 700 !important;
}
.ff-card-cta a.button:hover { background: var(--emerald-700, #047857) !important; }
