/* 
JLJ Jewellers - Products Page Stylesheet
*/

/* ===== Page Title ===== */
.page-title {
    background-color: var(--light);
    padding: var(--spacing-lg) 0;
    text-align: center;
    border-bottom: 1px solid var(--light-gray);
}

.page-title h1 {
    margin-bottom: var(--spacing-xs);
}

.breadcrumb {
    font-size: 0.9rem;
    color: var(--gray);
}

.breadcrumb a {
    color: var(--gray);
    transition: var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb .separator {
    margin: 0 8px;
    color: var(--light-gray);
}

.breadcrumb .current-page {
    color: var(--primary);
    font-weight: 500;
}

/* ===== Products Section ===== */
.products-section {
    padding: var(--spacing-lg) 0;
}

.products-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-lg);
}

/* ===== Sidebar ===== */
.products-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-widget {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--light);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-sm);
}

.sidebar-widget h3 {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--light-gray);
}

.category-list {
    margin-bottom: 0;
}

.category-list li {
    margin-bottom: 10px;
}

.category-list li a {
    display: block;
    padding: 8px 0;
    color: var(--gray);
    transition: var(--transition-fast);
    position: relative;
    padding-left: 15px;
}

.category-list li a::before {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    opacity: 0;
    transition: var(--transition-fast);
}

.category-list li a:hover,
.category-list li a.active {
    color: var(--accent);
    padding-left: 20px;
}

.category-list li a:hover::before,
.category-list li a.active::before {
    opacity: 1;
}

/* Price Filter */
.price-filter {
    margin-top: var(--spacing-sm);
}

.price-inputs {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.price-input {
    display: flex;
    flex-direction: column;
}

.price-input label {
    font-size: 0.875rem;
    color: var(--gray);
    margin-bottom: 5px;
}

.price-input input {
    width: 100px;
    padding: 8px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius-sm);
    outline: none;
}

.price-input input:focus {
    border-color: var(--accent);
}

.price-slider {
    position: relative;
    height: 5px;
    border-radius: 5px;
    background: var(--light-gray);
    margin: 20px 0;
}

.slider-track {
    position: absolute;
    height: 100%;
    background: var(--accent);
    border-radius: 5px;
    z-index: 1;
}

.price-slider input[type="range"] {
    -webkit-appearance: none;
    position: absolute;
    width: 100%;
    height: 5px;
    background: none;
    pointer-events: none;
    outline: none;
    z-index: 2;
}

.price-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    pointer-events: auto;
    border: 2px solid var(--light);
}

.price-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    pointer-events: auto;
    border: 2px solid var(--light);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    accent-color: var(--accent);
}

/* Filter Buttons */
.apply-filter-btn,
.reset-filter-btn {
    width: 100%;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    text-align: center;
}

/* ===== Products Main ===== */
.products-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--light-gray);
}

.products-count {
    font-size: 0.9rem;
    color: var(--gray);
}

.products-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.products-sort label {
    font-size: 0.9rem;
    color: var(--gray);
}

.products-sort select {
    padding: 8px 12px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius-sm);
    outline: none;
    background-color: var(--light);
}

.products-sort select:focus {
    border-color: var(--accent);
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-btn {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--light);
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius-sm);
    color: var(--gray);
    transition: var(--transition-fast);
}

.view-btn:hover,
.view-btn.active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--primary);
}

/* ===== Products Grid ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}

.products-grid.list-view .product-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-md);
}

.products-grid.list-view .product-img {
    height: 300px;
}

.products-grid.list-view .product-info {
    padding: var(--spacing-md);
}

.products-grid.list-view .product-description {
    display: block;
    margin-top: var(--spacing-sm);
}

.products-grid.list-view .product-actions {
    top: var(--spacing-xs);
    right: auto;
    left: var(--spacing-xs);
}

.products-grid.list-view .product-card .add-to-cart {
    width: auto;
    margin-top: var(--spacing-md);
}

/* ===== Product Card ===== */
.product-card {
    position: relative;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(0);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.3);
}

.product-img {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(248, 246, 240, 0.8), rgba(255, 255, 255, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(13, 27, 42, 0.05));
    z-index: 1;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.7s cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 0;
    transform: scale(0.95);
}

.product-img img.loaded {
    opacity: 1;
    transform: scale(1);
}

.product-card:hover .product-img img {
    transform: scale(1.08);
}

