﻿﻿ /* This stylesheet manages most shop related styling.*/
/*Products, Product Descriptions, Library*/
/*shop stuff*/
.discount-banner {
    background: linear-gradient(135deg, #007bff1a, #ffffff);
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
}

.discount-banner .card-body {
    padding: 1.5rem;
}

.banner-image {
    max-height: 180px;
    object-fit: contain;
}

/* Mobile First Approach */
@media (max-width: 768px) {
    .discount-banner .card-body {
        text-align: center;
        padding: 1.25rem 1rem;
    }

    .banner-image {
        margin-top: 1rem;
        max-height: 120px;
        width: auto;
    }

    /* Stack banner content vertically on mobile */
    .discount-banner .row {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .discount-banner .card-body {
        padding: 1rem 0.75rem;
    }

    .banner-image {
        max-height: 100px;
    }
}

/* Product Cards Mobile Improvements */
.product-card {
    border: none;
    max-width: 1000px;
    margin: 0 auto 1.5rem;
    height: auto; /* Change from fixed height */
    min-height: 250px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .product-card {
        height: auto;
        margin: 0 auto 1rem;
    }

        .product-card .row {
            flex-direction: column;
        }

        .product-card .col-md-4 {
            width: 100% !important;
            padding-right: 0 !important;
        }

    .fixed-img-square {
        width: 100%;
        height: 200px;
        object-fit: cover;
        border-radius: 8px 8px 0 0;
    }

    .product-card .card-body {
        padding: 1rem;
    }
}

/* Product Details Layout */
.product-details {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

    .product-details .card-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
    }

    .product-details .card-text {
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }

    .product-details .price {
        font-size: 1.5rem;
        font-weight: 600;
        color: black;
    }

@media (max-width: 768px) {
    .product-details .card-title {
        font-size: 1.1rem;
    }

    .product-details .price {
        font-size: 1.3rem;
    }

    .product-details .card-text {
        font-size: 0.9rem;
    }
}

/* Product Meta Information */
.product-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    color: black;
    flex-wrap: wrap;
}

    .product-meta div {
        flex: 1;
        min-width: 120px;
        margin-bottom: 0.5rem;
    }

@media (max-width: 576px) {
    .product-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

        .product-meta div {
            flex: none;
            min-width: auto;
        }
}

/* Search Bar Mobile Improvements */
.search-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 20vh;
    min-height: 120px;
    padding: 0 1rem;
}

.group {
    display: flex;
    line-height: 28px;
    align-items: center;
    position: relative;
    max-width: 575px;
    width: 100%;
    gap: 0.75rem;
}

.input {
    width: 100%;
    height: 48px;
    line-height: 28px;
    padding: 0 1rem;
    padding-left: 3rem;
    border: 2px solid transparent;
    border-radius: 12px;
    outline: none;
    background-color: white;
    color: #0d0c22;
    transition: 0.3s ease;
    font-size: 16px; /* Prevents zoom on iOS */
}

    .input::placeholder {
        color: #9e9ea7;
    }

    .input:focus,
    .input:hover {
        outline: none;
        border-color: rgba(234, 226, 183, 0.4);
        background-color: #efefef;
        box-shadow: 0 0 0 4px rgb(234 226 183 / 10%);
    }

.icon {
    position: absolute;
    left: 1rem;
    fill: #9e9ea7;
    width: 1.25rem;
    height: 1.25rem;
    z-index: 2;
}

.filter-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

    .filter-btn:hover {
        background: #e0e0e0;
    }

    .filter-btn i {
        font-size: 20px;
        color: #0d0c22;
    }

@media (max-width: 768px) {
    .search-wrapper {
        height: 15vh;
        min-height: 100px;
    }

    .group {
        flex-direction: column;
        gap: 1rem;
        max-width: 100%;
    }

    .input {
        height: 52px;
        padding-left: 3rem;
    }

    .filter-btn {
        width: 100%;
        height: 52px;
        border-radius: 12px;
        order: -1; /* Move filter button above search on mobile */
    }
}

@media (max-width: 576px) {
    .search-wrapper {
        height: 12vh;
        min-height: 80px;
    }

    .input {
        height: 48px;
        font-size: 16px; /* Prevents zoom */
    }
}

