
/* ============================================================
   BUG FIXES — Crystal Wood v1.0.1
   ============================================================ */

/* Fix: product grid without .woocommerce wrapper */
ul.products {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 1.5rem !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}
@media (min-width: 600px) {
  ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (min-width: 768px) {
  ul.products {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}
@media (min-width: 1100px) {
  ul.products {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* Fix: product card base styles */
ul.products li.product {
  background: #ffffff !important;
  border: 1px solid #ece4d8 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
  float: none !important;
  width: auto !important;
}
ul.products li.product:hover {
  box-shadow: 0 12px 40px rgba(60, 30, 10, 0.14) !important;
  transform: translateY(-4px) !important;
}

/* Fix: lazyload images — show placeholder until loaded */
ul.products li.product img.lazyload,
ul.products li.product img[data-src] {
  width: 100% !important;
  height: 260px !important;
  object-fit: cover !important;
  object-position: center !important;
  background-color: #f0e8d8 !important;
  display: block !important;
}
ul.products li.product img {
  width: 100% !important;
  height: 260px !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}

/* Fix: product info area */
ul.products li.product .woocommerce-loop-product__title,
ul.products li.product h2 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: #2c1e14 !important;
  padding: 1rem 1rem 0.3rem !important;
  margin: 0 !important;
  line-height: 1.4 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
ul.products li.product .price {
  color: #8b5a2b !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  padding: 0 1rem 0.5rem !important;
  display: block !important;
}
ul.products li.product .price del {
  color: #a89080 !important;
  font-size: 0.8rem !important;
}
ul.products li.product .button,
ul.products li.product .add_to_cart_button {
  display: block !important;
  width: calc(100% - 2rem) !important;
  margin: 0 1rem 1rem !important;
  padding: 0.6rem 1rem !important;
  background: #2c1e14 !important;
  color: #f5ede0 !important;
  border: none !important;
  border-radius: 4px !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  text-align: center !important;
  cursor: pointer !important;
  transition: background 0.3s !important;
  text-decoration: none !important;
}
ul.products li.product .button:hover,
ul.products li.product .add_to_cart_button:hover {
  background: #8b5a2b !important;
  color: #ffffff !important;
}

/* Fix: onsale badge */
ul.products li.product .onsale {
  position: absolute !important;
  top: 0.75rem !important;
  left: 0.75rem !important;
  background: #8b5a2b !important;
  color: #ffffff !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  padding: 0.25rem 0.6rem !important;
  border-radius: 3px !important;
  z-index: 2 !important;
}

/* Fix: WooCommerce demo store notice color */
.woocommerce-store-notice.demo_store,
p.demo_store {
  background-color: #8b5a2b !important;
  color: #f5ede0 !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 0.85rem !important;
  letter-spacing: 0.05em !important;
  padding: 0.6rem 1rem !important;
}
.woocommerce-store-notice.demo_store a,
p.demo_store a {
  color: #f5ede0 !important;
  text-decoration: underline !important;
}

/* Fix: hero min-height for large screens */
.cw-hero {
  min-height: min(90vh, 900px) !important;
}

/* Fix: announcement bar color */
#cw-announcement {
  background-color: #2c1e14 !important;
  color: #f5ede0 !important;
}

/* Floating Add to Cart Button for Mobile */
@media (max-width: 767px) {
    .single-product .entry-summary .cart {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #fff;
        padding: 10px 20px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 9999;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .single-product .entry-summary .cart button.single_add_to_cart_button {
        width: 100%;
        margin-left: 10px;
        background-color: #4a3324 !important;
        color: #fff !important;
        border-radius: 4px;
        height: 45px;
        font-weight: 600;
    }
    .single-product .entry-summary .quantity {
        margin-bottom: 0 !important;
    }
    body.single-product {
        padding-bottom: 70px; /* Space for the floating button */
    }
}

/* Registration Coupon Notice */
.woocommerce-registration-pages-notice {
    background-color: #fdf2f2;
    border: 1px solid #f8d7da;
    color: #721c24;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
}
.u-column2.col-2 h2::after {
    content: ' (Get 10% OFF Your First Order!)';
    display: block;
    font-size: 14px;
    color: #4a3324;
    margin-top: 5px;
}

/* Registration Coupon Notice Update */
.u-column2.col-2 h2::after {
    content: ' (Use Code: KIBO10 for 10% OFF!)';
    display: block;
    font-size: 14px;
    color: #4a3324;
    margin-top: 5px;
    font-weight: bold;
}

/* New Logo Adjustments */
.custom-logo-link img {
    max-width: 180px !important;
    height: auto !important;
    display: block;
    margin: 0;
    transition: transform 0.3s ease;
}
.site-header .custom-logo-link {
    display: flex;
    align-items: center;
    padding: 10px 0;
}
@media (max-width: 768px) {
    .custom-logo-link img {
        max-width: 140px !important;
    }
}

/* Luxury Fade-in & Typography Hierarchy */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-main > *, 
.front-page-section, 
.product-card, 
.entry-title, 
.section-title {
    animation: fadeInUp 1s ease forwards;
}

/* Typography Refinement - The Vogue Look */
h1, h2, h3, .site-title, .menu-item a {
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    line-height: 1.4 !important;
    font-weight: 300 !important;
}

.product-title, .entry-summary p {
    letter-spacing: 0.05em;
    line-height: 1.6;
}

/* Smooth Product Hover Transition */
.product-card img {
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.product-card:hover img {
    transform: scale(1.05) !important;
}

/* Bespoke Button Styling */
.bespoke-cta {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid #4a3324;
    color: #4a3324;
    text-decoration: none;
    letter-spacing: 0.2em;
    font-size: 12px;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.bespoke-cta:hover {
    background: #4a3324;
    color: #fff;
}

/* Product Page Luxury Layout */
.single-product div.product .woocommerce-product-details__short-description {
    margin-bottom: 40px;
    font-size: 15px;
    line-height: 1.8;
    color: #444;
}

.luxury-desc .intro {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    margin-bottom: 30px;
    color: #4a3324;
}

/* Image Soft Loading */
.woocommerce-product-gallery img {
    opacity: 0;
    transition: opacity 1.5s ease-in-out !important;
}

.woocommerce-product-gallery img.loaded {
    opacity: 1;
}

/* Hide SKU and category meta on single product pages */
.single-product .product_meta .sku_wrapper,
.single-product .product_meta .posted_in {
    display: none !important;
}

/* Mobile single product layout fix: keep variation form inside summary above related products */
@media (max-width: 767px) {
    .single-product div.product > .woocommerce-product-gallery {
        order: 1;
    }

    .single-product div.product > .summary,
    .single-product div.product > .entry-summary {
        order: 2;
    }

    .single-product div.product > .woocommerce-tabs {
        order: 3;
    }

    .single-product div.product > .related.products {
        order: 4;
    }

    .single-product .entry-summary .cart {
        position: static !important;
        bottom: auto !important;
        left: auto !important;
        width: 100% !important;
        background: transparent !important;
        padding: 0 !important;
        box-shadow: none !important;
        z-index: auto !important;
        display: block !important;
    }

    .single-product .entry-summary form.cart.variations_form {
        margin: 1.25rem 0 2rem !important;
    }

    .single-product .entry-summary form.cart .variations {
        width: 100% !important;
        margin-bottom: 1rem !important;
    }

    .single-product .entry-summary form.cart .single_variation_wrap {
        display: block !important;
    }

    .single-product .entry-summary form.cart .variations_button {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .single-product .entry-summary .cart button.single_add_to_cart_button {
        width: auto !important;
        flex: 1 1 auto !important;
        margin-left: 0 !important;
    }

    .single-product .entry-summary .quantity {
        margin-bottom: 0 !important;
        flex: 0 0 auto;
    }

    body.single-product {
        padding-bottom: 0 !important;
    }
}