.product-tag {
    position: absolute;
    top: var(--spacing-xs);
    left: var(--spacing-xs);
    background: linear-gradient(135deg, #D4AF37, #B8860B);
    color: var(--light);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-actions {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
    transform: translateX(60px);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.product-card:hover .product-actions {
    transform: translateX(0);
}

.product-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
}

.product-action-btn:nth-child(2) {
    transition-delay: 0.05s;
}

.product-action-btn:nth-child(3) {
    transition-delay: 0.1s;
}

.product-action-btn:hover {
    background: var(--accent);
    color: var(--primary);
    transform: scale(1.1);
}

.product-info {
    padding: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.product-category {
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
}

.product-title {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    line-height: 1.4;
}

.product-price {
    font-size: 1.3rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 8px;
    font-family: 'Playfair Display', serif;
}

.original-price {
    font-size: 1rem;
    color: var(--gray);
    text-decoration: line-through;
    margin-right: 8px;
}

.product-rating {
    color: var(--accent);
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
}

.product-description {
    display: none;
    font-size: 0.9rem;
    color: var(--gray);
    line-height: 1.6;
}

.add-to-cart {
    width: 100%;
    padding: 10px 15px;
    border-radius: 30px;
    background: linear-gradient(135deg, #D4AF37, #B8860B);
    color: var(--light);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.add-to-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
}

.add-to-cart:hover::before {
    left: 100%;
}

/* Image Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.product-img.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(248, 246, 240, 0.3) 0%, 
        rgba(248, 246, 240, 0.5) 50%, 
        rgba(248, 246, 240, 0.3) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

/* Product Quick View */
.quick-view-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(13, 27, 42, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.quick-view-modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--light);
    width: 90%;
    max-width: 1000px;
    border-radius: var(--border-radius-md);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background-color: var(--light);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.close-modal:hover {
    background-color: var(--accent);
    color: var(--primary);
}

.modal-body {
    padding: var(--spacing-md);
}

.product-quick-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.product-images {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.main-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: var(--border-radius-sm);
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-images {
    display: flex;
    gap: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition-fast);
    border: 1px solid var(--light-gray);
}

.thumbnail.active,
.thumbnail:hover {
    opacity: 1;
    border-color: var(--accent);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details h2 {
    margin-bottom: var(--spacing-sm);
}

.product-meta {
    margin: var(--spacing-md) 0;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--light-gray);
}

.meta-item {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.meta-label {
    font-weight: 600;
    color: var(--primary);
    margin-right: 5px;
}

.meta-value {
    color: var(--gray);
}

.product-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.qty-btn {
    width: 40px;
    height: 40px;
    background-color: var(--light);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    border: none;
}

.qty-btn:hover {
    background-color: var(--light-gray);
}

.quantity-selector input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-weight: 500;
    -moz-appearance: textfield;
}

.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 3D Rotation Feature */
.rotate-container {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: grab;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.rotate-container:active {
    cursor: grabbing;
}

.rotate-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

.rotate-toggle {
    background: linear-gradient(145deg, var(--primary), #162d45);
    color: var(--light);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: var(--spacing-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.rotate-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
    transition: all 0.5s ease;
    z-index: -1;
}

.rotate-toggle:hover::before {
    left: 100%;
}

.rotate-toggle:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.rotate-toggle.active {
    background: linear-gradient(145deg, var(--accent-dark), var(--accent));
    color: var(--primary);
}

/* 3D Rotation Instructions */
.rotation-instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rotate-container:hover .rotation-instructions {
    opacity: 1;
}

/* Button Animation */
@keyframes addingAnimation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.product-action-btn.adding,
.add-to-cart.adding {
    animation: addingAnimation 0.5s ease;
    background: var(--accent);
    color: var(--primary);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .products-container {
        grid-template-columns: 240px 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-grid.list-view .product-card {
        grid-template-columns: 240px 1fr;
    }
}

@media (max-width: 768px) {
    .products-container {
        grid-template-columns: 1fr;
    }
    
    .products-sidebar {
        position: static;
        margin-bottom: var(--spacing-md);
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-top-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .products-sort {
        order: 2;
    }
    
    .view-toggle {
        order: 3;
    }
    
    .products-count {
        order: 1;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .product-quick-view {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .products-top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .products-grid.list-view .product-card {
        grid-template-columns: 1fr;
    }
    
    .products-grid.list-view .product-img {
        height: 250px;
    }
    
    .main-image {
        height: 250px;
    }
    
    .product-title {
        font-size: 1.1rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    .product-img {
        height: 250px;
    }
}

/* Improved Loading Animation */
.product-img.loading {
    position: relative;
    background: linear-gradient(135deg, rgba(248, 246, 240, 0.8), rgba(255, 255, 255, 0.9));
}

.product-img.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Glass Morphism Effect */
.product-card {
    position: relative;
    overflow: visible;
}

.product-card::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), transparent);
    z-index: -1;
    border-radius: calc(var(--border-radius-md) + 5px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.product-card:hover::before {
    opacity: 1;
} 