/* Dream Catcher - Mobile-Optimized Styles CSS */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Playfair Display', 'Playfair Display', 'Playfair Display', 'Playfair Display', 'Playfair Display';
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation Styles */
.navbar {
    background: linear-gradient(135deg, #ffffff , #5f7a65);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo {
    height: 70px;
    width: auto;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

/* Enhanced navigation link styles with current page indicator */
.nav-menu a {
    color: #4B2E2E;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 1.3rem 1rem;
    border-radius: 4px;
    position: relative;
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

/* Current page indicator */
.nav-menu a[aria-current="page"] {
    background-color: rgba(255, 255, 255, 0.2);
    color: #2d3748;
    font-weight: 600;
}

.nav-menu a[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background-color: #4B2E2E;
    border-radius: 1px;
}

.nav-menu a:not(:has(img)) {
  font-size: 1.4rem; /* Or whatever size you prefer */
}


/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: "▼";
    font-size: 0.8rem;
    margin-left: 5px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu a {
    color: #333;
    padding: 12px 16px;
    display: block;
    text-decoration: none;
    transition: background-color 0.3s ease;
    border-radius: 0;
}

.dropdown-menu a:hover {
    background-color: #f7fafc;
    color: #2c5282;
}

/* Active dropdown item */
.dropdown-menu a.active {
    background-color: #2c5282;
    color: white;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #f7eee5 0%, #faf0e4 100%);
    color: #4B2E2E;
    padding: 120px 0 80px;
    text-align: center;
    margin-top: 70px;
}

.hero-content h1 {
    font-size: 6rem;
    margin-bottom: -1.3rem;
    font-weight: 450;
}

.hero-tagline {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 300;
}

.hero-button {
    display: inline-block;
    margin-top: 0rem;
    padding: 0.75rem 1.5rem;
    background: #c6a27e;
    color: #4B2E2E;
    font-weight: bold;
    text-decoration: none;
    border: 1px solid #000000;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.hero-button:hover {
    background: transparent;
    color: #bea7a7;
    border-color: #000000;
    cursor: pointer;
}

/* Featured Section */
.featured-section {
    padding: 80px 0;
    background-color: white;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #2d3748;
    font-weight: 600;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    transition: opacity 0.3s ease;
}

/* Product Card Styles */
.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Enhanced image loading states */
.image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #f0f0f0 25%, #e0e0e0 25%, #e0e0e0 50%, #f0f0f0 50%, #f0f0f0 75%, #e0e0e0 75%);
    background-size: 20px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
}

.loading-placeholder {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2c5282;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.product-image img.loaded {
    opacity: 1;
}

.product-image img.fallback {
    opacity: 0.7;
    filter: grayscale(20%);
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.product-description {
    color: #718096;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.product-category {
    display: inline-block;
    background: linear-gradient(135deg, #2c5282, #319795);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c5282;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Error and No Products Messages */
.error-container {
    text-align: center;
    padding: 3rem;
    background: #fed7d7;
    border: 1px solid #fc8181;
    border-radius: 8px;
    margin: 2rem 0;
}

.error-message {
    color: #c53030;
}

.error-message h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2d3748;
}

.error-message p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.btn-retry {
    background: #2c5282;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-retry:hover {
    background: #2a4a7c;
}

.no-products,
.no-products-message {
    text-align: center;
    padding: 3rem;
    color: #718096;
    font-size: 1.1rem;
    grid-column: 1 / -1;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.btn-show-all {
    background: #319795;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.btn-show-all:hover {
    background: #2c7a7b;
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 2rem 0;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer p:last-child {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Responsive Design - Enhanced Mobile Support */

/* Large Tablets and Small Laptops */
@media (max-width: 1024px) {
    .hero-content h1 {
        font-size: 4.5rem;
    }
    
    .featured-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .navbar {
        padding: 0.8rem 0;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 15px;
    }
    
    .logo {
        height: 50px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
        width: 100%;
    }
    
    .nav-menu a {
        padding: 0.8rem;
        font-size: 0.95rem;
    }
    
    .hero {
        padding: 80px 0 60px;
        margin-top: 100px; /* Adjusted for taller mobile nav */
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
        margin-bottom: -0.8rem;
    }
    
    .hero-tagline {
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-button {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .featured-section {
        padding: 60px 0;
    }
    
    .featured-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .section-title {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Enhanced dropdown for tablets */
    .dropdown-menu {
        position: fixed;
        top: 120px;
        left: 15px;
        right: 15px;
        width: auto;
        min-width: auto;
    }
}

/* Mobile Phones */
@media (max-width: 480px) {
    .navbar {
        padding: 0.5rem 0;
    }
    
    .nav-container {
        padding: 0 10px;
        gap: 0.8rem;
    }
    
    .logo {
        height: 40px;
    }
    
    .nav-menu {
        gap: 0.5rem;
        font-size: 0.85rem;
    }
    
    .nav-menu a {
        padding: 0.6rem 0.8rem;
    }
    
    .hero {
        padding: 60px 0 40px;
        margin-top: 90px;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
        margin-bottom: -0.5rem;
        line-height: 1.1;
    }
    
    .hero-tagline {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
        padding: 0 10px;
    }
    
    .hero-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .featured-section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 10px;
    }
    
    .product-card {
        margin: 0;
        max-width: 100%;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 1.1rem;
    }
    
    .product-description {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .product-category {
        font-size: 0.8rem;
        padding: 0.25rem 0.6rem;
    }
    
    .container {
        padding: 0 1px;
    }
    
    .footer {
        padding: 1.5rem 0;
        font-size: 0.9rem;
    }
    
    /* Mobile dropdown improvements */
    .dropdown-menu {
        top: 80px;
        left: 10px;
        right: 10px;
        border-radius: 4px;
    }
    
    .dropdown-menu a {
        padding: 15px 16px;
        font-size: 0.95rem;
        border-bottom: 1px solid #f1f1f1;
    }
    
    .dropdown-menu a:last-child {
        border-bottom: none;
    }
    
    /* Touch-friendly interactions */
    .product-card:hover {
        transform: none; /* Disable hover effects on mobile */
    }
    
    .nav-menu a:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }
}

/* Very Small Screens */
@media (max-width: 360px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-tagline {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .nav-menu {
        font-size: 0.8rem;
    }
    
    .nav-menu a {
        padding: 0.5rem 0.6rem;
    }
    
    .featured-grid {
        padding: 0 5px;
    }
    
    .container {
        padding: 0 5px;
    }
}

/* Landscape Mobile Orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 40px 0 30px;
        margin-top: 80px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        margin-bottom: 0;
    }
    
    .hero-tagline {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .featured-section {
        padding: 30px 0;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Enhanced Focus Styles for Accessibility */
a:focus,
button:focus,
.dropdown-toggle:focus {
    outline: 2px solid #319795;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Skip to main content link for accessibility */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #2c5282;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-to-main:focus {
    top: 6px;
}

/* Touch-friendly tap targets */
@media (max-width: 768px) {
    a, button, .product-card {
        min-height: 44px; /* Minimum touch target size */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-menu a {
        min-height: 44px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer {
        display: none;
    }
    
    .hero {
        margin-top: 0;
        padding: 2rem 0;
    }
    
    .product-card {
        break-inside: avoid;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .product-image img {
        transition: none;
    }
}

/* Tiny spinner inside the dropdown */
.spinner-small {
  width: 16px;
  height: 16px;
  border-width: 2px;
  margin-right: 8px;
  vertical-align: middle;
}

/* Style the loading placeholder */
.dropdown-menu li.loading {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  color: #666;
  font-style: italic;
  pointer-events: none; /* disable clicks while loading */
}

/* Tiny spinner for dropdown */
.spinner-small {
  width: 16px;
  height: 16px;
  border-width: 2px;
  margin-right: 8px;
  vertical-align: middle;
}
.dropdown-menu li.loading {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  color: #666;
  font-style: italic;
  pointer-events: none;
}

/* Explore All button (reuse .btn-show-all) */
.explore-all {
  text-align: center;
  margin-top: 2rem;
}
