/* =============================================
   Products Page Specific Styles
   ============================================= */

/* Products Hero Section */
.products-hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, 
        var(--background) 0%, 
        rgba(139, 198, 63, 0.05) 50%, 
        var(--background) 100%
    );
}

.products-hero .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        var(--background) 0%, 
        rgba(139, 198, 63, 0.1) 100%
    );
}

.products-hero .hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
    text-align: left;
}

.products-hero .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(139, 198, 63, 0.1);
    border: 1px solid rgba(139, 198, 63, 0.2);
    border-radius: 50px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out;
}

.products-hero .hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.products-hero .title-line {
    display: block;
    animation: fadeInUp 0.6s ease-out;
}

.products-hero .title-line:nth-child(2) {
    animation-delay: 0.2s;
}

.products-hero .hero-subtitle {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

.products-hero .hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: left;
    align-items: center;
    animation: fadeInUp 0.6s ease-out 0.8s both;
}

/* Categories Section */
.categories-section {
    padding: 6rem 0;
    background: white;
    overflow: hidden;
}

.categories-carousel {
    margin-top: 3rem;
    position: relative;
}

.category-track {
    display: flex;
    gap: 2rem;
    animation: scrollRight 30s linear infinite;
    width: max-content;
}

@keyframes scrollRight {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.category-card {
    min-width: 320px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.category-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.category-card:hover .category-image img {
    transform: scale(1.1);
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

.category-content {
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.product-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.view-category-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-category-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Auto-color detection for category cards */
.category-card[data-color] .category-title {
    color: attr(data-color);
}

.category-card[data-color] .view-category-btn {
    background: attr(data-color);
}

/* Products Section */
.products-section {
    padding: 6rem 0;
}

.products-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 3rem 0 2rem;
    gap: 2rem;
    flex-wrap: wrap;
}

.category-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    position: relative;
}

.category-filter {
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(139, 198, 63, 0.2);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.category-filter:hover,
.category-filter.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.more-categories {
    position: relative;
}

.hidden-categories {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 150px;
    z-index: 10;
}

.hidden-categories.show {
    display: flex;
}

.hidden-categories .category-filter {
    text-align: left;
    width: 100%;
}

.search-filter {
    display: flex;
    gap: 1rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
}

#productSearch {
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid rgba(139, 198, 63, 0.2);
    border-radius: 10px;
    background: white;
    font-size: 0.9rem;
    width: 300px;
    transition: all 0.3s ease;
}

#productSearch:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 198, 63, 0.1);
}

/* Search Results Indicator */
.search-results-indicator {
    background: linear-gradient(135deg, rgba(139, 198, 63, 0.05), rgba(139, 198, 63, 0.1));
    border: 1px solid rgba(139, 198, 63, 0.2);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-query {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.search-count {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
    background: rgba(139, 198, 63, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.clear-search {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(139, 198, 63, 0.3);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.clear-search:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

@media (max-width: 768px) {
    .search-results-indicator {
        flex-direction: column;
        text-align: center;
    }
    
    .search-info {
        justify-content: center;
    }
}



/* Load More Section */
.load-more-section {
    text-align: center;
    margin-top: 4rem;
}

/* Can't Find Section */
.cant-find-section {
    padding: 6rem 0;
    background: white;
    text-align: center;
}

.cant-find-content {
    max-width: 600px;
    margin: 0 auto;
}

.cant-find-icon {
    color: var(--primary);
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.cant-find-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.cant-find-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.cant-find-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Order CTA Section */
.order-cta {
    padding: 6rem 0;
    color: white;
}

.cta-wrapper {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

.cta-content {
    margin-bottom: 3rem;
}

.cta-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.cta-features {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.feature-item svg {
    color: rgba(255, 255, 255, 0.8);
}

.cta-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .products-hero .hero-container {
        padding: 0 1rem;
        text-align: center;
    }

    .products-hero .hero-actions {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .products-hero .hero-actions .btn-modern {
        justify-content: center;
    }

    .categories-section {
        padding: 4rem 0;
    }

    .category-track {
        gap: 1rem;
    }

    .category-card {
        min-width: 280px;
    }

    .products-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .category-filters {
        justify-content: center;
    }

    .search-filter {
        justify-content: center;
    }

    #productSearch {
        width: 100%;
        max-width: 300px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cta-features {
        flex-direction: column;
        gap: 1.5rem;
    }

    .cta-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cant-find-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .products-hero .hero-title {
        font-size: 2rem;
    }

    .products-hero .hero-subtitle {
        font-size: 1rem;
    }

    .categories-section,
    .products-section,
    .cant-find-section,
    .order-cta {
        padding: 3rem 0;
    }

    .category-card {
        min-width: 250px;
    }

    .category-content {
        padding: 1rem;
    }

    .product-content {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .cta-title {
        font-size: 1.75rem;
    }
}

/* Product filtering and search animations */
.product-card {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s ease;
}

.product-card.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.product-card.animate-in {
    animation: fadeInUp 0.6s ease-out;
}

/* Category carousel pause on hover */
.categories-carousel:hover .category-track {
    animation-play-state: paused;
}

/* Smooth scrolling for category clicks */
html {
    scroll-behavior: smooth;
}

/* =============================================
   Product Details Modal
   ============================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 1200px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 0;
    border-bottom: 1px solid rgba(139, 198, 63, 0.1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(139, 198, 63, 0.1);
    color: var(--primary);
}

.modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

/* Modal Image Section */
.modal-image-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-image {
    width: 100%;
    height: 400px;
    border-radius: 15px;
    overflow: hidden;
    background: #f5f5f5;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-gallery {
    margin-top: 1rem;
}

.gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.gallery-thumb {
    min-width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.gallery-thumb.active,
.gallery-thumb:hover {
    border-color: var(--primary);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal Info Section */
.modal-info-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.product-header {
    border-bottom: 1px solid rgba(139, 198, 63, 0.1);
    padding-bottom: 1rem;
}

.product-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.product-category {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(139, 198, 63, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.product-description {
    line-height: 1.6;
    color: var(--text-secondary);
}

.product-description p {
    margin: 0;
    font-size: 1.1rem;
}

.product-features h3,
.product-specifications h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.product-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.product-features li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.product-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.spec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(139, 198, 63, 0.05);
    border-radius: 8px;
}

.spec-label {
    font-weight: 500;
    color: var(--text-primary);
}

.spec-value {
    color: var(--text-secondary);
}

.modal-info-section .product-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-info-section .product-tags span {
    padding: 0.5rem 1rem;
    background: rgba(139, 198, 63, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(139, 198, 63, 0.1);
}

/* Modal Responsive Design */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 1rem;
    }
    
    .modal-container {
        max-height: 90vh;
    }
    
    .modal-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }
    
    .modal-header {
        padding: 1.5rem 1.5rem 0;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .product-header h1 {
        font-size: 1.5rem;
    }
    
    .spec-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 0.5rem;
    }
    
    .modal-container {
        max-height: 95vh;
        border-radius: 15px;
    }
    
    .modal-content {
        padding: 1rem;
    }
    
    .modal-header {
        padding: 1rem 1rem 0;
    }
}