/*
 * Kitchen Home - Custom Styles
 * 使用全局色彩变量系统，确保全站色彩一致性
 */

/* Prevent horizontal scroll on mobile */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Mobile responsive fixes for hero section floating cards */
@media (max-width: 640px) {
    .absolute.-top-6.-left-6,
    .absolute.-bottom-6.-right-6 {
        display: none;
    }

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

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Hide decorative elements on small screens */
    .blur-xl {
        filter: blur(0px);
    }

    /* Ensure all sections don't overflow */
    section {
        overflow-x: hidden;
    }
}

/* Product Card Animations */
product-card {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Enhanced Product Card Hover Effects */
product-card:hover {
    z-index: 10;
}

/* Badge Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Line Clamp Utility */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Enhanced Shadow Transitions */
product-card .group:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Wishlist Button Heart Fill Animation */
.wishlist-btn .fa-heart.fill-current {
    animation: heartBeat 0.3s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Quick View Button Glow Effect */
.quick-view-glow {
    box-shadow: 0 0 20px rgba(255, 140, 66, 0.5); /* 使用 --color-secondary 的rgba值 */
}

/* Swiper Pagination/Navigation Customization */
.swiper-button-next, .swiper-button-prev {
    color: var(--color-primary);
}

.swiper-pagination-bullet-active {
    background: var(--color-secondary);
}

/* Scrollbar for Cart Drawer */
#cartDrawer {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

#cartDrawer::-webkit-scrollbar {
    width: 6px;
}

#cartDrawer::-webkit-scrollbar-track {
    background: transparent;
}

#cartDrawer::-webkit-scrollbar-thumb {
    background-color: #CBD5E1;
    border-radius: 20px;
}

/* Product Image Overlay Transition */
product-card .group .absolute.inset-0 {
    backdrop-filter: blur(0px);
    transition: backdrop-filter 0.3s ease;
}

product-card .group:hover .absolute.inset-0 {
    backdrop-filter: blur(2px);
}

/* Stock Status Indicator */
.stock-indicator {
    position: relative;
}

.stock-indicator::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #10B981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Feature Tags Hover */
product-card .bg-gray-50:hover {
    background: #FFF9F0;
    color: #2D5016;
    transform: translateY(-1px);
}

/* Price Display Enhancement */
.price-highlight {
    position: relative;
    display: inline-block;
}

.price-highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-secondary);
    transition: width 0.3s ease;
}

.product-card:hover .price-highlight::after {
    width: 100%;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    product-card {
        margin-bottom: 1rem;
    }

    /* Larger touch targets on mobile */
    .wishlist-btn {
        width: 44px !important;
        height: 44px !important;
    }

    /* Better spacing on mobile */
    product-card .p-5 {
        padding: 1rem !important;
    }

    /* Larger buttons on mobile */
    .bg-secondary.w-11.h-11 {
        width: 48px !important;
        height: 48px !important;
    }

    /* Form adjustments for mobile */
    .form-card {
        @apply p-6 rounded-2xl;
    }

    .btn-primary {
        @apply w-full;
    }
}

/* Dark mode support (future enhancement) */
@media (prefers-color-scheme: dark) {
    product-card {
        background: #1F2937;
        border-color: #374151;
    }
}

/* ============================================
   Form Styles - Kitchen Home Standard
   ============================================ */

/* Form Input Fields */
.form-input {
    @apply w-full px-4 py-3 rounded-xl border border-gray-200 outline-none transition-all;
    @apply bg-gray-50 focus:bg-white;
    @apply focus:border-secondary focus:ring-2 focus:ring-secondary/20;
}

.form-input:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.1);
}

/* Form Labels */
.form-label {
    @apply block text-sm font-bold text-gray-700 mb-2;
}

/* Form Icons */
.form-icon {
    @apply absolute left-3 top-3.5 text-gray-400;
}

/* Form Button Primary */
.btn-primary {
    @apply bg-secondary hover:bg-action-hover text-white font-bold py-3.5 px-6 rounded-xl;
    @apply shadow-lg hover:shadow-xl transition-all;
    @apply transform hover:scale-[1.02] active:scale-95;
}

/* Form Button Secondary */
.btn-secondary {
    @apply bg-white text-primary font-bold py-3 px-6 rounded-xl;
    @apply border-2 border-primary hover:bg-primary hover:text-white;
    @apply transition-all;
}

/* Checkbox and Radio Styles */
input[type="checkbox"],
input[type="radio"] {
    @apply text-secondary border-gray-300 rounded;
    @apply focus:ring-secondary focus:ring-2;
}

/* Select Dropdown */
select.form-input {
    @apply appearance-none bg-no-repeat bg-right;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Textarea */
textarea.form-input {
    @apply resize-none;
    min-height: 120px;
}

/* Form Groups */
.form-group {
    @apply space-y-2;
}

/* Form Card */
.form-card {
    @apply bg-white rounded-3xl shadow-2xl border border-gray-100;
    @apply p-8 relative overflow-hidden;
}

/* Form Card Background Decorations */
.form-card::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(255, 140, 66, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.form-card::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -20%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Form Validation States */
.form-input.error {
    @apply border-red-300 focus:border-red-500 focus:ring-red-200;
}

.form-input.success {
    @apply border-green-300 focus:border-green-500 focus:ring-green-200;
}

/* Password Toggle Button */
.password-toggle {
    @apply absolute right-3 top-3.5 text-gray-400;
    @apply hover:text-gray-600 cursor-pointer transition-colors;
}

/* Form Links */
.form-link {
    @apply text-secondary font-bold hover:text-action-hover;
    @apply transition-colors duration-200;
}

#mobile-menu {
    background-color: #1a1a2e !important;
}
