/* Additional Styles for EasyEase Ultimate E-commerce */

/* Product Grid Styles */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Cart Styles */
.cart-item {
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-btn {
    width: 2rem;
    height: 2rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    cursor: pointer;
}

.quantity-btn:hover {
    background: #f3f4f6;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading-spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 1rem;
    height: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
    border-color: #3b82f6;
}

/* Utility Classes */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Dark mode adjustments */
[data-theme="dark"] .product-card {
    border-color: #374151;
    background: #1f2937;
}

[data-theme="dark"] .form-input {
    background: #374151;
    border-color: #4b5563;
    color: white;
}

[data-theme="dark"] .form-input:focus {
    border-color: #3b82f6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Checkout Styles */
.checkout-summary {
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

[data-theme="dark"] .checkout-summary {
    background: #374151;
}

/* Wishlist Styles */
.wishlist-item {
    transition: all 0.3s ease;
}

.wishlist-item:hover {
    background: #f9fafb;
}

[data-theme="dark"] .wishlist-item:hover {
    background: #374151;
}

/* Enhanced Header Styles */
.nav-link {
    transition: color 0.3s ease;
}

#mobile-menu {
    transition: all 0.3s ease-in-out;
}

#mobile-shop-menu {
    transition: all 0.3s ease-in-out;
}

/* Rotate animation for dropdown arrows */
.rotate-180 {
    transform: rotate(180deg);
}

/* Smooth transitions for dropdowns */
#user-dropdown, 
#desktop-shop-menu > div {
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    transform: translateY(-10px);
}

#desktop-shop-menu:hover > div,
.group:hover #user-dropdown {
    transform: translateY(0);
}

/* Mobile menu backdrop */
@media (max-width: 1023px) {
    #mobile-menu {
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
}

/* Ensure proper z-index for dropdowns */
#user-dropdown,
#desktop-shop-menu > div,
#search-results {
    z-index: 1000;
}

/* Loading state for auth */
.auth-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Enhanced Desktop Account Menu Styles */
#desktop-account-menu {
    position: relative;
}

#desktop-account-menu .group:hover .absolute {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Ensure proper dropdown positioning */
#desktop-account-menu .absolute {
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
}

/* Smooth transitions for account dropdown */
#desktop-account-menu .absolute {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top right;
}

/* Account button hover effects */
#account-btn:hover {
    background-color: rgba(243, 244, 246, 0.5);
}

.dark #account-btn:hover {
    background-color: rgba(55, 65, 81, 0.5);
}

/* Dropdown menu items */
#auth-dropdown-content a {
    transition: all 0.2s ease;
}

#auth-dropdown-content a:hover {
    background-color: #f3f4f6;
    padding-left: 1.25rem;
}

.dark #auth-dropdown-content a:hover {
    background-color: #374151;
}

/* Chevron animation */
.group:hover .fa-chevron-down {
    transform: rotate(180deg);
}

/* Ensure dropdown appears above other content */
#desktop-account-menu .absolute {
    z-index: 1000;
}

/* Mobile menu improvements */
#mobile-menu {
    transition: all 0.3s ease-in-out;
    max-height: 80vh;
    overflow-y: auto;
}

#mobile-shop-menu {
    transition: all 0.3s ease-in-out;
}

/* Fix for any potential overflow issues */
#desktop-account-menu {
    overflow: visible;
}

/* Enhanced Desktop Dropdown Styles */
#desktop-account-menu .absolute,
#desktop-shop-menu .absolute {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    pointer-events: auto !important;
}

/* Ensure dropdowns are above other content */
#desktop-account-menu,
#desktop-shop-menu {
    position: relative;
    z-index: 1000;
}

#desktop-account-menu .absolute,
#desktop-shop-menu .absolute {
    z-index: 1001;
}

/* Remove any conflicting transforms */
#desktop-account-menu .absolute {
    transform: none !important;
}

/* Backdrop for dropdowns */
#dropdown-backdrop {
    z-index: 999;
}

/* Smooth hover transitions */
#account-btn,
#desktop-shop-menu > a {
    transition: all 0.2s ease;
}

/* Ensure visibility classes work */
.opacity-0 {
    opacity: 0 !important;
}

.opacity-100 {
    opacity: 1 !important;
}

