/* 
 * MJ IT SOLUTIONS - PURE PRODUCT GALLERY CSS
 * Optimized for card-only display with full product details.
 * Enhanced with modal popup for detailed product view.
 */

:root {
    --amazon-dark-blue: #232f3e;
    --amazon-navy: #131921;
    --amazon-orange: #FF9900;
    --amazon-orange-hover: #e68a00;
    --text-gray: #565959;
    --price-red: #B12704;
    --container-width: 1200px;
}

.shop-products-section {
    padding: 60px 0;
    background: #f8f9fa;
}

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

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--amazon-dark-blue);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-divider {
    width: 80px;
    height: 5px;
    background: var(--amazon-orange);
    margin: 0 auto;
    border-radius: 10px;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding: 20px;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* Product Card */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    border-color: var(--amazon-orange);
}

.card-img-wrapper {
    position: relative;
    padding-top: 100%;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
}

.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 25px;
    transition: transform 0.5s ease;
}

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

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--amazon-dark-blue);
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 4.2em;
}

.product-meta {
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.price-tag {
    font-size: 1.5rem;
    color: var(--price-red);
    font-weight: 700;
    margin-bottom: 10px;
    display: block;
}

.rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.stars {
    color: #FFA41C;
    font-size: 1rem;
}

.review-count {
    color: #007185;
    font-size: 0.85rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #eee;
    font-size: 0.85rem;
}

.detail-label {
    font-weight: 600;
    color: var(--text-gray);
}

.detail-value {
    color: var(--amazon-navy);
    font-weight: 700;
}

.product-description {
    font-size: 0.85rem;
    color: var(--text-gray);
    line-height: 1.5;
    margin-top: 10px;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
}

/* Disable single product links */
.product-card a {
    pointer-events: none;
    cursor: default;
    text-decoration: none;
    color: inherit;
}

/* Hide unwanted elements */
.product-footer,
.product-badge,
.product-filter-section,
.pagination,
.woocommerce-sidebar,
.woocommerce-breadcrumb,
.woocommerce-result-count,
.woocommerce-ordering {
    display: none !important;
}

/* ===== MODAL STYLES ===== */

.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.product-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
}

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

.modal-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.modal-image img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.modal-details {
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--amazon-orange);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 1001;
}

.modal-close:hover {
    background: var(--amazon-orange-hover);
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--amazon-dark-blue);
    margin-bottom: 20px;
    line-height: 1.3;
}

.modal-price {
    font-size: 2rem;
    color: var(--price-red);
    font-weight: 700;
    margin-bottom: 20px;
}

.modal-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.modal-stars {
    color: #FFA41C;
    font-size: 1.2rem;
}

.modal-reviews {
    color: #007185;
    font-size: 0.95rem;
}

.modal-details-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-details-section:last-child {
    border-bottom: none;
}

.modal-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.modal-detail-label {
    font-weight: 600;
    color: var(--text-gray);
}

.modal-detail-value {
    color: var(--amazon-navy);
    font-weight: 700;
}

.modal-description {
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.6;
    margin-top: 15px;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    .section-title {
        font-size: 2rem;
    }
    
    .modal-content {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
        max-height: 95vh;
    }
    
    .modal-title {
        font-size: 1.4rem;
    }
    
    .modal-price {
        font-size: 1.6rem;
    }
    
    .modal-image {
        max-height: 300px;
    }
    
    .modal-image img {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        padding: 15px;
        gap: 15px;
    }
    
    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}
