/**
 * Homepage Styles - Pinterest Layout
 * 
 * @package PinterestShop
 * @version 1.0.0
 */

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero-section {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: #fff;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
}

.hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.1) 2px, transparent 2px);
    background-size: 50px 50px;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
    color: #ffffff;
}

.hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 40px;
    opacity: 1;
    line-height: 1.6;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
    color: #ffffff;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.btn-large {
    padding: 18px 35px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: #e60023;
    color: #fff;
    border: 2px solid #e60023;
}

.btn-primary:hover {
    background: #c8001f;
    border-color: #c8001f;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(230, 0, 35, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.8);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
    transform: translateY(-3px);
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
}

.hero-search-form {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.hero-search-field {
    width: 100%;
    padding: 20px 60px 20px 25px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    background: rgba(255,255,255,0.95);
    color: #333;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.hero-search-field:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.hero-search-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    background: #e60023;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hero-search-submit:hover {
    background: #c8001f;
    transform: translateY(-50%) scale(1.1);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 15px;
    margin-top: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

/* ==========================================================================
   QUICK FILTERS
   ========================================================================== */

.quick-filters-section {
    padding: 30px 0;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.quick-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 24px;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.filter-btn:hover,
.filter-btn.active {
    background: #e60023;
    border-color: #e60023;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(230, 0, 35, 0.3);
}

.category-count {
    font-size: 0.85em;
    opacity: 0.8;
    margin-left: 5px;
}

/* ==========================================================================
   PRODUCTS SECTION
   ========================================================================== */

.products-section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.homepage-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
    align-items: start;
}

.homepage-product-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.4s ease;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.homepage-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.homepage-product-image {
    position: relative;
    overflow: hidden;
}

.product-image-link {
    display: block;
}

.homepage-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.homepage-product-card:hover .homepage-product-image img,
.homepage-product-card:hover .homepage-product-image video {
    transform: scale(1.08);
}

/* Video styling */
.homepage-product-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.homepage-product-image iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.product-video-embed {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.homepage-product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 20px 20px 0 0;
    z-index: 2;
}

.homepage-product-card:hover .homepage-product-overlay {
    opacity: 1;
}

.product-quick-actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    justify-content: center;
}

.homepage-product-card:hover .product-quick-actions {
    transform: translateY(0);
}

.quick-action-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Like button specific styling */
.btn-like {
    flex-direction: column;
}

.btn-like .like-count {
    font-size: 9px;
    font-weight: 600;
    color: #666;
    margin-top: 1px;
    line-height: 1;
    display: block;
}

.btn-like.liked {
    background: rgba(230, 0, 35, 0.1);
}

.btn-like.liked {
    background: rgba(230, 0, 35, 0.1);
}

.btn-like.liked svg {
    color: #e60023 !important;
    stroke: #e60023 !important;
    fill: #e60023 !important;
}

.btn-like.liked .like-count {
    color: #e60023;
    display: block;
}

/* Save button (wishlist) styling */
.btn-save.saved {
    background: rgba(230, 0, 35, 0.1);
}

.btn-save.saved svg {
    color: #e60023 !important;
    stroke: #e60023 !important;
    fill: #e60023 !important;
}

/* Icon hover effects */
.quick-action-btn:hover svg {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.btn-like:hover svg {
    color: #e60023 !important;
    stroke: #e60023 !important;
}

.btn-save:hover svg {
    color: #e60023 !important;
    stroke: #e60023 !important;
}

/* Quick view button styling */
.btn-quick-view:hover {
    background: rgba(0, 123, 255, 0.1);
}

.btn-quick-view:hover svg {
    color: #007bff !important;
}

.quick-action-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.btn-add-cart:hover {
    background: #e60023;
    color: #fff;
}

.btn-save:hover,
.btn-save.saved {
    background: #ff6b6b;
    color: #fff;
}

.homepage-product-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sale-badge {
    background: #ff4757;
    color: #fff;
}

.featured-badge {
    background: #ffa502;
    color: #fff;
}



.out-of-stock-badge {
    background: #747d8c;
    color: #fff;
}

.homepage-product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 60px;
}

.product-categories {
    margin-bottom: 8px;
}

.product-categories a {
    font-size: 0.8rem;
    color: #e60023;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.product-categories a:hover {
    color: #c8001f;
}

.homepage-product-title {
    margin-bottom: 10px;
    line-height: 1.3;
}

.homepage-product-title a {
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.homepage-product-title a:hover {
    color: #e60023;
}

.homepage-product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.star-rating {
    color: #ffc107;
    font-size: 0.9rem;
}

.rating-count {
    font-size: 0.8rem;
    color: #999;
}

.homepage-product-price {
    font-size: 1rem;
    font-weight: 600;
    color: #e60023;
    margin: 0;
    text-align: center;
    width: 100%;
}

.homepage-product-price del {
    color: #999;
    font-weight: 400;
    margin-right: 8px;
}

.homepage-product-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

/* ==========================================================================
   LOAD MORE BUTTON
   ========================================================================== */

.homepage-load-more {
    text-align: center;
    margin-top: 40px;
}

.load-more-btn {
    padding: 15px 40px;
    background: #e60023;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: #c8001f;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(230, 0, 35, 0.4);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   NEWSLETTER SECTION
   ========================================================================== */

.newsletter-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.newsletter-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.newsletter-subtitle {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.newsletter-form {
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-input-group {
    display: flex;
    gap: 0;
    background: #fff;
    border-radius: 30px;
    padding: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.newsletter-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    background: transparent;
    color: #333;
}

.newsletter-input:focus {
    outline: none;
}

.newsletter-btn {
    padding: 15px 30px;
    background: #e60023;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-btn:hover {
    background: #c8001f;
    transform: scale(1.05);
}

/* ==========================================================================
   EMPTY STATES
   ========================================================================== */

.no-products-message,
.woocommerce-inactive-message {
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
}

.no-products-message h3,
.woocommerce-inactive-message h3 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #333;
}

.no-products-message p,
.woocommerce-inactive-message p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Desktop and larger screens - ensure horizontal button layout */
@media (min-width: 769px) {
    .product-quick-actions {
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
    }
}

@media (max-width: 1200px) {
    .homepage-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
        background-attachment: scroll;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn-large {
        padding: 15px 30px;
        font-size: 1.1rem;
    }

    .quick-filters {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 20px;
    }

    .filter-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .homepage-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        padding: 0 10px;
    }

    .homepage-product-card {
        min-width: 0; /* Prevent overflow */
    }

    /* Mobile uses same styles as desktop - no overrides needed */

    .quick-action-btn {
        width: 44px !important;
        height: 44px !important;
        border-radius: 50%;
        background: rgba(255,255,255,0.95) !important;
        color: #333 !important;
        border: none;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.2);
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .section-title {
        font-size: 2rem;
    }

    .newsletter-input-group {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    .newsletter-btn {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .hero-section {
        min-height: 60vh;
        padding: 40px 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-search-field {
        padding: 15px 50px 15px 20px;
        font-size: 1rem;
    }

    .hero-search-submit {
        width: 40px;
        height: 40px;
    }

    .homepage-products-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 0 15px;
    }

    .quick-action-btn {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px;
    }

    .product-quick-actions {
        gap: 6px;
        bottom: 8px;
        right: 8px;
    }
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

.homepage-product-card {
    animation: fadeInUp 0.6s ease-out;
}

.homepage-product-card:nth-child(even) {
    animation-delay: 0.1s;
}

.homepage-product-card:nth-child(3n) {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scroll */
.scroll-to {
    scroll-behavior: smooth;
}

/* Loading states */
.homepage-products-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.homepage-products-grid.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e60023;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
