/* ================================
   Products Page Styles - CLEAN WHITE DESIGN
   ================================ */

/* Products Grid */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 24px !important;
    margin-top: 40px !important;
}

/* === Explicit separation: products (catalog) vs related products === */
/* Catalog product cards: simple layout, no absolute centering, no container translate
   Card surface is transparent; image element provides framed white surface */
.products-grid .product-card {
    background: transparent !important;
    border: none !important;
    border-radius: 8px !important;
    overflow: visible !important; /* allow image shadow to show */
    transition: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

.products-grid .product-image {
    position: relative !important;
    height: 260px !important;
    background: #ffffff !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
}

/* Catalog images are not absolutely positioned; keep them centered and only scale on hover */
.products-grid .product-image img {
    position: static !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    transform: none !important;
    transition: transform 0.25s ease !important;
    transform-origin: center center !important;
}

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

/* Related products: keep absolute-centered artwork with translate(-50%,-50%) */
.related-products-grid .product-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
    transition: all 0.15s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

.related-products-grid .product-image {
    width: 100%;
    padding-bottom: 75%;
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
}

.related-products-grid .product-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.25s ease;
    transform-origin: center center;
}

.related-products-grid .product-card:hover .product-image img {
    transform: translate(-50%, -50%) scale(1.05);
}


/* Product Card */
.product-card {
    background: transparent !important; /* card itself transparent; image carries surface */
    border: none !important;
    border-radius: 8px !important;
    overflow: visible !important; /* allow image shadow */
    transition: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* no generic product-card:hover here; hover handled per-grid above */

.product-image {
    position: relative !important;
    width: 100% !important;
    height: 280px !important;
    overflow: hidden !important;
    background: #ffffff !important; /* image area keeps the white surface */
    border: 1px solid #e0e0e0 !important; /* border around the image */
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 15px !important;
    flex-shrink: 0 !important;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease !important;
}

.product-image img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    transition: transform 0.3s ease !important;
    transform-origin: center center !important;
}

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

/* Highlight image border/shadow when hovering card */
.product-card:hover .product-image {
    border-color: #50b848 !important;
    /* use an even glow (no vertical offset) so shadow surrounds image */
    box-shadow: 0 0 30px rgba(78,176,81,0.12) !important;
    /* no container translate; image itself scales/centers */
}

.product-overlay {
    display: none !important;
}

.product-card:hover .product-overlay {
    display: none !important;
}

.product-content {
    padding: 20px !important;
    background: transparent !important; /* remove white background so only image has surface */
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.product-content h3 {
    color: #1a1a1a !important;
    font-size: 0.9rem !important;
    margin-bottom: 10px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    min-height: auto !important;
}

.product-content p {
    color: #666666 !important;
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
    margin-bottom: 0 !important;
    flex-grow: 1 !important;
}

.product-price-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.price-old {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: line-through;
    font-size: 0.9rem;
}

.price-current {
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.product-features {
    list-style: none;
    padding: 0;
}

.product-features li {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.product-features li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* Filter Section */
.filter-section {
    background: rgba(17, 87, 64, 0.2);
    border: 1px solid rgba(87, 204, 153, 0.3);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 40px;
}

.filter-controls {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: rgba(17, 87, 64, 0.3);
    border: 1px solid rgba(87, 204, 153, 0.3);
    border-radius: 8px;
    color: var(--text-white);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(17, 87, 64, 0.4);
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
}

.category-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: rgba(17, 87, 64, 0.3);
    border: 1px solid rgba(87, 204, 153, 0.3);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    background: rgba(17, 87, 64, 0.5);
    border-color: var(--accent-color);
    color: var(--text-white);
}

.filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--text-white);
}

/* Product Detail Page Styles */
.breadcrumb {
    padding: 100px 0 20px;
    background: var(--bg-dark);
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb-list li {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.breadcrumb-list li::after {
    content: '/';
    margin-left: 8px;
    color: rgba(255, 255, 255, 0.4);
}

.breadcrumb-list li:last-child::after {
    display: none;
}

.breadcrumb-list a {
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition-fast);
}

.breadcrumb-list a:hover {
    color: var(--accent-color);
}

.product-detail {
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-dark-2) 100%);
    padding: 60px 0;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.product-gallery {
    position: sticky;
    top: 100px;
}

.main-image {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(17, 87, 64, 0.2);
    border: 1px solid rgba(87, 204, 153, 0.3);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

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

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.thumbnail {
    aspect-ratio: 1;
    background: rgba(17, 87, 64, 0.2);
    border: 2px solid rgba(87, 204, 153, 0.3);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--accent-color);
}

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

.product-info h1 {
    color: var(--text-white);
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.product-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.product-price {
    background: rgba(17, 87, 64, 0.3);
    border: 1px solid rgba(87, 204, 153, 0.3);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.product-price .price-old {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: line-through;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.product-price .price-current {
    color: var(--accent-color);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.price-note {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.product-description {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    margin-bottom: 30px;
}

.product-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

/* Tabs */
.tabs {
    border-bottom: 2px solid rgba(87, 204, 153, 0.2);
    margin-bottom: 30px;
}

.tab-list {
    display: flex;
    gap: 32px;
    list-style: none;
    flex-wrap: wrap;
}

.tab-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 16px 0;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all var(--transition-fast);
}

.tab-button:hover {
    color: rgba(255, 255, 255, 0.9);
}

.tab-button.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.tab-content {
    display: none;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
}

.tab-content.active {
    display: block;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid rgba(87, 204, 153, 0.2);
}

.specs-table td {
    padding: 16px 0;
}

.specs-table td:first-child {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    width: 40%;
}

.attachments-list {
    list-style: none;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(17, 87, 64, 0.2);
    border: 1px solid rgba(87, 204, 153, 0.3);
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all var(--transition-fast);
}

.attachment-item:hover {
    background: rgba(17, 87, 64, 0.35);
    border-color: var(--accent-color);
}

.related-products {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--bg-dark-2) 0%, var(--bg-dark) 100%);
}

/* Responsive */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 24px;
    }
    
    .product-detail-grid {
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
    
    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .product-gallery {
        position: relative;
        top: 0;
    }
    
    .product-info h1 {
        font-size: 2rem;
    }
    
    .product-price .price-current {
        font-size: 2rem;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    .category-filters {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    .product-image {
        height: 200px !important;
        padding: 10px !important;
    }
    
    .product-content {
        padding: 12px !important;
    }
    
    .product-content h3 {
        font-size: 0.8rem !important;
        margin-bottom: 6px !important;
    }
    
    .product-content p {
        font-size: 0.75rem !important;
    }
    
    .category-filters {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 8px 16px;
    }
}

/* Strong override: ensure cards do not show shadows and images stay centered */
.products-grid .product-card,
.related-products-grid .product-card {
    box-shadow: none !important;
}

.product-image img {
    /* ensure centered images keep their translate when scaled */
    transform-origin: center center !important;
}

.related-products-grid .product-card:hover .product-image img {
    /* related items keep their absolute centering and include translate in transform */
    transform: translate(-50%, -50%) scale(1.05) !important;
}
