﻿/* ============================================
   RESET & BASE
============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   CONTAINER
============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   TOP BAR (DARK STRIP)
============================================ */

.top-bar {
    background: #1f2d3a;
    font-size: 14px;
}

.top-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.top-bar a {
    color: #ecf0f1;
    margin-right: 15px;
}

.top-bar a:hover {
    color: #f1c40f;
}

/* ============================================
   HEADER (BRANDED – MATCH FOOTER)
============================================ */

.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #2c3e50;
    min-height: 80px; /* CLS protection */
    transition: background 0.3s ease, box-shadow 0.3s ease;
    will-change: box-shadow;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    transition: padding 0.3s ease;
}

.site-logo {
    display: flex;
    align-items: center;
}

.site-logo a {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    transition: font-size 0.3s ease;
}

.custom-logo {
    max-height: 55px;
    transition: max-height 0.3s ease;
}

/* Shrink + shadow */
.main-header.shrink .header-container {
    padding: 10px 0;
}

.main-header.shrink .custom-logo {
    max-height: 42px;
}

.main-header.shrink .site-logo a {
    font-size: 1.2rem;
}

.main-header.scrolled {
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* ============================================
   SEARCH BAR
============================================ */

.search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
}

.search-bar form {
    display: flex;
}

.search-bar input {
    flex: 1;
    padding: 11px 14px;
    border: none;
    border-radius: 6px 0 0 6px;
    background: #ffffff;
    color: #333;
}

.search-bar button {
    padding: 11px 18px;
    border: none;
    background: #f1c40f;
    color: #2c3e50;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.2s ease;
}

.search-bar button:hover {
    background: #f39c12;
}

/* ============================================
   HEADER ACTIONS
============================================ */

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-icon,
.wishlist-icon {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #ffffff;
    font-size: 18px;
    transition: color 0.2s ease;
}

.cart-icon:hover,
.wishlist-icon:hover {
    color: #f1c40f;
}

.cart-count {
    margin-left: 6px;
    font-weight: 700;
    color: #f1c40f;
}

/* ============================================
   PRIMARY NAVIGATION
============================================ */

.primary-navigation {
    background: #2c3e50;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.primary-navigation a {
    color: #ecf0f1;
    font-weight: 500;
}

.primary-navigation a:hover {
    color: #f1c40f;
}

/* ============================================
   HERO SLIDER
============================================ */

.hero-banner {
    background: #f4f6f8;
    padding: 50px 0;
}

.hero-slider {
    border-radius: 14px;
    overflow: hidden;
}

.hero-slider .slide {
    display: none;
    align-items: center;
    gap: 3rem;
    padding: 3rem;
    background: #ffffff;
}

.hero-slider .slide.active {
    display: flex;
    animation: fadeIn 0.6s ease-in-out;
}

.hero-slider h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.hero-slider .price {
    font-size: 1.6rem;
    color: #e74c3c;
    margin-bottom: 1rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   SECTIONS + ACCENT UNDERLINE
============================================ */

.product-section,
.news-section {
    padding: 70px 0;
}

.section-title {
    font-size: 1.9rem;
    color: #2c3e50;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 4px;
    background: #f1c40f;
    border-radius: 2px;
}

/* ============================================
   PRODUCT GRID & CARD
============================================ */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 26px;
}

.product-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-6px);
}

