/*
Theme Name: Croché Atelier
Theme URI: https://example.com
Author: Maria Rejanete
Author URI: https://example.com
Description: Tema personalizado para a Maria Rejanete Costura & Crochê, feito sob medida com WooCommerce, carrossel de destaques, loja, contato e conta estilizados.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
Text Domain: croche-atelier
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* =========================================================
   0. TOKENS
   ========================================================= */
:root {
  --cream: #faf0e6;
  --cream-soft: #f3e6d8;
  --cream-deep: #ecdcc9;
  --rose: #92454b;
  --rose-dark: #6f333a;
  --rose-soft: #c17b73;
  --rose-pale: #f1d9d3;
  --brown: #4a2e24;
  --brown-deep: #33201a;
  --text: #4a3f38;
  --text-muted: #7a6d63;
  --white: #fffdfb;
  --line: #e4d3bf;
  --ok: #4f6b45;
  --err: #a13a3a;

  --font-display: "Playfair Display", Georgia, serif;
  --font-script: "Dancing Script", cursive;
  --font-body: "Jost", "Segoe UI", sans-serif;

  --radius-sm: 6px;
  --radius-md: 14px;
  --radius-lg: 28px;
  --shadow-soft: 0 12px 30px rgba(74, 46, 36, 0.1);
  --shadow-hover: 0 16px 34px rgba(74, 46, 36, 0.16);
  --container: 1180px;
}

/* =========================================================
   1. RESET
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--brown-deep);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { max-width: 66ch; }
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
.skip-link.screen-reader-text:focus {
  position: fixed !important;
  top: 10px; left: 10px;
  width: auto; height: auto;
  clip: auto;
  background: var(--rose);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  z-index: 999;
}

/* Accessible focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--rose-soft);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* =========================================================
   2. BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn--primary { background: var(--rose); color: var(--white); }
.btn--primary:hover { background: var(--rose-dark); transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: var(--rose); color: var(--rose-dark); }
.btn--ghost:hover { background: var(--rose-pale); }

/* =========================================================
   3. HEADER
   ========================================================= */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px 24px;
}
.site-logo { flex-shrink: 0; }
.site-logo__img,
.custom-logo { height: 58px; width: 58px; border-radius: 50%; object-fit: cover; }
.site-nav { margin-left: auto; }
.site-nav__list { display: flex; gap: 30px; }
.site-nav__list a {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--brown);
  position: relative;
  padding: 6px 0;
}
.site-nav__list a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--rose);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.site-nav__list a:hover::after,
.site-nav__list .current-menu-item a::after { transform: scaleX(1); }

.site-header__actions { display: flex; align-items: center; gap: 14px; }
.header-cart {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--cream-soft);
  font-size: 0.9rem;
  color: var(--brown);
}
.header-cart:hover { background: var(--rose-pale); }
.header-cart__count {
  background: var(--rose);
  color: var(--white);
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--brown); border-radius: 2px; }

.mobile-nav { display: none; }
.mobile-nav__list { display: flex; flex-direction: column; padding: 6px 24px 18px; }
.mobile-nav__list a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--brown); }

@media (max-width: 860px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav.is-open { display: block; }
}

/* =========================================================
   4. HERO
   ========================================================= */
.hero { padding: 64px 0 40px; }
.hero__inner {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: center;
}
.hero__circle {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--cream-soft);
}
.hero__logo-img { width: 100%; height: 100%; object-fit: cover; }
.hero__script {
  font-family: var(--font-script);
  color: var(--rose);
  font-size: 1.6rem;
  margin: 0 0 6px;
}
.hero__title { margin-bottom: 18px; }
.hero__text { color: var(--text-muted); margin-bottom: 28px; }
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 780px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__circle { width: 190px; margin: 0 auto; }
  .hero__actions { justify-content: center; }
  p.hero__text { margin-left: auto; margin-right: auto; }
}

/* =========================================================
   5. CAROUSEL
   ========================================================= */