/* Delivery Info & Badges */
.delivery-info {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.digital-badge {
    background-color: #e8f5e8;
    color: #2e7d32;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .delivery-info {
        padding: 0.875rem;
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .digital-badge {
        padding: 0.375rem 0.875rem;
        font-size: 0.8rem;
    }
}

/* Product Details Page Styles */
.product-gallery img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-meta-grid {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
}

.meta-item {
    margin-bottom: 1rem;
}

.meta-label {
    color: #1b2438;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.meta-value {
    color: #333;
    font-size: 1rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Reviews section on details page */
.reviews-section {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Rating display on product cards */
.rating-display {
    margin-bottom: 0.75rem;
}

    .rating-display .rating {
        direction: ltr;
        display: inline-flex;
    }

        .rating-display .rating input {
            display: none;
        }

        .rating-display .rating label {
            color: #ddd;
            font-size: 1.2rem;
            padding: 0 1px;
            cursor: default;
        }

        .rating-display .rating input:checked ~ label,
        .rating-display .rating input:checked ~ label ~ label {
            color: #ff5d00;
        }

.average-rating {
    font-size: 1rem;
    color: #1b2438;
    font-weight: 600;
}

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

/* Back button */
/*.btn-outline-secondary {
    border: 2px solid #6c757d;
    color: #6c757d;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

    .btn-outline-secondary:hover {
        background-color: #6c757d;
        color: white;
    }*/

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-gallery img {
        max-height: 300px;
    }

    .action-buttons {
        flex-direction: column;
    }

        .action-buttons .btn {
            width: 100%;
            margin-bottom: 0.5rem;
        }

    .reviews-section {
        padding: 1.5rem;
    }
}

/* Modal Mobile Improvements */
.main-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    .main-image {
        max-height: 300px;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: 12px;
    }
}

/* Hide rating stars in modal only */
.modal-body .rating {
    display: none !important;
}

/* Better card alignment */
.product-card .row.align-items-cent {
    align-items: flex-start !important;
}

/* My Library Mobile Improvements */
.library-wrapper-card {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    margin-top: 1rem;
    margin-left: 1rem;
    margin-right: 1rem;
}

.empty-library {
    text-align: center;
    color: #666;
    font-size: 16px;
    padding: 2rem 1rem;
}

.library-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.resource-card {
    background: #fafafa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    text-align: center;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 300px;
}

    .resource-card:hover {
        transform: translateY(-2px);
    }

.resource-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.resource-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.resource-title {
    font-size: 14px;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .library-wrapper-card {
        padding: 1rem;
        margin: 0.5rem;
        border-radius: 12px;
    }

    .library-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .resource-card {
        height: 250px;
    }

    .resource-image {
        height: 120px;
    }

    .resource-info {
        padding: 0.75rem;
    }

    .resource-title {
        font-size: 13px;
        margin-bottom: 0.5rem;
    }

    .empty-library {
        font-size: 14px;
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .library-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .resource-card {
        height: 220px;
    }

    .resource-image {
        height: 100px;
    }

    .resource-info {
        padding: 0.5rem;
    }
}

/* Additional Mobile Utilities */
@media (max-width: 768px) {
    /* Improve touch targets */
    .btn, .nav-link, .filter-btn {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Prevent horizontal scrolling */
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Improve text readability */
    body {
        font-size: 14px;
        line-height: 1.5;
    }
}

/* Safe area handling for notched devices */
@supports(padding: max(0px)) {
    .library-wrapper-card,
    .search-wrapper,
    .discount-banner {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Add to shop.css - Modal backdrop fixes */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

/* Ensure modals don't nest */
.modal-backdrop.show + .modal-backdrop.show {
    opacity: 0.5; /* Darker backdrop for nested modals */
}

/* When body has modal-open class, ensure proper styling */
body.modal-open {
    overflow: hidden;
    padding-right: 0 !important;
}

/* Make sure all modals are at the same level */
.modal.fade {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

/* Review modal specific styles */
#reviewModal .modal-dialog,
#allReviewsModal .modal-dialog {
    margin: 1.75rem auto;
}

/* Clear any lingering backdrops */
.modal-backdrop:not(.show) {
    display: none;
}
