/* Shop and product specific styles */

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 2rem;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.product-image {
    width: 100%;
    height: 250px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.product-category {
    color: #7f8c8d;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 15px;
}

.product-condition {
    display: inline-block;
    background: #ecf0f1;
    color: #2c3e50;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-bottom: 15px;
}

/* Filters and search */
.shop-filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group h4 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1rem;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-option {
    padding: 6px 12px;
    background: #ecf0f1;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.filter-option:hover, .filter-option.active {
    background: #e74c3c;
    color: white;
}

.search-bar {
    position: relative;
    margin-bottom: 20px;
}

.search-bar input {
    padding-right: 40px;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.sort-options select {
    width: auto;
    min-width: 150px;
}

/* Cart functionality */
.cart-icon {
    position: relative;
    display: inline-block;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.cart-icon:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-radius: 50%;
    min-width: 22px;
    height: 22px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    }
    50% {
        box-shadow: 0 2px 8px rgba(231, 76, 60, 0.6), 0 0 0 5px rgba(231, 76, 60, 0.1);
    }
    100% {
        box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
    }
}

.add-to-cart-btn {
    width: 100%;
    padding: 10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.add-to-cart-btn:hover {
    background: #c0392b;
}

.add-to-cart-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Product detail page */
.product-detail {
    margin-top: 2rem;
}

.product-images {
    position: relative;
}

.main-image {
    width: 100%;
    height: 500px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.image-thumbnails {
    display: flex;
    gap: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    background: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    overflow: hidden;
}

.thumbnail.active {
    border-color: #e74c3c;
}

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

.product-details {
    padding-left: 30px;
}

.product-details h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.product-details .price {
    font-size: 2rem;
    color: #e74c3c;
    font-weight: 700;
    margin-bottom: 20px;
}

.size-selector {
    margin-bottom: 20px;
}

.size-options {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.size-option {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e6ed;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.size-option:hover, .size-option.active {
    border-color: #e74c3c;
    background: #e74c3c;
    color: white;
}

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

.quantity-input {
    width: 80px;
    text-align: center;
}

.quantity-btn {
    width: 35px;
    height: 35px;
    border: 1px solid #e0e6ed;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.quantity-btn:hover {
    background: #f8f9fa;
}

/* Cart page */
.cart-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-item-image {
    width: 100px;
    height: 100px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.cart-item-details {
    flex: 1;
    padding-left: 20px;
}

.cart-item-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.cart-item-price {
    color: #e74c3c;
    font-weight: 500;
    font-size: 1.1rem;
}

.cart-summary {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 100px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.summary-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    border-top: 1px solid #e0e6ed;
    padding-top: 10px;
    margin-top: 15px;
}

/* Modal Styles for Shop */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #e74c3c;
    transform: rotate(90deg);
}

/* Ensure body doesn't scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .product-details {
        padding-left: 0;
        margin-top: 30px;
    }

    .shop-filters {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .filter-options {
        justify-content: center;
    }

    .cart-item {
        flex-direction: column;
        text-align: center;
    }

    .cart-item-details {
        padding-left: 0;
        margin-top: 15px;
    }

    .modal-content {
        padding: 20px;
        margin: 10px;
        max-width: 95vw;
        max-height: 95vh;
    }

    .modal-header h3 {
        font-size: 1.25rem;
    }
}