/* Shop Page Styles */

/* Breadcrumb Section */
.breadcrumb-section {
    background: #f8faf9;
    padding: 1rem 0;
    margin-top: 80px;
    border-bottom: 1px solid #eee;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumb a {
    color: #4B6043;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #7EA371;
}

.breadcrumb span:last-child {
    font-weight: 600;
    color: #333;
}

/* Shop Header */
.shop-header {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid #eee;
}

.shop-title {
    text-align: center;
    margin-bottom: 2rem;
}

.shop-title h1 {
    font-size: 2.5rem;
    color: #4B6043;
    margin-bottom: 0.5rem;
}

.shop-title p {
    color: #666;
    font-size: 1.1rem;
}

.shop-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.view-btn:hover,
.view-btn.active {
    border-color: #4B6043;
    background: #4B6043;
    color: white;
}

.sort-dropdown {
    position: relative;
}

.sort-dropdown select {
    padding: 0.8rem 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
    min-width: 180px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}

.sort-dropdown select:focus {
    outline: none;
    border-color: #4B6043;
}

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

/* Shop Layout */
.shop-content {
    padding: 2rem 0;
}

.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* Sidebar */
.shop-sidebar {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-section {
    margin-bottom: 2rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 1.5rem;
}

.filter-section:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
}

.filter-section h3 {
    color: #4B6043;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
    transition: color 0.3s ease;
    position: relative;
}

.filter-item:hover {
    color: #4B6043;
}

.filter-item input[type="checkbox"],
.filter-item input[type="radio"] {
    display: none;
}

.checkmark,
.radiomark {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    background: white;
    transition: all 0.3s ease;
    position: relative;
}

.checkmark {
    border-radius: 3px;
}

.radiomark {
    border-radius: 50%;
}

.filter-item input:checked + .checkmark,
.filter-item input:checked + .radiomark {
    border-color: #4B6043;
    background: #4B6043;
}

.filter-item input:checked + .checkmark:after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-item input:checked + .radiomark:after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

/* Price Range */
.price-range {
    margin-bottom: 1rem;
}

.price-range input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    appearance: none;
}

.price-range input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4B6043;
    cursor: pointer;
}

.price-range input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4B6043;
    cursor: pointer;
    border: none;
}

.price-display {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.price-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

/* Rating Filter */
.rating-filter .filter-item {
    align-items: center;
    gap: 0.5rem;
}

.stars {
    display: flex;
    gap: 2px;
    color: #ffa500;
    font-size: 0.8rem;
}

.rating-filter .filter-item span:last-child {
    font-size: 0.8rem;
    color: #999;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: 0.8rem;
}

.clear-filters,
.apply-filters {
    flex: 1;
    padding: 0.8rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.clear-filters {
    background: #f5f5f5;
    color: #666;
}

.clear-filters:hover {
    background: #e5e5e5;
}

.apply-filters {
    background: #4B6043;
    color: white;
}

.apply-filters:hover {
    background: #3d4e37;
}

/* Products Container */
.shop-main {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Product Cards */
.product-card {
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
    position: relative;
    min-height: 420px;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #4B6043;
}

.product-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

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

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

.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: white;
}

.badge.new {
    background: #7EA371;
}

.badge.premium {
    background: #8e44ad;
}

.badge.bestseller {
    background: #e74c3c;
}

.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-actions {
    opacity: 1;
}

.action-btn {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: #4B6043;
    color: white;
    transform: scale(1.1);
}

.action-btn.active {
    background: #e74c3c;
    color: white;
}

.product-info {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.product-rating .stars {
    display: flex;
    gap: 1px;
    color: #ffa500;
    font-size: 0.8rem;
}

.rating-count {
    font-size: 0.75rem;
    color: #999;
}

.product-title {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    min-height: 3.5em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-code {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 0.8rem;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #4B6043;
}

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

.add-to-cart-btn {
    width: 100%;
    padding: 0.8rem;
    background: #4B6043;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.add-to-cart-btn:hover {
    background: #3d4e37;
    transform: translateY(-1px);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

/* Cart Icon in Header */
.cart-icon-wrapper {
    position: relative;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    min-width: 18px;
}

/* Shopping Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-overlay.show {
    opacity: 1;
    visibility: visible;
}

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

.cart-header h3 {
    color: #333;
    margin: 0;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.close-cart:hover {
    color: #333;
}

.cart-items {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.empty-cart {
    text-align: center;
    color: #999;
    padding: 2rem 0;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

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

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

.cart-item-title {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.3rem;
}

.cart-item-price {
    font-weight: 600;
    color: #4B6043;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    border-color: #4B6043;
    background: #4B6043;
    color: white;
}

.quantity-input {
    width: 40px;
    padding: 0.2rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 0.8rem;
}

.remove-item {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    transition: color 0.3s ease;
}

.remove-item:hover {
    color: #c0392b;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

.cart-total {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: #4B6043;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.checkout-btn:hover {
    background: #3d4e37;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-btn:hover {
    border-color: #4B6043;
    background: #4B6043;
    color: white;
}

.page-btn.active {
    border-color: #4B6043;
    background: #4B6043;
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-btn:disabled:hover {
    border-color: #ddd;
    background: white;
    color: #999;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .shop-layout {
        grid-template-columns: 250px 1fr;
        gap: 1.5rem;
    }

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

    .cart-sidebar {
        width: 350px;
        right: -350px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 25px;
    }

    .shop-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .shop-sidebar {
        order: 2;
        position: static;
        margin-top: 1rem;
    }

    .shop-main {
        order: 1;
    }

    .shop-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

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

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

    .results-count {
        text-align: center;
    }

    .shop-title h1 {
        font-size: 2rem;
    }

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

    .cart-sidebar {
        width: 320px;
        right: -320px;
    }

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

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    .shop-content {
        padding: 1rem 0;
    }

    .shop-header {
        padding: 1rem 0;
    }

    .shop-title h1 {
        font-size: 1.8rem;
    }

    .shop-sidebar {
        padding: 1rem;
    }

    .shop-main {
        padding: 1rem;
    }

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

    .cart-sidebar {
        width: 280px;
        right: -280px;
    }

    .breadcrumb-section {
        padding: 0.8rem 0;
    }

    .pagination .page-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4B6043;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Animation for product cards */
.product-card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

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

/* List View */
.products-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.products-grid.list-view .product-card {
    display: flex;
    align-items: center;
}

.products-grid.list-view .product-image {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    aspect-ratio: 1;
}

.products-grid.list-view .product-info {
    flex: 1;
    padding: 1rem 1.5rem;
}

.products-grid.list-view .add-to-cart-btn {
    width: auto;
    padding: 0.6rem 1.5rem;
}