.carousel {
  position: relative;
  margin: 56px 0;
  padding: 0 24px;
}
.carousel__viewport {
  max-width: var(--container);
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.carousel__track {
  display: flex;
  transition: transform 0.5s ease;
}
.carousel__slide {
  min-width: 100%;
  aspect-ratio: 21 / 9;
  background: var(--cream-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel__slide img { height: 62%; width: auto; object-fit: contain; }
.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--white);
  border: 1px solid var(--line);
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 1.4rem;
  color: var(--rose-dark);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-soft);
}
.carousel__arrow--prev { left: 6px; }
.carousel__arrow--next { right: 6px; }
.carousel__arrow:hover { background: var(--rose-pale); }
.carousel__dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.carousel__dots button {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cream-deep); border: none; padding: 0;
}
.carousel__dots button.is-active { background: var(--rose); }

@media (max-width: 780px) {
  .carousel__arrow { display: none; }
}

/* =========================================================
   6. ABOUT
   ========================================================= */
.about { padding: 20px 0 64px; }
.about__inner { text-align: center; max-width: 720px; margin: 0 auto; }
.about__inner p { margin: 0 auto; color: var(--text-muted); }
.about__divider {
  width: 70px; height: 2px; background: var(--rose-soft);
  margin: 22px auto;
}

/* =========================================================
   7. PRODUCTS (custom section + WooCommerce loop)
   ========================================================= */
.featured-products { padding: 20px 0 72px; }
.featured-products h2, .shop-intro h1 { text-align: center; margin-bottom: 36px; }

ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  list-style: none;
  margin: 0 !important;
  padding: 0 !important;
}
ul.products li.product {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 18px 24px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
ul.products li.product:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
ul.products li.product img {
  border-radius: var(--radius-sm);
  aspect-ratio: 1;
  object-fit: cover;
  margin-bottom: 14px;
}
ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--brown-deep);
  margin: 0 0 6px;
}
ul.products li.product .price {
  color: var(--rose-dark);
  font-weight: 600;
}
ul.products li.product .price del { color: var(--text-muted); opacity: 0.7; }
ul.products li.product .price ins { text-decoration: none; }
ul.products li.product .button {
  margin-top: 12px;
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--cream-soft);
  color: var(--brown);
  font-size: 0.88rem;
}
ul.products li.product .button:hover { background: var(--rose); color: var(--white); }
ul.products li.product .star-rating { color: var(--rose-soft); }
ul.products li.product .onsale {
  background: var(--rose) !important;
  border-radius: 999px;
}

@media (max-width: 980px) { ul.products { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { ul.products { grid-template-columns: 1fr; } }

.croche-empty-shop {
  text-align: center;
  padding: 64px 24px;
  background: var(--cream-soft);
  border-radius: var(--radius-lg);
  max-width: 560px;
  margin: 0 auto;
}
.croche-empty-icon { font-size: 2.4rem; display: block; margin-bottom: 12px; }
.croche-empty-shop h2 { margin-bottom: 10px; }
.croche-empty-shop p { margin: 0 auto; color: var(--text-muted); }

/* =========================================================
   8. WOOCOMMERCE — GENERAL PAGE CHROME
   ========================================================= */
.woocommerce-page .site-main,
.site-main.container { padding: 44px 0 72px; }

.woocommerce-breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.woocommerce-breadcrumb a { color: var(--rose-dark); }

.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-error {
  border-top-color: var(--rose);
  background: var(--cream-soft);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.woocommerce-notices-wrapper .woocommerce-message::before,
.woocommerce-notices-wrapper .woocommerce-info::before { color: var(--rose); }

/* Single product */
.single-product div.product .woocommerce-product-gallery { border-radius: var(--radius-md); overflow: hidden; }
.single-product div.product .product_title { font-size: 2rem; }
.single-product div.product p.price { color: var(--rose-dark); font-size: 1.3rem; }
.single-product div.product .single_add_to_cart_button {
  background: var(--rose);
  color: var(--white);
  border-radius: 999px;
  padding: 14px 34px;
  border: none;
  font-size: 1rem;
}
.single-product div.product .single_add_to_cart_button:hover { background: var(--rose-dark); }
.woocommerce-tabs ul.tabs li { font-family: var(--font-display); }
.woocommerce-tabs ul.tabs li.active { border-bottom: 2px solid var(--rose); }

/* Cart & checkout */
table.shop_table {
  border: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
}
table.shop_table th { background: var(--cream-soft); color: var(--brown-deep); font-family: var(--font-display); font-weight: 600; }
table.shop_table td, table.shop_table th { border-color: var(--line); padding: 14px; }
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button {
  background: var(--rose); color: var(--white); border-radius: 999px; border: none; padding: 12px 26px;
}
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover { background: var(--rose-dark); color: var(--white); }
.woocommerce a.remove { color: var(--err) !important; }
#order_review, .cart_totals { background: var(--white); border-radius: var(--radius-md); padding: 24px; border: 1px solid var(--line); }
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce-checkout select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--white);
}

/* =========================================================
   9. MY ACCOUNT
   ========================================================= */
.woocommerce-account .woocommerce {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  align-items: start;
}
.woocommerce-MyAccount-navigation {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px;
}
.woocommerce-MyAccount-navigation ul { display: flex; flex-direction: column; gap: 2px; }
.woocommerce-MyAccount-navigation li a {
  display: block;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--brown);
  font-size: 0.95rem;
}
.woocommerce-MyAccount-navigation li a:hover { background: var(--cream-soft); }
.woocommerce-MyAccount-navigation li.is-active a { background: var(--rose); color: var(--white); }
.woocommerce-MyAccount-content { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 30px; }
.woocommerce-MyAccount-content .woocommerce-Address { background: var(--cream-soft); padding: 18px; border-radius: var(--radius-sm); }
.woocommerce-MyAccount-content mark { background: none; color: var(--rose-dark); font-weight: 600; }
.woocommerce-orders-table__cell-order-actions .button { font-size: 0.8rem; padding: 8px 16px; }

