/*
Theme Name: Buggly
Theme URI: https://bugglyfarms.com
Author: Buggly Farms
Author URI: https://bugglyfarms.com
Description: Custom theme for Buggly Farms
Version: 0.1.58
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: buggly
Tags: e-commerce, custom-menu, custom-logo, featured-images, footer-widgets, theme-options

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/ 

/* --- Buggly Custom Checkout Layout --- */
@media (min-width: 600px) {
  .woocommerce-billing-fields__field-wrapper {
    display: block;
  }
  .woocommerce-billing-fields__field-wrapper .buggly-row-field {
    display: inline-block;
    width: 48%;
    min-width: 200px;
    max-width: 48%;
    margin-right: 2%;
    vertical-align: top;
    box-sizing: border-box;
  }
  /* Ensure only the four main fields are side by side, others are full width */
  .woocommerce-billing-fields__field-wrapper .buggly-row-field:nth-of-type(odd) {
    margin-right: 2%;
    clear: left;
  }
  .woocommerce-billing-fields__field-wrapper .buggly-row-field:nth-of-type(even) {
    margin-right: 0;
  }
  /* All other fields (not .buggly-row-field) are full width */
  .woocommerce-billing-fields__field-wrapper > :not(.buggly-row-field) {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    box-sizing: border-box;
  }
}
@media (max-width: 599px) {
  .woocommerce-billing-fields__field-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .woocommerce-billing-fields__field-wrapper .buggly-row-field {
    flex: 1 1 48%;
    min-width: 120px;
    max-width: 48%;
  }
}

/* Modern Order Summary Styles */
.woocommerce-checkout-review-order-table {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  overflow: hidden;
  border: none;
  margin-bottom: 18px !important;
}
.woocommerce-checkout-review-order-table thead th {
  background: #f5f7fa;
  color: #222;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 16px !important;
}
.woocommerce-checkout-review-order-table tbody td {
  background: #fff;
  color: #333;
  font-size: 15px;
  padding: 10px 16px !important;
  border-bottom: 1px solid #f0f0f0;
}
.woocommerce-checkout-review-order-table tfoot tr th,
.woocommerce-checkout-review-order-table tfoot tr td {
  background: #f9fafb;
  color: #1a202c;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 16px !important;
  border-top: 2px solid #e5e7eb;
}
.woocommerce-checkout-review-order-table tfoot tr.order-total th,
.woocommerce-checkout-review-order-table tfoot tr.order-total td {
  background: #e6f7e6;
  color: #256029;
  font-size: 18px;
  font-weight: 800;
  border-top: 3px solid #4B6B34;
}
.woocommerce-checkout-review-order-table tr.cart_item:hover td {
  background: #f5f7fa;
  transition: background 0.2s;
}
.woocommerce-checkout-review-order-table .product-name {
  font-weight: 600;
  letter-spacing: 0.01em;
}
.woocommerce-checkout-review-order-table .product-total {
  text-align: right;
  font-weight: 500;
}
.woocommerce-checkout-review-order-table .amount {
  font-weight: 700;
  color: #4B6B34;
}
@media (max-width: 600px) {
  .woocommerce-checkout-review-order-table thead th,
  .woocommerce-checkout-review-order-table tbody td,
  .woocommerce-checkout-review-order-table tfoot tr th,
  .woocommerce-checkout-review-order-table tfoot tr td {
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 14px;
  }
  .woocommerce-checkout-review-order-table {
    border-radius: 8px;
  }
}

/* --- Fix Place Order Button Always at Bottom of Viewport on Mobile --- */
@media (max-width: 900px) {
  .woocommerce-checkout .place-order {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 2000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.07);
    padding: 12px 16px 8px 16px !important;
    margin: 0 !important;
    width: 100vw;
    max-width: 100vw;
    border-top: 1px solid #eee;
    transition: box-shadow 0.2s;
  }
  .woocommerce-checkout .place-order .button {
    width: 100%;
    font-size: 18px;
    padding: 12px 0;
  }
  .woocommerce-checkout-review-order-table,
  .woocommerce-checkout-review-order {
    margin-bottom: 80px !important;
  }
}

