/* Shop Page Specific Styles */
.shop-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../images/shop-hero.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 100px 0;
    text-align: center;
    margin-top: 80px;
}

.shop-hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: white;
}

.shop-hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

.shop-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    margin: 40px 0;
}

/* Sidebar Styles */
.shop-sidebar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    align-self: flex-start;
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.sidebar-widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.category-list,
.brand-list,
.availability-list {
    list-style: none;
}

.category-list li,
.brand-list li,
.availability-list li {
    margin-bottom: 8px;
}

.category-list a,
.brand-list a,
.availability-list a {
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    padding: 5px 0;
}

.category-list a:hover,
.brand-list a:hover,
.availability-list a:hover {
    color: var(--primary-color);
}

.category-list li.active a {
    color: var(--primary-color);
    font-weight: 600;
}

.category-list a::before,
.brand-list a::before,
.availability-list a::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    background-color: #ddd;
    border-radius: 50%;
    margin-right: 10px;
    transition: var(--transition);
}

.category-list a:hover::before,
.brand-list a:hover::before,
.availability-list a:hover::before {
    background-color: var(--primary-color);
}

.category-list li.active a::before {
    background-color: var(--primary-color);
}

.price-range {
    margin-top: 20px;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    margin-bottom: 15px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.price-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
}

.brand-list input[type="checkbox"],
.availability-list input[type="checkbox"] {
    margin-right: 10px;
}

.apply-filters,
.reset-filters {
    width: 100%;
    margin-top: 15px;
}

.reset-filters {
    margin-top: 10px;
}

/* Shop Main Content */
.shop-main {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.results-count {
    font-size: 0.9rem;
    color: #666;
}

.sort-options {
    display: flex;
    align-items: center;
}

.sort-options label {
    margin-right: 10px;
    font-size: 0.9rem;
}

.sort-options select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 1;
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transition: var(--transition);
    opacity: 1 !important;
    /* Force visibility */
}

.product-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-container img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transition: var(--transition);
    opacity: 1 !important;
    /* Force visibility */
}

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


.quick-view {
    position: absolute;
    bottom: -40px;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 8px 0;
    transition: var(--transition);
    cursor: pointer;
    font-size: 0.9rem;
}