.invisible {
    visibility: hidden !important;
}

.visible {
    visibility: visible !important;
}

/* Mobile menu improvements */
#mobile-menu {
    transition: all 0.3s ease-in-out;
    max-height: 80vh;
    overflow-y: auto;
}

#mobile-shop-menu {
    transition: all 0.3s ease-in-out;
}

/* Search Results Dropdown Styles */
#hero-search-results {
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

#hero-search-results a {
    text-decoration: none;
    color: inherit;
}

/* Search input focus styles */
#hero-search-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Smooth transitions for search results */
#hero-search-results {
    transition: all 0.2s ease-in-out;
}

/* Search tag hover effects */
.search-tag {
    transition: all 0.2s ease-in-out;
}

.search-tag:hover {
    transform: translateY(-1px);
}

/* Mobile-first responsive styles for index.html */

/* Quick Action Bar */
.quick-action-bar {
    background: rgb(243 244 246);
    padding: 0.75rem 0;
    border-bottom: 1px solid rgb(229 231 235);
}

.dark .quick-action-bar {
    background: rgb(31 41 55);
    border-bottom-color: rgb(55 65 81);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(to right, rgb(37 99 235), rgb(126 58 242));
    color: white;
    padding: 3rem 1rem;
}

@media (min-width: 768px) {
    .hero-section {
        padding: 5rem 1rem;
    }
}

.hero-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.2;
}

@media (min-width: 640px) {
    .hero-title {
        font-size: 3rem;
    }
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 4rem;
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: 6rem;
    }
}

.hero-subtitle {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
}

/* Search Container */
.search-container {
    display: flex;
    flex-direction: column;
}

@media (min-width: 640px) {
    .search-container {
        flex-direction: row;
    }
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: rgb(17 24 39);
    font-size: 1rem;
    outline: none;
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .search-input {
        padding: 1rem 1.5rem;
        border-radius: 0.5rem 0 0 0.5rem;
        margin-bottom: 0;
        font-size: 1.125rem;
    }
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-button {
    background: rgb(250 204 21);
    color: rgb(17 24 39);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

@media (min-width: 640px) {
    .search-button {
        padding: 1rem 2rem;
        border-radius: 0 0.5rem 0.5rem 0;
        font-size: 1.125rem;
    }
}

.search-button:hover {
    background: rgb(253 224 71);
}

/* Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    color: rgb(17 24 39);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
    z-index: 50;
    max-height: 24rem;
    overflow-y: auto;
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid rgb(229 231 235);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgb(243 244 246);
}

.search-result-item img {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-right: 0.75rem;
}

@media (min-width: 640px) {
    .search-result-item img {
        width: 3rem;
        height: 3rem;
    }
}

.search-result-info {
    flex: 1;
}

.search-result-info h4 {
    font-weight: 600;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .search-result-info h4 {
        font-size: 0.9rem;
    }
}

.search-result-info p {
    color: rgb(75 85 99);
    font-size: 0.75rem;
}

.no-results {
    padding: 1rem;
    text-align: center;
    color: rgb(107 114 128);
}

.no-results i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Popular Searches */
.popular-searches {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.popular-label {
    font-size: 0.875rem;
    opacity: 0.8;
    width: 100%;
    text-align: center;
}

@media (min-width: 640px) {
    .popular-label {
        width: auto;
        text-align: left;
    }
}

.search-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: none;
    color: white;
    cursor: pointer;
}

.search-tag:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Sections Common Styles */
.categories-section,
.featured-section,
.why-choose-section {
    padding: 3rem 1rem;
}

@media (min-width: 768px) {
    .categories-section,
    .featured-section,
    .why-choose-section {
        padding: 4rem 1rem;
    }
}

.section-title {
    font-size: 1.875rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .section-title {
        font-size: 2.25rem;
        margin-bottom: 3rem;
    }
}

/* Categories Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

.category-card {
    text-decoration: none;
    color: inherit;
}

.category-icon {
    background: rgb(243 244 246);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.dark .category-icon {
    background: rgb(55 65 81);
}

.category-icon:hover {
    background: rgb(219 234 254);
}

.dark .category-icon:hover {
    background: rgb(30 58 138);
}

.category-icon i {
    font-size: 1.5rem;
    color: rgb(37 99 235);
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .category-icon {
        padding: 1.5rem;
    }
    .category-icon i {
        font-size: 2.25rem;
        margin-bottom: 0.75rem;
    }
}

.category-icon h3 {
    font-weight: 600;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .category-icon h3 {
        font-size: 1rem;
    }
}

/* Featured Section */
.featured-section {
    background: rgb(249 250 251);
}

.dark .featured-section {
    background: rgb(17 24 39);
}

.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

@media (min-width: 640px) {
    .section-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 3rem;
        gap: 0;
    }
}

.section-header h2 {
    font-size: 1.875rem;
    font-weight: bold;
}

@media (min-width: 640px) {
    .section-header h2 {
        font-size: 2.25rem;
    }
}

.view-all-link {
    color: rgb(37 99 235);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
}

.view-all-link:hover {
    color: rgb(30 58 138);
}

@media (min-width: 640px) {
    .view-all-link {
        font-size: 1rem;
    }
}

.featured-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .featured-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.product-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.dark .product-card {
    background: rgb(55 65 81);
}

.product-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-image {
    background: rgb(243 244 246);
    overflow: hidden;
}

.dark .product-image {
    background: rgb(55 65 81);
}

.product-image img {
    width: 100%;
    height: 8rem;
    object-fit: cover;
    transition: all 0.3s ease;
}

@media (min-width: 640px) {
    .product-image img {
        height: 12rem;
    }
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 0.75rem;
}

@media (min-width: 640px) {
    .product-info {
        padding: 1rem;
    }
}

.product-info h3 {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 640px) {
    .product-info h3 {
        font-size: 1rem;
    }
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .product-actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
    }
}

