/*
Theme Name: PinterestShop
Description: A fully responsive custom WordPress theme with WooCommerce integration featuring Pinterest-style masonry grid layout for enhanced product presentation and user interaction.
Author: Custom Development
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pinterestshop
Tags: e-commerce, woocommerce, masonry, pinterest, responsive, grid, shop

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1;
    padding: 20px 0;
}

/* ==========================================================================
   HEADER STYLES
   ========================================================================== */

.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.site-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #e60023;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-navigation a {
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: #e60023;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-toggle,
.cart-toggle {
    padding: 8px;
    border-radius: 50%;
    background: #f1f1f1;
    transition: all 0.3s ease;
}

.search-toggle:hover,
.cart-toggle:hover {
    background: #e60023;
    color: #fff;
}

/* ==========================================================================
   MASONRY GRID STYLES
   ========================================================================== */

.products-masonry {
    column-count: 4;
    column-gap: 20px;
    margin: 40px 0;
}

.product-card {
    break-inside: avoid;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
}

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

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

.product-image img {
    width: 100%;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.quick-actions {
    display: flex;
    gap: 10px;
}

.btn-quick-view,
.btn-add-cart,
.btn-save {
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-quick-view {
    background: #fff;
    color: #333;
}

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

.btn-save {
    background: rgba(255,255,255,0.9);
    color: #333;
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e60023;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 1024px) {
    .products-masonry {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .products-masonry {
        column-count: 2;
        column-gap: 15px;
    }

    .container {
        padding: 0 15px;
    }

    .header-content {
        padding: 10px 0;
    }

    .main-navigation ul {
        gap: 20px;
    }

    /* Homepage Product Cards Mobile Spacing */
    .homepage-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
        gap: 15px !important;
    }

    .homepage-product-card {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: auto !important;
        position: relative !important;
    }

    .homepage-product-image {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        height: 220px !important; /* Increased image size */
        overflow: hidden !important;
        border-radius: 12px !important;
    }

    .homepage-product-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* Push overlay buttons higher up */
    .homepage-product-overlay {
        position: absolute !important;
        top: 8px !important; /* Moved up from default position */
        left: 8px !important;
        right: 8px !important;
        bottom: 45px !important; /* Leave space for price */
        background: rgba(0, 0, 0, 0.6) !important;
        border-radius: 8px !important;
        opacity: 1 !important; /* Always visible on mobile */
    }

    .product-quick-actions {
        position: absolute !important;
        top: 12px !important; /* Positioned near top */
        right: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .homepage-product-info {
        padding: 4px 8px !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        margin-top: -2px !important; /* Pull closer to image */
    }

    .homepage-product-price {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 0.95rem !important;
        line-height: 1.2 !important;
        font-weight: 600 !important;
    }
}

@media (max-width: 480px) {
    .products-masonry {
        column-count: 1;
    }
    
    .main-navigation {
        display: none;
    }
}

/* ==========================================================================
   SEARCH FORM STYLES
   ========================================================================== */

.search-form-wrapper {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 20px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 999;
}

.search-form-wrapper.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-form {
    display: flex;
    align-items: center;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-field {
    flex: 1;
    padding: 15px 50px 15px 20px;
    border: 2px solid #eee;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.search-field:focus {
    outline: none;
    border-color: #e60023;
}

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

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

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    display: none;
}

.search-results-list {
    padding: 10px 0;
}

.search-result-item {
    padding: 10px 20px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.3s ease;
}

.search-result-item:hover {
    background: #f8f8f8;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
}

.search-result-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #333;
}

.search-result-price {
    font-size: 0.8rem;
    color: #e60023;
    font-weight: 600;
}

/* ==========================================================================
   MOBILE MENU STYLES
   ========================================================================== */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    width: 30px;
    height: 30px;
    justify-content: space-between;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 0;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.main-navigation.mobile-active {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 998;
}

.main-navigation.mobile-active ul {
    flex-direction: column;
    padding: 20px;
    gap: 0;
}

.main-navigation.mobile-active li {
    border-bottom: 1px solid #f5f5f5;
    padding: 15px 0;
}

.main-navigation.mobile-active li:last-child {
    border-bottom: none;
}

/* ==========================================================================
   CART STYLES
   ========================================================================== */

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e60023;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* ==========================================================================
   ADDITIONAL RESPONSIVE STYLES
   ========================================================================== */

@media (max-width: 1024px) {
    .header-content {
        padding: 12px 0;
    }

    .site-logo {
        font-size: 1.6rem;
    }

    .main-navigation ul {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .main-navigation {
        display: none;
    }

    .header-actions {
        gap: 10px;
    }

    .search-toggle,
    .cart-toggle {
        padding: 6px;
    }

    .search-form {
        margin: 0 20px;
    }
}

@media (max-width: 480px) {
    .site-logo {
        font-size: 1.4rem;
    }

    .header-content {
        padding: 8px 0;
    }

    .search-field {
        padding: 12px 40px 12px 15px;
        font-size: 0.9rem;
    }

    .search-submit {
        width: 35px;
        height: 35px;
    }
}

/* ==========================================================================
   SIMPLE CLICK OVERLAY STYLES
   ========================================================================== */

.product-click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

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

.product-view-link {
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.product-view-link:hover {
    color: white;
    text-decoration: none;
    transform: scale(1.05);
}

.view-product-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.view-product-content svg {
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.view-product-content span {
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.product-view-link:hover .view-product-content svg {
    opacity: 1;
}

/* Wishlist View Product Link */
.wishlist-item-view {
    background: #e60023;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.wishlist-item-view:hover {
    background: #c8001f;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Mobile Responsive for Click Overlay */
@media (max-width: 768px) {
    .product-click-overlay {
        opacity: 0;
        background: rgba(0, 0, 0, 0.5);
    }

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

    .view-product-content {
        gap: 8px;
    }

    .view-product-content svg {
        width: 28px;
        height: 28px;
    }

    .view-product-content span {
        font-size: 14px;
    }

    /* Mobile optimized spacing and layout */
    .homepage-product-card {
        gap: 4px !important;
    }

    .homepage-product-info {
        padding: 4px 8px !important;
        margin-top: -2px !important; /* Pull closer to image */
    }

    .homepage-product-price {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
    }

    /* Larger product images on mobile */
    .homepage-product-card .homepage-product-image {
        height: 220px !important;
        margin-bottom: 0 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }

    .homepage-product-card .homepage-product-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* Mobile uses same overlay behavior as desktop */

    /* Ensure consistent spacing across all product cards */
    .elementor-product-card {
        gap: 4px !important;
    }

    .elementor-product-card .product-info {
        padding: 4px 8px !important;
        margin: 0 !important;
    }

    .elementor-product-card .product-price {
        margin: 0 !important;
        padding: 0 !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
    }
}