.product-card:hover .quick-view {
    bottom: 0;
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
    font-weight: 600;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-meta {
    margin-bottom: 15px;
}

.product-rating {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #666;
}

.product-rating i {
    color: #FFC107;
    margin-right: 3px;
    font-size: 0.9rem;
}

.product-rating span {
    margin-left: 5px;
}

.product-price {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.current-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-right: 10px;
}

.original-price {
    font-size: 0.9rem;
    text-decoration: line-through;
    color: #999;
    margin-right: 10px;
}

.discount {
    font-size: 0.8rem;
    background-color: #FFE6E6;
    color: #FF0000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

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

.product-actions .btn {
    flex: 1;
    padding: 8px;
    font-size: 0.8rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-numbers a,
.page-nav {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.page-numbers a:hover,
.page-nav:hover {
    background-color: #f5f5f5;
}

.page-numbers a.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-nav.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Quick View Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: #aaa;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--secondary-color);
}

.modal-product-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .shop-grid {
        grid-template-columns: 1fr;
    }

    .shop-sidebar {
        position: static;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .shop-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .sort-options {
        width: 100%;
    }

    .sort-options select {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .modal-product-view {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr 1fr;
    }

    .product-image {
        height: 150px;
    }

    .product-actions {
        flex-direction: column;
        gap: 5px;
    }

    .product-actions .btn {
        width: 100%;
    }
}

/* Shopping Cart Styles */
.nav-cart {
    position: relative;
    margin-left: 20px;
}

.nav-cart a {
    color: var(--accent-color);
    font-size: 1.2rem;
    position: relative;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Cart Modal */
.cart-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.cart-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 15px;
}

.cart-header h3 {
    margin: 0;
    color: var(--secondary-color);
}

.close-cart {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-cart:hover {
    color: var(--secondary-color);
}

.cart-body {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.empty-cart {
    text-align: center;
    padding: 40px 0;
    color: #777;
}

.empty-cart i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #ddd;
}

.cart-item {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cart-item-img {
    width: 80px;
    height: 80px;
    margin-right: 15px;
    border-radius: 4px;
    overflow: hidden;
}

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

.cart-item-details {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
}

.quantity-selector {
    display: flex;
    align-items: center;
    margin-right: 15px;
}

.quantity-btn {
    background: #f5f5f5;
    border: none;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
}

.quantity-input {
    width: 40px;
    text-align: center;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px;
}

.remove-item {
    color: #ff6b6b;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.remove-item i {
    margin-right: 5px;
}

.cart-footer {
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

.cart-actions {
    display: flex;
    justify-content: space-between;
}

.cart-actions .btn {
    flex: 1;
    margin: 0 5px;
}

/* Responsive */
@media (max-width: 576px) {
    .cart-content {
        margin: 10% auto;
        width: 95%;
    }

    .cart-actions {
        flex-direction: column;
    }

    .cart-actions .btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    /* Ensure it's above other elements */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    background-color: #28a745;
    /* Default success */
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.error {
    background-color: #dc3545;
    /* Error color */
}

.notification i {
    font-size: 1.2em;
}

.product-badge.out-of-stock-badge {
    background-color: #dc3545;
    /* Red for out of stock */
    color: white;
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 3px;
    z-index: 2;
}

/* Ensure product actions for disabled buttons look distinct */
.product-actions button:disabled,
.product-actions-modal button:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #ced4da;
}

.product-actions button:disabled:hover,
.product-actions-modal button:disabled:hover {
    background-color: #e9ecef;
    border-color: #ced4da;
}

/* Shop Controls (Search & Filter) */
.shop-controls {
    padding: 20px 0;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.controls-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    align-items: center;
}

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

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.filters {
    display: flex;
    gap: 15px;
}

.filters select {
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 25px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filters select:focus {
    outline: none;
    border-color: var(--primary-color);
}

@media (max-width: 768px) {
    .controls-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .filters {
        flex-direction: column;
    }
}

/* Wishlist Button on Product Card */
.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.wishlist-btn:hover {
    transform: scale(1.1);
    background: white;
}

.wishlist-btn i {
    font-size: 1.1rem;
    color: #888;
    transition: color 0.2s ease;
}

.wishlist-btn:hover i {
    color: #ff4444;
}

/* Review Section Styles */
.popup-reviews {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.popup-reviews h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.review-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
}

.review-item {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

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

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.review-stars {
    color: #FFD700;
}

.add-review h4 {
    margin-bottom: 10px;
    font-size: 1rem;
}

.star-rating {
    font-size: 1.5rem;
    color: #ccc;
    cursor: pointer;
    margin-bottom: 10px;
}

.star-rating span:hover,
.star-rating span:hover~span {
    color: #FFD700;
}

.add-review textarea {
    width: 100%;
    height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    resize: none;
}

/* Product Popup Styles (Refactored) */
.product-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

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

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.popup-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 12px;
    overflow-y: auto;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.popup-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2002;
    color: #333;
    transition: color 0.3s;
}

.popup-close:hover {
    color: var(--primary-color);
}

/* Image Section */
.popup-image-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popup-main-image-container {
    width: 100%;
    height: 400px;
    /* Fixed height for main image */
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
}

.popup-main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.popup-thumbnails-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
}

.popup-thumbnails-container::-webkit-scrollbar {
    height: 6px;
}

.popup-thumbnails-container::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.popup-thumbnail {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid #eee;
    opacity: 0.7;
    transition: all 0.2s;
    flex-shrink: 0;
}

.popup-thumbnail:hover {
    opacity: 1;
    border-color: var(--primary-color);
}

.popup-thumbnail.active {
    border-color: var(--primary-color);
    opacity: 1;
    transform: scale(1.05);
}

/* Popup Details */
.popup-details {
    display: flex;
    flex-direction: column;
}

.popup-title {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.popup-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.popup-desc {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .popup-body {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .popup-main-image-container {
        height: 300px;
    }

    .popup-title {
        font-size: 1.5rem;
    }
}