.product-price {
    font-size: 1rem;
    font-weight: bold;
    color: rgb(37 99 235);
}

@media (min-width: 640px) {
    .product-price {
        font-size: 1.125rem;
    }
}

.add-to-cart-btn {
    background: rgb(37 99 235);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    background: rgb(30 58 138);
}

@media (min-width: 640px) {
    .add-to-cart-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem 1rem;
}

.no-products i {
    font-size: 2.25rem;
    color: rgb(156 163 175);
    margin-bottom: 1rem;
}

.no-products h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.no-products p {
    color: rgb(107 114 128);
    font-size: 0.875rem;
}

/* Why Choose Section */
.why-choose-section {
    background: white;
}

.dark .why-choose-section {
    background: rgb(55 65 81);
}

.why-choose-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .why-choose-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

.feature-card {
    text-align: center;
}

.feature-icon {
    background: rgb(219 234 254);
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
}

.dark .feature-icon {
    background: rgb(30 58 138);
}

@media (min-width: 640px) {
    .feature-icon {
        width: 4rem;
        height: 4rem;
        margin-bottom: 1rem;
    }
}

.feature-icon i {
    font-size: 1.25rem;
    color: rgb(37 99 235);
}

@media (min-width: 640px) {
    .feature-icon i {
        font-size: 1.5rem;
    }
}

.feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .feature-card h3 {
        font-size: 1.25rem;
    }
}

.feature-card p {
    color: rgb(107 114 128);
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .feature-card p {
        font-size: 1rem;
    }
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(to right, rgb(59 130 246), rgb(147 51 234));
    color: white;
    padding: 3rem 1rem;
    text-align: center;
}

.newsletter-section h2 {
    font-size: 1.875rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .newsletter-section h2 {
        font-size: 2.25rem;
    }
}

.newsletter-section p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

@media (min-width: 640px) {
    .newsletter-section p {
        font-size: 1.25rem;
        margin-bottom: 2rem;
    }
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    max-width: 28rem;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .newsletter-form {
        flex-direction: row;
    }
}

.newsletter-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: rgb(17 24 39);
    font-size: 0.875rem;
    outline: none;
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .newsletter-input {
        padding: 0.75rem 1rem;
        border-radius: 0.5rem 0 0 0.5rem;
        margin-bottom: 0;
        font-size: 1rem;
    }
}

.newsletter-button {
    background: rgb(250 204 21);
    color: rgb(17 24 39);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-button:hover {
    background: rgb(253 224 71);
}

@media (min-width: 640px) {
    .newsletter-button {
        border-radius: 0 0.5rem 0.5rem 0;
        font-size: 1rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}