/* Show order total above the button */
.woocommerce-checkout .place-order:before {
  content: 'Order Total:';
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
  color: #222;
}

/* --- Place Order Button Shake Animation and Message --- */
.buggly-shake {
  animation: buggly-shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes buggly-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}
.buggly-place-order-msg {
  background: #ffeaea;
  color: #b71c1c;
  border: 1px solid #f5c2c7;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 8px 0 0 0;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  display: none;
  z-index: 1001;
  position: relative;
}

/* Hide WooCommerce privacy policy notice on checkout */
.woocommerce-privacy-policy-text, .woocommerce-terms-and-conditions-wrapper .woocommerce-privacy-policy-text {
  display: none !important;
}

/* Swiper custom styles for featured products */
.featured-products-swiper {
  width: 100%;
  overflow: visible;
}
.featured-products-swiper .swiper-slide {
  width: 80vw !important;
  max-width: 340px;
  min-width: 240px;
  box-sizing: border-box;
}
@media (min-width: 640px) {
  .featured-products-swiper .swiper-slide {
    width: 45vw !important;
    max-width: 320px;
  }
}
@media (min-width: 1024px) {
  .featured-products-swiper .swiper-slide {
    width: auto !important;
    max-width: none;
  }
}

body {
  @apply bg-cream text-brown font-body;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  @apply font-heading text-primary;
}

.site-header {
  @apply bg-white border-b border-cream shadow-sm;
}

.category-icon-carousel-section {
  @apply bg-white pt-3 pb-3;
}
.category-icon-carousel-section h2 {
  @apply font-heading text-xl md:text-2xl text-primary mb-3;
}
.category-icon-carousel-swiper .swiper-slide a {
  @apply bg-white rounded-lg transition p-2 mb-2 flex flex-col items-center;
}
.category-icon-carousel-swiper .swiper-slide a:hover {
  /* No shadow */
}
.category-icon-carousel-swiper h3 {
  @apply text-brown font-heading text-sm mt-2 mb-0 text-center leading-tight;
}

.hero-section {
  @apply bg-yellow bg-cover bg-center text-brown;
}
.hero-section h1, .hero-section h2 {
  @apply font-heading text-brown;
}
.hero-section .button, .hero-section button {
  @apply bg-primary text-white font-heading rounded px-6 py-2 shadow hover:bg-brown transition;
}

.featured-products-section {
  @apply bg-white py-8;
}
.featured-products-section h2 {
  @apply font-heading text-xl md:text-2xl text-primary mb-6;
}
.featured-products-section .product-card {
  @apply bg-cream rounded-lg shadow p-4 mb-6 border border-cream hover:border-primary transition;
}
.featured-products-section .product-card .price {
  @apply text-brown font-bold;
}
.featured-products-section .product-card .onsale {
  @apply bg-secondary text-white px-2 py-1 rounded font-heading text-xs;
}
.featured-products-section .product-card .button {
  @apply bg-yellow text-brown font-heading rounded px-4 py-2 mt-2 hover:bg-primary hover:text-white transition;
}

footer, .site-footer {
  @apply bg-primary text-white font-body py-8;
}
footer a, .site-footer a {
  @apply text-yellow hover:text-white underline transition;
}

/* Responsive payment box styles */
#payment, .woocommerce-checkout-payment {
  max-width: 100%;
  box-sizing: border-box;
}
.woocommerce-checkout-payment .wc_payment_methods {
  flex-direction: column;
  gap: 0.5rem;
}
.woocommerce-checkout-payment .wc_payment_method {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .woocommerce-checkout-payment, #payment {
    padding: 0.5rem !important;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .woocommerce-checkout-payment .wc_payment_methods {
    flex-direction: column;
    gap: 0.5rem;
  }
  .woocommerce-checkout-payment .wc_payment_method {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }
  .woocommerce-checkout-payment .wc_payment_method label {
    font-size: 1rem;
    padding: 0.5rem 0.25rem;
    white-space: normal;
    word-break: break-word;
    flex: 1 1 100%;
  }
} 