.product-image {
    height: 220px;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-title {
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.price {
    padding: 0 15px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #e74c3c;
}

.product-card .button {
    margin: 15px;
    margin-top: auto;
}

/* ============================================
   BUTTONS
============================================ */

.button,
.btn {
    display: block;
    text-align: center;
    padding: 12px;
    background: #2c3e50;
    color: #ffffff;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.button:hover,
.btn:hover {
    background: #1f2d3a;
}

/* ============================================
   FOOTER
============================================ */

.main-footer {
    background: #2c3e50;
    color: #ffffff;
    padding: 60px 0 20px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h4 {
    margin-bottom: 15px;
}

.footer-column a {
    color: #bdc3c7;
}

.footer-column a:hover {
    color: #ffffff;
}

.copyright {
    text-align: center;
    border-top: 1px solid #34495e;
    padding-top: 20px;
    font-size: 0.9rem;
    color: #bdc3c7;
}

/* ============================================
   SCROLL TO TOP BUTTON
============================================ */

#scrollToTop {
    position: fixed;
    right: 20px;
    bottom: 90px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: #f1c40f;
    color: #2c3e50;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    display: none;
    z-index: 9999;
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);
    transition: background 0.2s ease, transform 0.2s ease;
}

#scrollToTop:hover {
    background: #f39c12;
    transform: translateY(-3px);
}

/* ============================================
   UTILITIES
============================================ */

.text-center { text-align: center; }
.hidden { display: none; }

/* ============================================
   HERO CTA POLISH
============================================ */

.hero-slider .cta-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 14px 28px;
    background: #f1c40f;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(241,196,15,0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-slider .cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(241,196,15,0.45);
}

.hero-slider .cta-button::after {
    content: "→";
    font-size: 1.1rem;
    transition: transform 0.25s ease;
}

.hero-slider .cta-button:hover::after {
    transform: translateX(4px);
}

/* ============================================
   PRODUCT CARD MICRO-INTERACTIONS
============================================ */

.product-card {
    position: relative;
}

.product-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    pointer-events: none;
    transition: box-shadow 0.3s ease;
}

.product-card:hover::after {
    box-shadow: inset 0 0 0 2px rgba(241,196,15,0.4);
}

.product-card:hover .product-title {
    color: #f39c12;
}

.product-card .price {
    transition: transform 0.25s ease;
}

.product-card:hover .price {
    transform: scale(1.05);
}

.product-card .button {
    transition: background 0.2s ease, transform 0.2s ease;
}

.product-card:hover .button {
    background: #f1c40f;
    color: #2c3e50;
    transform: translateY(-2px);
}

/* ============================================
   LIVE SEARCH DROPDOWN
============================================ */

.live-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    margin-top: 8px;
    z-index: 9999;
    overflow: hidden;
}

.live-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s ease;
}

.live-search-item:hover {
    background: #f8f9fa;
}

.live-search-item img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
}

.live-search-title {
    font-weight: 600;
    color: #2c3e50;
}

.live-search-price {
    font-size: 0.9rem;
    color: #e74c3c;
}

/* ============================================
   STICKY ADD TO CART (MOBILE)
============================================ */

.sticky-add-to-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #eee;
    padding: 12px 15px;
    display: none;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
}

.sticky-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e74c3c;
}

.sticky-cart-btn {
    background: #f1c40f;
    color: #2c3e50;
    padding: 10px 18px;
    border-radius: 30px;
    font-weight: 700;
}

/* ============================================
   "PEOPLE ALSO SEARCHED" SECTION
============================================ */

.live-search-label {
    padding: 10px 15px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #7f8c8d;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ============================================
   FINAL FIX: PREVENT PRODUCT TITLE OVER IMAGE
============================================ */

/* Force strict vertical flow */
.product-card {
    display: flex;
    flex-direction: column;
}

/* Image must fully reserve space */
.product-image {
    flex: 0 0 220px;
    position: relative;
}

/* Kill any accidental absolute positioning */
.product-title,
.product-card h2,
.product-card h3,
.product-card a {
    position: static !important;
}

/* Title ALWAYS below image */
.product-title {
    margin-top: 12px;
    padding: 0 15px;
    background: #ffffff;
    z-index: 1;
}

/* Prevent anchor wrapping from collapsing */
.product-card a {
    display: block;
}

.product-card > * + * {
    margin-top: 6px;
}

/* WooCommerce-specific title safety */
.woocommerce-loop-product__title,
.woocommerce-loop-product__title a {
    position: static !important;
    display: block;
}
