/*
Theme Name: Codex Commerce
Theme URI: https://example.com/codex-commerce
Author: Codex
Author URI: https://example.com
Description: A clean, scratch-built theme for WordPress + WooCommerce.
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: codex-commerce
*/

:root {
  --cc-bg: #f7f3ee;
  --cc-ink: #1b1a17;
  --cc-accent: #d17b0f;
  --cc-muted: #6b655c;
  --cc-card: #ffffff;
  --cc-border: #e6dfd6;
  --cc-max: 1200px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  color: var(--cc-ink);
  background: radial-gradient(circle at 15% 10%, #fff8ef 0, #f7f3ee 35%, #f2ede6 100%);
  line-height: 1.6;
}

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

a:hover {
  color: var(--cc-accent);
}

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

.cc-container {
  max-width: var(--cc-max);
  margin: 0 auto;
  padding: 0 24px;
}

.cc-site-header {
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--cc-border);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.cc-header-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(280px, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.cc-brand {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.cc-brand img,
.cc-brand .custom-logo {
  max-height: 100px;
  width: auto;
  height: auto;
}

.cc-header-search {
  width: 100%;
}

.cc-search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--cc-border);
  border-radius: 999px;
  padding: 6px 8px;
  box-shadow: 0 10px 24px rgba(27, 26, 23, 0.06);
}

.cc-search-field {
  border: none;
  outline: none;
  padding: 8px 12px;
  font-size: 0.95rem;
  background: transparent;
}

.cc-search-button {
  border: none;
  background: var(--cc-ink);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.cc-header-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.9rem;
}

.cc-header-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.cc-header-link:hover {
  border-color: var(--cc-border);
  transform: translateY(-1px);
}

.cc-whatsapp {
  background: #25d366;
  color: #fff;
}

.cc-whatsapp:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.cc-header-text {
  font-weight: 600;
}

.cc-icon svg {
  display: block;
  fill: currentColor;
}

.cc-cart {
  position: relative;
}

.cc-cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--cc-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.cc-cart-popup {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--cc-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 18px 40px rgba(27, 26, 23, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.cc-cart:hover .cc-cart-popup {
  opacity: 1;
  pointer-events: auto;
}

.cc-nav {
  margin-top: 18px;
}

.cc-nav ul {
  list-style: none;
  display: flex;
  gap: 18px;
  padding: 0;
  margin: 0;
  justify-content: center;
  flex-wrap: wrap;
}

.cc-nav a {
  font-weight: 600;
  font-size: 0.95rem;
}

.cc-hero {
  padding: 72px 0 48px;
  display: grid;
  gap: 32px;
  align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.cc-hero h1 {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  margin: 0 0 12px;
}

.cc-hero p {
  color: var(--cc-muted);
  margin: 0 0 24px;
  max-width: 520px;
}

.cc-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cc-accent);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 20px rgba(209, 123, 15, 0.25);
}

.cc-button:hover {
  transform: translateY(-2px);
}

.cc-section {
  padding: 36px 0 72px;
}

.cc-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.cc-card {
  background: var(--cc-card);
  border: 1px solid var(--cc-border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 16px 35px rgba(27, 26, 23, 0.06);
}

.cc-content {
  padding: 40px 0 72px;
}

.cc-post {
  margin-bottom: 32px;
}

.cc-post h2 {
  margin: 0 0 8px;
}

.cc-footer {
  padding: 32px 0;
  border-top: 1px solid var(--cc-border);
  color: var(--cc-muted);
  font-size: 0.9rem;
}

.cc-sidebar {
  background: var(--cc-card);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--cc-border);
}

@media (max-width: 960px) {
  .cc-header-grid {
    grid-template-columns: 1fr;
  }

  .cc-header-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .cc-nav {
    margin-top: 12px;
  }
}

@media (max-width: 720px) {
  .cc-search-form {
    grid-template-columns: 1fr;
  }

  .cc-search-button {
    width: 100%;
  }
}

.cc-cart-popup .woocommerce-mini-cart {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cc-cart-popup .woocommerce-mini-cart-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--cc-border);
}

.cc-cart-popup .woocommerce-mini-cart-item:last-child {
  border-bottom: none;
}

.cc-mini-cart-grid {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
}

.cc-mini-cart-thumb-img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.cc-mini-cart-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cc-mini-cart-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-mini-cart-qty {
  font-size: 0.8rem;
  color: var(--cc-muted);
}

.cc-mini-cart-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  font-size: 0.85rem;
}

.cc-mini-cart-price {
  font-weight: 600;
}

.cc-mini-cart-meta .remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #f3f0ea;
  color: var(--cc-ink);
  font-size: 16px;
  line-height: 1;
}

.cc-nav-wrapper {
  margin-top: 18px;
  background: #efe7dc;
  border-top: 1px solid var(--cc-border);
  border-bottom: 1px solid var(--cc-border);
}

