/* MetaFormula Lab - Custom Styles */

/* Alpine.js Cloak */
[x-cloak] {
    display: none !important;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #87A96B;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6B8E47;
}

/* Typography */
.font-script {
    font-family: 'Dancing Script', cursive;
}

/* Gradient Backgrounds */
.bg-gradient-sage {
    background: linear-gradient(135deg, #87A96B 0%, #A8C686 100%);
}

.bg-gradient-forest {
    background: linear-gradient(135deg, #2D5016 0%, #6B8E47 100%);
}

.bg-gradient-natural {
    background: linear-gradient(135deg, #FAF8F5 0%, #E5D4B1 100%);
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Button Styles */
.btn-sage {
    background-color: #87A96B;
    color: white;
    transition: all 0.3s ease;
}

.btn-sage:hover {
    background-color: #6B8E47;
    transform: translateY(-1px);
}

.btn-purple {
    background-color: #953FC7;
    color: white;
    transition: all 0.3s ease;
}

.btn-purple:hover {
    background-color: #7A2FA3;
    transform: translateY(-1px);
}

.btn-outline-purple {
    border: 2px solid #953FC7;
    color: #953FC7;
    background: transparent;
    transition: all 0.3s ease;
}

.btn-outline-purple:hover {
    background-color: #953FC7;
    color: white;
}

/* Image Effects */
.image-hover {
    transition: transform 0.3s ease;
}

.image-hover:hover {
    transform: scale(1.05);
}

/* Navigation Styles */
.nav-backdrop {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Product Card Styles */
.product-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.product-card .product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(135, 169, 107, 0.8) 0%, rgba(149, 63, 199, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

/* Badge Styles */
.badge-sage {
    background-color: #87A96B;
    color: white;
}

.badge-purple {
    background-color: #953FC7;
    color: white;
}

.badge-terracotta {
    background-color: #C65D07;
    color: white;
}

.badge-earth {
    background-color: #D4B896;
    color: #2D5016;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

.bounce-in {
    animation: bounceIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #87A96B;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom Forms */
.form-input {
    border: 2px solid #E5D4B1;
    border-radius: 12px;
    padding: 8px 5px;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #87A96B;
    box-shadow: 0 0 0 3px rgba(135, 169, 107, 0.1);
}

/* Notification Styles */
.notification {
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.notification-success {
    background: rgba(34, 197, 94, 0.9);
    border-left: 4px solid #16a34a;
}

.notification-error {
    background: rgba(239, 68, 68, 0.9);
    border-left: 4px solid #dc2626;
}

.notification-warning {
    background: rgba(245, 158, 11, 0.9);
    border-left: 4px solid #d97706;
}

.notification-info {
    background: rgba(59, 130, 246, 0.9);
    border-left: 4px solid #2563eb;
}

/* WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #87A96B;
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(135, 169, 107, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.scroll-top:hover {
    background: #6B8E47;
    transform: translateY(-2px);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }

    .scroll-top {
        bottom: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
    }
}

/* Cart Sidebar */
.cart-sidebar {
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.cart-sidebar.open {
    transform: translateX(0);
}

/* Search Overlay */
.search-overlay {
    backdrop-filter: blur(10px);
    background: rgba(42, 42, 42, 0.8);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

@media (max-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
}

/* Category Pills */
.category-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: white;
    border: 2px solid #E5D4B1;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-pill:hover {
    border-color: #87A96B;
    background: #87A96B;
    color: white;
}

.category-pill.active {
    background: #87A96B;
    border-color: #87A96B;
    color: white;
}

/* Price Filter */
.price-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #E5D4B1;
    outline: none;
    -webkit-appearance: none;
}

.price-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #87A96B;
    cursor: pointer;
}

.price-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #87A96B;
    cursor: pointer;
    border: none;
}

/* Text Utilities */
.text-sage {
    color: #87A96B;
}

.text-sage-dark {
    color: #6B8E47;
}

.text-forest {
    color: #2D5016;
}

.text-purple {
    color: #953FC7;
}

.text-terracotta {
    color: #C65D07;
}

.text-earth {
    color: #D4B896;
}

/* Background Utilities */
.bg-sage {
    background-color: #87A96B;
}

.bg-sage-light {
    background-color: #A8C686;
}

.bg-sage-dark {
    background-color: #6B8E47;
}

.bg-forest {
    background-color: #2D5016;
}

.bg-purple {
    background-color: #953FC7;
}

.bg-terracotta {
    background-color: #C65D07;
}

.bg-earth {
    background-color: #D4B896;
}

.bg-natural-cream {
    background-color: #FAF8F5;
}

/* Glassmorphism Effects */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Search Bar Responsive Fix */
.search-container {
    max-width: calc(100vw - 2rem); /* Ensure never exceeds viewport */
}

@media (max-width: 640px) {
    .search-input-mobile {
        font-size: 14px;
        padding-left: 12px;
        padding-right: 8px;
    }
    
    .search-button-mobile {
        min-width: 48px; /* Ensure touch-friendly button size */
        padding-left: 12px;
        padding-right: 12px;
    }
}


/* Custom Forms */
.filter-btn {
    border: 2px solid #E5D4B1;
    border-radius: 12px;
    padding: 8px 10px;
    transition: all 0.3s ease;
    background: white;
}

.filter-btn:focus {
    outline: none;
    border-color: #87A96B;
    box-shadow: 0 0 0 3px rgba(135, 169, 107, 0.1);
}

/* Category Item Styles */
.category-item {
    transition: all 0.3s ease;
}

.category-item:hover {
    transform: translateY(-2px);
}

.category-item.active .category-name {
    color: #87A96B;
    font-weight: 600;
}

/* Category Image Hover Effects */
.category-item img {
    transition: all 0.3s ease;
}

.category-item:hover img {
    transform: scale(1.1);
}

/* Category Ring Effect */
.category-item .w-20.h-20 {
    transition: all 0.3s ease;
}

.category-item:hover .w-20.h-20 {
    box-shadow: 0 8px 25px rgba(135, 169, 107, 0.3);
}


/* ========================================
   PRODUCT DETAILS TABS - COMPLETE MOBILE FIX
   ======================================== */

/* Force section to never exceed viewport */
.product-details-tabs {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 48px 0 !important;
}

/* Container fixes */
.product-details-tabs .container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 1rem !important;
    box-sizing: border-box !important;
}

.product-details-tabs .w-full,
.product-details-tabs .max-w-4xl {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Tab Navigation - Complete mobile fix */
.product-details-tabs .tab-navigation {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    margin-bottom: 2rem !important;
    border-bottom: 1px solid #e5e7eb !important;
}

.product-details-tabs .tab-navigation::-webkit-scrollbar {
    display: none !important;
}

.product-details-tabs .tab-navigation button {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    min-width: auto !important;
    padding: 12px 16px !important;
    border: none !important;
    background: transparent !important;
    border-bottom: 2px solid transparent !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.product-details-tabs .tab-navigation button:hover {
    color: #1f2937 !important;
}

/* Tab Content Container */
.product-details-tabs .tab-content {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    min-height: 200px !important;
}

.product-details-tabs .tab-content > div {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* Prose Content - Force text wrapping */
.product-details-tabs .prose {
    width: 100% !important;
    max-width: none !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    hyphens: auto !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
}

.product-details-tabs .prose * {
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
}

.product-details-tabs .prose h3 {
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 24px 0 12px 0 !important;
    color: #1f2937 !important;
}

.product-details-tabs .prose ul {
    margin: 16px 0 !important;
    padding-left: 20px !important;
}

.product-details-tabs .prose li {
    margin: 8px 0 !important;
    line-height: 1.6 !important;
}

/* Specifications Section - Force mobile layout */
.product-details-tabs .specifications-grid {
    display: block !important;
    width: 100% !important;
    gap: 0 !important;
}

.product-details-tabs .specifications-grid > div {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 16px !important;
    padding: 16px !important;
    background: white !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
}

.product-details-tabs .spec-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    width: 100% !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid #f3f4f6 !important;
    flex-wrap: wrap !important;
}

.product-details-tabs .spec-item:last-child {
    border-bottom: none !important;
}

.product-details-tabs .spec-item .spec-label {
    color: #6b7280 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    flex: 0 0 auto !important;
    margin-right: 8px !important;
}

.product-details-tabs .spec-item .spec-value {
    color: #1f2937 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: right !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 60% !important;
}

/* Reviews Section - Force mobile layout */
.product-details-tabs .reviews-grid {
    display: block !important;
    width: 100% !important;
    gap: 0 !important;
}

.product-details-tabs .reviews-grid > div {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 16px !important;
    box-sizing: border-box !important;
}

.product-details-tabs .review-summary {
    background: white !important;
    padding: 16px !important;
    border-radius: 12px !important;
    text-align: center !important;
    margin-bottom: 16px !important;
}

.product-details-tabs .review-list {
    width: 100% !important;
}

.product-details-tabs .review-item {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px !important;
    background: white !important;
    border-radius: 12px !important;
    margin-bottom: 16px !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    box-sizing: border-box !important;
}

.product-details-tabs .reviewer-info {
    display: block !important;
    width: 100% !important;
}

.product-details-tabs .reviewer-info img {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    margin-bottom: 8px !important;
}

.product-details-tabs .reviewer-details {
    width: 100% !important;
}

.product-details-tabs .reviewer-name {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    margin-bottom: 4px !important;
}

.product-details-tabs .reviewer-meta {
    margin-bottom: 8px !important;
}

.product-details-tabs .review-content {
    width: 100% !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    line-height: 1.6 !important;
    color: #4b5563 !important;
}

.product-details-tabs .rating-distribution {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 4px 0 !important;
}

.product-details-tabs .rating-bar {
    flex: 1 !important;
    min-width: 0 !important;
    height: 8px !important;
    background: #e5e7eb !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

/* Mobile Responsive Breakpoints */
@media (max-width: 768px) {
    .product-details-tabs {
        padding: 24px 0 !important;
    }
    
    .product-details-tabs .container {
        padding: 0 0.5rem !important;
    }
    
    .product-details-tabs .tab-navigation button {
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
    
    .product-details-tabs .prose {
        font-size: 14px !important;
    }
    
    .product-details-tabs .prose h3 {
        font-size: 16px !important;
    }
    
    .product-details-tabs .spec-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }
    
    .product-details-tabs .spec-item .spec-value {
        text-align: left !important;
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .product-details-tabs .container {
        padding: 0 0.25rem !important;
    }
    
    .product-details-tabs .tab-navigation button {
        font-size: 11px !important;
        padding: 6px 8px !important;
    }
    
    .product-details-tabs .specifications-grid > div,
    .product-details-tabs .review-item {
        padding: 12px !important;
    }
}

/* Category Placeholder Styling */
.category-placeholder {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    position: relative;
}

.category-placeholder::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Hover effect for category items */
.category-item:hover .category-placeholder {
    background: linear-gradient(135deg, #87A96B 0%, #739157 100%);
}

.category-item:hover .category-placeholder::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23ffffff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z'/%3E%3C/svg%3E");
}

#products-section {
  scroll-margin-top: 90px;
}