@media (max-width: 780px) {
  .woocommerce-account .woocommerce { grid-template-columns: 1fr; }
}

/* A página de Conta usa page.php — libera a largura de 760px do texto comum */
.woocommerce-account .page-content,
.woocommerce-account .entry-content,
.woocommerce-cart .page-content,
.woocommerce-checkout .page-content {
  max-width: none;
}

/* =========================================================
   10. CONTACT PAGE
   ========================================================= */
.page-header { text-align: center; margin-bottom: 44px; }
.contato__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: start;
}
.contato__form-wrap, .contato__info {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px;
}
.contato__form { display: flex; flex-direction: column; gap: 18px; }
.contato__form label { display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; color: var(--brown); }
.contato__form input, .contato__form textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-body);
  background: var(--cream);
}
.contato__form button { align-self: flex-start; border: none; }
.hp-field { position: absolute !important; left: -9999px !important; }
.form-notice { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 0.92rem; }
.form-notice--success { background: #e7efe3; color: var(--ok); }
.form-notice--error { background: #f6e3e3; color: var(--err); }
.contato__info ul { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.contato__info a:hover { color: var(--rose-dark); }
.contato__note { font-size: 0.82rem; color: var(--text-muted); }

@media (max-width: 860px) {
  .contato__grid { grid-template-columns: 1fr; }
}

/* =========================================================
   11. BLOG / GENERIC PAGE
   ========================================================= */
.post-list { display: flex; flex-direction: column; gap: 40px; max-width: 760px; margin: 0 auto; }
.post-list article { border-bottom: 1px solid var(--line); padding-bottom: 32px; }
.post-list .entry-title a { color: var(--brown-deep); }
.post-list .entry-meta { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 10px; }
.entry-content, .page-content { max-width: 760px; margin: 0 auto; }
.entry-content p, .page-content p { color: var(--text); }

/* =========================================================
   12. FOOTER
   ========================================================= */
.site-footer { background: var(--cream-deep); margin-top: 40px; border-top: 1px solid var(--line); }
.site-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding: 56px 24px 32px;
}
.site-footer__brand .site-logo__img,
.site-footer__brand .custom-logo { height: 54px; width: 54px; border-radius: 50%; margin-bottom: 14px; }
.site-footer__brand p { color: var(--text-muted); font-size: 0.92rem; }
.site-footer h3.footer-widget-title,
.site-footer h3 { font-size: 1rem; margin-bottom: 14px; }
.site-footer__links li { margin-bottom: 10px; }
.site-footer__links a { color: var(--brown); font-size: 0.92rem; }
.site-footer__links a:hover { color: var(--rose-dark); }
.site-footer__bottom {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 18px 24px;
  border-top: 1px solid var(--line);
}

@media (max-width: 780px) {
  .site-footer__inner { grid-template-columns: 1fr; }
}