.cc-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0;
}

.cc-nav {
  margin-top: 0;
}

.cc-nav ul {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.cc-nav a,
.cc-nav-right a {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.cc-nav-right {
  display: flex;
  gap: 16px;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .cc-nav-row {
    flex-direction: column;
    gap: 12px;
  }

  .cc-nav-right {
    flex-wrap: wrap;
    justify-content: center;
  }
}

.cc-hero-split {
  padding: 36px 0 24px;
}

.cc-hero-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.cc-hero-slider {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  min-height: 380px;
  min-width: 0;
  box-shadow: 0 24px 50px rgba(27, 26, 23, 0.15);
}

.cc-hero-track {
  display: flex;
  height: 100%;
  width: 300%;
  animation: cc-hero-slide 18s infinite;
}

.cc-hero-slide {
  flex: 0 0 100%;
  padding: 48px;
  display: flex;
  align-items: flex-end;
  position: relative;
  color: #fff;
}

.cc-hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.1));
}

.cc-hero-slide-one {
  background: linear-gradient(120deg, #a55c0b, #f4b350);
}

.cc-hero-slide-two {
  background: linear-gradient(120deg, #1d4f5d, #57c1a7);
}

.cc-hero-slide-three {
  background: linear-gradient(120deg, #3b2a5a, #c97c4f);
}

.cc-hero-caption {
  position: relative;
  z-index: 1;
  max-width: 70%;
}

.cc-hero-caption h1 {
  margin: 10px 0 12px;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.cc-hero-caption p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.85);
}

.cc-hero-eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.cc-sale-slider {
  background: #fff;
  border-radius: 24px;
  border: 1px solid var(--cc-border);
  padding: 20px;
  min-width: 0;
  box-shadow: 0 16px 35px rgba(27, 26, 23, 0.08);
}

.cc-sale-slider h2 {
  margin-top: 0;
}

.cc-sale-slider .products {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  margin: 0;
  list-style: none;
}

.cc-sale-slider .product {
  flex: 0 0 100%;
  scroll-snap-align: start;
  background: #faf7f2;
  border-radius: 16px;
  padding: 14px;
}

.cc-sale-slider .product img {
  max-height: 240px;
  width: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.cc-sale-slider .woocommerce-loop-product__title {
  font-size: 1rem;
  margin: 12px 0 8px;
}

.cc-sale-slider .price {
  font-weight: 600;
}

@keyframes cc-hero-slide {
  0% {
    transform: translateX(0);
  }
  28% {
    transform: translateX(0);
  }
  33% {
    transform: translateX(-100%);
  }
  61% {
    transform: translateX(-100%);
  }
  66% {
    transform: translateX(-200%);
  }
  94% {
    transform: translateX(-200%);
  }
  100% {
    transform: translateX(0);
  }
}

@media (max-width: 980px) {
  .cc-hero-split-grid {
    grid-template-columns: 1fr;
  }

  .cc-hero-caption {
    max-width: 90%;
  }
}

.cc-sale-slider {
  position: relative;
  overflow: hidden;
}

.cc-sale-slider::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, #ff6a00, #ff3d3d, #ff9a3c);
  background-size: 200% 200%;
  animation: cc-sale-glow 8s ease infinite;
  opacity: 0.2;
}

.cc-sale-slider > * {
  position: relative;
  z-index: 1;
}

.cc-sale-slider .product {
  background: rgba(255, 255, 255, 0.9);
}

@keyframes cc-sale-glow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.cc-info-card {
  display: grid;
  gap: 12px;
}

.cc-info-icon {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(209, 123, 15, 0.12);
  color: var(--cc-ink);
}

.cc-info-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.cc-info-card h3 {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}

.cc-info-card p {
  font-size: 0.85rem;
  margin: 0;
}

.cc-info-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.cc-info-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 250px;
  text-align: center;
}

.cc-new-arrivals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  align-items: center;
}

.cc-new-arrivals-title {
  text-align: center;
}

.cc-new-arrivals-title h2 {
  margin-top: 0;
}

.cc-new-arrivals-products {
  grid-column: span 2;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.cc-new-arrivals-products .products {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  margin: 0;
  padding-bottom: 6px;
}

@media (max-width: 980px) {
  .cc-new-arrivals-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .cc-new-arrivals-products {
    grid-column: auto;
  }
}

.cc-new-arrivals-products .product {
  flex: 0 0 32%;
  min-width: 220px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.cc-new-arrivals-arrow {
  display: none;
  font-size: 1.6rem;
  margin-top: 12px;
  animation: cc-arrow-bounce 1.6s ease-in-out infinite;
}

@keyframes cc-arrow-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

@media (max-width: 980px) {
  .cc-new-arrivals-products .product {
    flex-basis: 100%;
    min-width: 100%;
  }

  .cc-new-arrivals-arrow {
    display: inline-block;
  }
}

