/*
Theme Name: ChakrpaniKM Atelier
Theme URI: https://chakrpanikm.com
Author: Chakrpani Artisan Crafts
Author URI: https://chakrpanikm.com
Description: Complete luxury handcrafted WordPress & WooCommerce theme for ChakrpaniKM. Features slow-crafted crochet aesthetics, warm sand hues, deep burgundy accents, responsive bento grids, mobile navigation drawer, and custom WooCommerce templates.
Version: 1.1.0
License: GNU General Public License v2 or later
Text Domain: chakrpanikm
*/

:root {
  --bg-custom: #FDFBF7;
  --bg-warm: #F4EFEA;
  --primary: #802021;
  --primary-hover: #5A1518;
  --secondary: #D4AF37;
  --text-dark: #2A2A2A;
  --text-muted: #6B6B6B;
  --border-custom: #E7DFD8;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-custom);
  color: var(--text-dark);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 60px; /* Space for mobile bottom bar */
}

@media (min-width: 1024px) {
  body {
    padding-bottom: 0;
  }
}

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

/* Announcement Bar */
.ckm-announcement {
  background: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  padding: 0.5rem 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Header & Strict Logo Constraints */
.ckm-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 251, 247, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-custom);
  padding: 0.75rem 1.25rem;
}

.ckm-header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* STRICT LOGO SIZING FIX: Prevents Giant Logo Blowout */
.ckm-logo-link,
.custom-logo-link {
  display: inline-flex;
  align-items: center;
  max-width: 180px;
  max-height: 48px;
  flex-shrink: 0;
}

.ckm-header-container img,
.ckm-logo-img,
.custom-logo {
  max-height: 44px !important;
  max-width: 180px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
}

/* Navigation Bar */
.ckm-nav {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

@media (max-width: 899px) {
  .ckm-nav {
    display: none; /* Hidden on mobile; uses drawer */
  }
}

.ckm-nav-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  transition: color 0.2s ease;
  letter-spacing: 0.02em;
}

.ckm-nav-link:hover {
  color: var(--primary);
}

.ckm-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ckm-btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  padding: 0.65rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.ckm-btn-primary:hover {
  background-color: var(--primary-hover);
}

/* Mobile Toggle Hamburger */
.ckm-mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dark);
  cursor: pointer;
  padding: 0.25rem;
}

@media (max-width: 899px) {
  .ckm-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Mobile Drawer Overlay */
.ckm-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  backdrop-filter: blur(4px);
}

.ckm-drawer-overlay.open {
  display: block;
}

.ckm-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--bg-custom);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.ckm-drawer.open {
  transform: translateX(0);
}

.ckm-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-custom);
  margin-bottom: 1.5rem;
}

.ckm-drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dark);
}

.ckm-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ckm-drawer-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(231, 223, 216, 0.4);
}

.ckm-drawer-link:hover {
  color: var(--primary);
}

/* Mobile Bottom Tab Bar */
.ckm-mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(253, 251, 247, 0.98);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-custom);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.5rem 0.25rem;
}

@media (min-width: 900px) {
  .ckm-mobile-bottom-bar {
    display: none;
  }
}

.ckm-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  gap: 0.2rem;
}

.ckm-tab-item.active,
.ckm-tab-item:hover {
  color: var(--primary);
}

/* Hero Section */
.ckm-hero {
  padding: 4rem 1.25rem;
  background: linear-gradient(180deg, var(--bg-warm) 0%, var(--bg-custom) 100%);
  text-align: center;
}

.ckm-hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

.ckm-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  background: rgba(128, 32, 33, 0.08);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
}

.ckm-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.ckm-hero-title span {
  color: var(--primary);
  font-style: italic;
}

.ckm-hero-subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2rem;
}

/* Collection Bento Grid */
.ckm-bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  max-width: 1280px;
  margin: 2rem auto 4rem;
  padding: 0 1.25rem;
}

.ckm-bento-card {
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--border-custom);
  aspect-ratio: 4/3;
  background: var(--bg-warm);
}

.ckm-bento-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.ckm-bento-card:hover img {
  transform: scale(1.08);
}

.ckm-bento-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(28, 25, 23, 0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  color: #ffffff;
}

.ckm-bento-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
}

/* Shop Catalog Layout */
.ckm-shop-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

.ckm-shop-header {
  background: var(--bg-warm);
  border-radius: 1.5rem;
  padding: 2rem 1.5rem;
  margin-bottom: 2.5rem;
  border: 1px solid var(--border-custom);
}

.ckm-shop-grid-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
}

@media (max-width: 899px) {
  .ckm-shop-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Filters */
.ckm-sidebar {
  background: #ffffff;
  border: 1px solid var(--border-custom);
  border-radius: 1.25rem;
  padding: 1.5rem;
  height: fit-content;
}

.ckm-sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-custom);
}

.ckm-cat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ckm-cat-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  transition: all 0.2s ease;
}

.ckm-cat-item a:hover,
.ckm-cat-item.active a {
  background: var(--primary);
  color: #ffffff;
}

/* WooCommerce Products Grid */
ul.products,
.ckm-products-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 1.5rem !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

ul.products li.product,
.ckm-product-card {
  background: #ffffff !important;
  border: 1px solid var(--border-custom) !important;
  border-radius: 1.25rem !important;
  overflow: hidden !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  float: none !important;
}

ul.products li.product:hover,
.ckm-product-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.08) !important;
}

ul.products li.product img {
  width: 100% !important;
  height: 260px !important;
  object-fit: cover !important;
  margin: 0 !important;
}

ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--font-serif) !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: var(--text-dark) !important;
  padding: 1rem 1rem 0.25rem 1rem !important;
}

ul.products li.product .price {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--primary) !important;
  padding: 0 1rem 1rem 1rem !important;
  display: block !important;
}

ul.products li.product .button {
  margin: 0 1rem 1rem 1rem !important;
  background-color: var(--primary) !important;
  color: #ffffff !important;
  border-radius: 9999px !important;
  padding: 0.6rem 1.25rem !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  text-align: center !important;
  border: none !important;
}

/* Single Product Page Styling */
.single-product .product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .single-product .product {
    grid-template-columns: 1fr;
  }
}

.woocommerce-product-gallery img {
  width: 100%;
  border-radius: 1.5rem;
  border: 1px solid var(--border-custom);
}

.product_title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-dark);
}

.single-product .price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1rem 0;
}

.single-product .cart button.single_add_to_cart_button {
  background-color: var(--primary) !important;
  color: #ffffff !important;
  border-radius: 9999px !important;
  padding: 0.85rem 2.5rem !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  border: none !important;
}

/* Footer */
.ckm-footer {
  background: #1C1917;
  color: #E7DFD8;
  padding: 4rem 1.25rem 2rem;
  margin-top: 4rem;
}

.ckm-footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.ckm-footer-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.25rem;
}

.ckm-footer-text {
  font-size: 0.875rem;
  color: #A8A29E;
  line-height: 1.6;
}

.ckm-footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.8rem;
  color: #78716C;
}
