/* Landing Page (Index) Specific Styles */

/* Hero Section */
.hero-wrapper {
    margin-top: 0; /* No margin - main already has padding-top for header */
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: var(--spacing-lg);
    overflow: visible !important;
    position: relative;
    z-index: 1;
}

.hero {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 400px; /* Changed from height to min-height to allow expansion */
    border-radius: 0; /* Remove border-radius to prevent clipping */
    overflow: visible !important;
    background-color: var(--text-secondary);
    background-image: url('https://images.unsplash.com/photo-1506377247377-2a5b3b417ebb?ixlib=rb-4.0.3&auto=format&fit=crop&w=1600&q=80');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    box-shadow: var(--shadow-xl);
    z-index: 1;
}

/* Add rounded corners using pseudo-element for background only */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0 0 12px 12px;
    background: inherit;
    background-image: inherit;
    background-size: inherit;
    background-position: inherit;
    z-index: -1;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    width: 100%;
    padding: 0 24px;
    overflow: visible !important;
    /* Create a new stacking context for the search dropdown */
    isolation: isolate;
}

/* Ensure search dropdown overlays properly in hero */
.hero-content .search-container {
    position: relative;
    z-index: 10001;
    text-align: left; /* Override hero's center alignment */
}

.hero-content .search-box {
    position: relative;
    z-index: 10001;
}

/* Position dropdown to escape hero's clipping - use absolute relative to search-container */
.hero-content .search-container {
    position: relative;
    z-index: 10001;
    text-align: left; /* Override hero's center alignment */
    /* Ensure container doesn't clip */
    overflow: visible !important;
}

.hero-content .search-suggestions {
    z-index: 10002 !important;
    text-align: left !important; /* Ensure left alignment */
    position: absolute !important;
    background-color: #fff !important;
    /* Ensure dropdown extends beyond hero bounds */
    transform: translateZ(0); /* Force hardware acceleration and new stacking context */
    will-change: transform; /* Hint to browser for optimization */
    /* Ensure it's not clipped */
    clip: auto !important;
    clip-path: none !important;
    /* Allow vertical scrolling for scrollbar, but prevent horizontal overflow */
    overflow-x: hidden !important;
    overflow-y: auto !important;
    /* Ensure max-height is applied for scrollbar to appear */
    max-height: 444px !important;
}

.hero-content .search-suggestions__header,
.hero-wrapper .search-suggestions__header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.hero-content .search-suggestions__list,
.hero-wrapper .search-suggestions__list {
    text-align: left !important;
}

.hero-content .search-suggestions__item,
.hero-wrapper .search-suggestions__item {
    text-align: left !important;
    justify-content: flex-start !important;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.125rem;
    margin-bottom: 32px;
    opacity: 0.9;
}

.search-icon, .camera-icon {
    color: var(--text-tertiary);
    padding: 0 var(--spacing-sm);
    cursor: pointer;
}

/* Filters */
.filters {
    padding: var(--spacing-lg) 0;
    overflow-x: auto;
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

.pill {
    background-color: var(--bg-pill);
    color: var(--text-primary);
    padding: var(--spacing-sm) 20px var(--spacing-sm) var(--spacing-md);
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--pill-border);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all 0.2s ease;
}

.pill:hover {
    background-color: var(--bg-pill-hover);
    transform: translateY(-1px);
    border-color: var(--action-primary);
}

.pill-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--border-subtle);
}

[data-theme="dark"] .pill {
    color: white;
    border-color: var(--pill-border);
}

[data-theme="dark"] .pill:hover {
    background-color: var(--bg-pill-hover);
    border-color: var(--action-primary);
}

/* Section Title */
.section-title {
    text-align: left;
    color: var(--text-page-heading);
    margin-bottom: var(--spacing-lg);
    font-size: 24px;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--spacing-lg);
    padding-bottom: var(--spacing-2xl);
}

/* Bottle Card (Vertical) */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-img {
    height: 240px;
    background-color: white;
    position: relative;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.card-img a {
    display: block;
    width: 100%;
    height: 100%;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    mix-blend-mode: multiply;
}

.card-badge {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    background: var(--badge-error);
    background-color: #d32f2f;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 1;
}

.card-body {
    padding: var(--spacing-md);
    text-align: left;
}

.producer {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.bottle-name {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--text-card-heading);
    margin-bottom: var(--spacing-sm);
    font-weight: bold;
}

.meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.price {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-card-heading);
}

.rating {
    color: var(--action-primary);
    font-weight: bold;
}

.btn-card {
    width: 100%;
    text-align: center;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    padding-bottom: var(--spacing-2xl);
}

.cat-tile {
    height: 300px;
    background-color: var(--border-subtle);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.cat-tile img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-label {
    position: relative;
    z-index: 2;
    color: white;
    padding: var(--spacing-lg);
    font-family: var(--font-heading);
    font-size: 24px;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

/* Editorial Grid */
.editorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.editorial-card {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.editorial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.editorial-img {
    height: 180px;
    background-color: var(--bg-surface-hover);
    position: relative;
}

.editorial-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.editorial-content {
    padding: var(--spacing-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editorial-tag {
    font-size: 12px;
    font-weight: bold;
    color: var(--action-primary-hover);
    margin-bottom: var(--spacing-sm);
    display: block;
}

.editorial-title {
    font-family: var(--font-heading);
    font-size: 18px;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    line-height: 1.3;
}

.editorial-meta {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--spacing-md);
    flex: 1;
}

.editorial-footer {
    font-size: 12px;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--spacing-md);
    margin-top: auto;
}

/* Educational Rails */
.edu-rail {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.edu-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: var(--spacing-lg);
    border-radius: 8px;
    text-align: center;
    transition: transform 0.2s;
}

.edu-card:hover {
    transform: translateY(-4px);
    border-color: var(--action-secondary);
}

.edu-icon {
    font-size: 32px;
    margin-bottom: var(--spacing-md);
    display: block;
}

.edu-title {
    font-weight: bold;
    margin-bottom: var(--spacing-sm);
}

.edu-desc {
    font-size: 14px;
    color: var(--text-secondary);
}
