/* Product Modal Styles - Updated for mobile responsiveness v2025-06-13-05 */
.product-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    width: 80%;
    max-width: 1000px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    z-index: 10;
}

.close-modal:hover {
    color: #000;
}

/* Back button styles */
.back-button {
    position: absolute;
    left: 20px;
    top: 15px;
    font-size: 16px;
    font-weight: 500;
    color: #4caf50;
    cursor: pointer !important;
    z-index: 10;
    background-color: transparent;
    padding: 5px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.back-button:hover {
    background-color: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    cursor: pointer !important;
}

.back-button i {
    font-size: 14px;
    cursor: pointer !important;
}

/* Mobile-specific styles for back button */
@media (max-width: 768px) {
    .back-button {
        top: 12px;
        left: 15px;
        padding: 8px 15px;
        background-color: rgba(76, 175, 80, 0.1);
        border-radius: 30px;
        cursor: pointer !important;
    }
}

.product-detail-container {
    display: flex;
    flex-wrap: wrap;
}

.product-slider-container {
    flex: 1 1 50%;
    min-width: 300px;
    padding: 10px;
}

.product-info {
    flex: 1 1 50%;
    min-width: 300px;
    padding: 15px;
    height: auto;
    min-height: 100px;
}

.product-slider {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.variant-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.variant-btn {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background-color: #f8f8f8;
    cursor: pointer;
    transition: all 0.3s ease;
}

.variant-btn:hover, .variant-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.product-actions {
    margin-top: 15px;
    margin-bottom: 10px;
    text-align: center;
    padding: 0 10px;
}

.add-to-cart-btn {
    background-color: var(--primary-color);
    color: white;
}

.btn.details-btn {
    display: inline-block;
    width: auto;
    min-width: 150px;
    margin: 0 auto;
    padding: 8px 15px;
    font-size: 0.95rem;
    border-radius: 4px;
    background-color: #4caf50;
    color: white;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Make product cards clickable */
.product-card {
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-image {
    height: 250px;
    overflow: hidden;
}

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

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

.product-details {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.product-price {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #4caf50;
    font-weight: bold;
}

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

.product-description {
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
    color: #666;
}

/* Fix collection grid */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 15px 0;
}

/* Ensure consistent card height and styling */
.product-card {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: white;
    height: auto;
    display: block;
    margin-bottom: 10px;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-img {
    height: 200px;
    overflow: hidden;
    width: 100%;
    position: relative;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

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

/* Variants Badge */
.variants-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    z-index: 5;
}

.variants-badge span {
    font-weight: bold;
    color: var(--accent-color);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: auto;
    padding-top: 10px;
}

.view-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background-color: var(--secondary-color);
}

/* Media Queries for Modal */
@media screen and (max-width: 1024px) {
    .modal-content {
        width: 90%;
    }
    
    .product-detail-container {
        flex-direction: column;
    }
}

@media screen and (max-width: 768px) {
    .product-slider-container,
    .product-info {
        min-width: 100%;
    }
    
    .product-slider {
        height: 280px;
    }
    
    .collection-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .product-image {
        height: 160px;
    }
}

@media screen and (max-width: 576px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 12px;
    }
    
    .product-slider {
        height: 220px;
    }
    
    .product-card {
        max-width: 100%;
    }
    
    .product-img {
        height: 140px;
    }
    
    .product-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .variant-list {
        gap: 5px;
    }
    
    .variant-btn {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
    
    .collection-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Force consistent card styling across all pages */
.product-card, 
html body .product-card,
.collection-grid .product-card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.12) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background-color: white !important;
    height: auto !important;
    display: block !important;
}

.product-img, 
html body .product-img,
.collection-grid .product-img {
    height: 200px !important;
    width: 100% !important;
    overflow: hidden !important;
    position: relative !important;
}

@media (max-width: 576px) {
    .product-img, 
    html body .product-img,
    .collection-grid .product-img {
        height: 150px !important;
    }
}

@media (max-width: 400px) {
    .product-img, 
    html body .product-img,
    .collection-grid .product-img {
        height: 130px !important;
    }
}

/* Specific styling for modal product details */
.product-modal .product-info {
    padding: 20px !important;
    min-height: auto !important;
}

.product-modal #modal-product-name {
    font-size: 1.5rem !important;
    margin-bottom: 15px !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
}

.product-modal #modal-product-price {
    font-size: 1.3rem !important;
    margin-bottom: 20px !important;
    color: #4caf50 !important;
    font-weight: bold !important;
}

.product-modal #modal-product-description {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
    color: #444 !important;
}

.product-modal .product-features {
    margin-bottom: 20px !important;
}

.product-modal .product-features h3 {
    font-size: 1.2rem !important;
    margin-bottom: 10px !important;
    font-weight: 600 !important;
}

.product-modal .product-features ul {
    padding-left: 20px !important;
}

.product-modal .product-features li {
    margin-bottom: 8px !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
}

/* Fix for action buttons in modal */
.product-modal .product-actions {
    margin-top: 25px !important;
    display: flex !important;
    justify-content: flex-start !important;
    gap: 15px !important;
}

/* Fix product card content */
.product-content {
    padding: 15px !important;
    display: block !important;
    height: auto !important;
    min-height: 120px !important;
}

/* Chrome-specific fixes for the modal and product cards */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    /* Fix product cards in Chrome */
    .product-card {
        display: block !important;
        overflow: hidden !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
        backface-visibility: hidden !important;
        -webkit-backface-visibility: hidden !important;
    }
    
    /* Fix for modal content in Chrome */
    .modal-content {
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
        backface-visibility: hidden !important;
        -webkit-backface-visibility: hidden !important;
    }
    
    /* Fix for product detail container */
    .product-detail-container {
        display: flex !important;
        flex-wrap: wrap !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    /* Make buttons more consistent */
    .product-actions .btn {
        -webkit-appearance: none !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
    
    /* Fix collection grid */
    .collection-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
        box-sizing: border-box !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
    }
}

/* Fix for category navigation swiper slides */
.category-nav {
    width: 100%;
    margin-bottom: 25px;
    overflow: visible;
}

.category-nav .swiper-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.category-nav .swiper-slide {
    width: auto !important;
    background-color: #f5f5f5;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    color: #555;
    border: 1px solid #eee;
    transition: all 0.3s ease;
    text-align: center;
}

.category-nav .swiper-slide.active {
    background-color: #4caf50;
    color: white;
    border-color: #4caf50;
}
