/* Products Page Styles */

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-brown) 0%, var(--brown-dark) 100%);
    padding: 11px 0 16px;
    margin-top: 74px;
    color: var(--text-light);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--golden);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Products Section */
.products-section {
    padding: 1px 0;
    background: linear-gradient(135deg, var(--brown-very-light) 0%, #f8f9fa 100%);
    min-height: 60vh;
    position: relative;
    overflow: visible;
    /* Allow 3D elements to show outside bounds */
}

.products-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--golden), transparent);
}

.products-grid {
    margin-top: 1rem;
    padding: 2rem 0;
    /* Add padding to accommodate popup effect */
}

.products-grid .col-xl-3,
.products-grid .col-lg-4,
.products-grid .col-md-6,
.products-grid .col-6 {
    display: flex;
    margin-bottom: 1rem;
    /* Increased margin for popup space */
}

.products-grid .product-card {
    width: 100%;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: visible;
    /* Changed from hidden to visible for 3D popup effect */
    height: 100%;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(184, 65, 31, 0.08);
    position: relative;
    backdrop-filter: blur(10px);
    perspective: 1000px;
    /* Added for 3D effect */
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--golden), var(--primary-brown));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:hover {
    box-shadow: 0 20px 40px rgba(184, 65, 31, 0.15);
    border-color: var(--golden);
    transform: translateY(-8px);
}

/* Product Image */
.product-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    border-radius: 20px 20px 0 0;
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    /* Add flex to center content */
    align-items: center;
    /* Center content vertically */
    justify-content: center;
    /* Center content horizontally */
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: brightness(1) contrast(1.05);
    border-radius: 20px 20px 0 0;
    transform-origin: center center;
    display: block;
    opacity: 1;
}

/* 3D Popup Effect on Hover */
.product-card:hover .product-image {
    transform: translateZ(30px) translateY(-15px) rotateX(5deg);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.2),
        0 15px 30px rgba(184, 65, 31, 0.1),
        0 5px 15px rgba(244, 196, 48, 0.1);
    z-index: 10;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.15) saturate(1.1);
}

/* Add a subtle glow behind the popped image */
.product-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--golden), var(--primary-brown));
    opacity: 0;
    transition: all 0.5s ease;
    z-index: -1;
    transform: translateZ(-10px);
    filter: blur(20px);
    border-radius: 20px 20px 0 0;
}

.product-card:hover .product-image::after {
    opacity: 0.3;
    transform: translateZ(-15px) scale(1.1);
}

.no-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--brown-medium);
    background: linear-gradient(135deg, var(--brown-very-light) 0%, #f1f3f4 100%);
    position: relative;
    border-radius: 20px 20px 0 0;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 3D Popup effect for no-image-placeholder */
.product-card:hover .no-image-placeholder {
    transform: translateZ(30px) translateY(-15px) rotateX(5deg);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 15px 30px rgba(184, 65, 31, 0.08),
        0 5px 15px rgba(244, 196, 48, 0.08);
}

.no-image-placeholder::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px dashed var(--brown-medium);
    border-radius: 50%;
    opacity: 0.3;
    transition: all 0.4s ease;
}

.product-card:hover .no-image-placeholder::before {
    opacity: 0.5;
    transform: scale(1.1);
}

.no-image-placeholder i {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
    color: var(--primary-brown);
    z-index: 1;
}

.no-image-placeholder span {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.8;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Product Content */
.product-content {
    padding: 2rem 1.8rem 2.2rem;
    position: relative;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.2rem;
    gap: 0.8rem;
}

.product-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.4;
    flex: 1;
    transition: color 0.3s ease;
}

.product-card:hover .product-name {
    color: var(--primary-brown);
}

.product-id {
    background: linear-gradient(135deg, var(--golden), #f4c430);
    color: var(--brown-dark);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(244, 196, 48, 0.3);
    transform: scale(1);
    transition: all 0.3s ease;
}

.product-card:hover .product-id {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(244, 196, 48, 0.4);
}

.product-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    color: var(--brown-medium);
    font-size: 10px;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    background-color: rgba(184, 65, 31, 0.05);
    border-radius: 12px;
    border-left: 3px solid var(--golden);
    transition: all 0.3s ease;
}

.product-card:hover .product-brand {
    background-color: rgba(184, 65, 31, 0.08);
    border-left-color: var(--primary-brown);
}

.product-brand i {
    font-size: 0.9rem;
    color: var(--golden);
}

.product-offer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 1rem 0 0.5rem;
    border-top: 2px solid var(--brown-very-light);
    position: relative;
}

.product-offer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: var(--golden);
    border-radius: 1px;
}

.offer-label {
    font-size: 10px;
    color: var(--brown-medium);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.offer-value {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--golden-light), #fff8dc);
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    border: 2px solid var(--golden);
    box-shadow: 0 3px 10px rgba(244, 196, 48, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.offer-value::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.product-card:hover .offer-value::before {
    left: 100%;
}

.product-card:hover .offer-value {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(244, 196, 48, 0.3);
}

.product-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--brown-very-light);
}

.price-label {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
}

.price-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-brown);
}

/* No Products State */
.no-products {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--brown-medium);
}

.no-products i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.no-products h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.no-products p {
    font-size: 1.1rem;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .hero-title {
        font-size: 3rem;
    }

    .product-image {
        height: 200px;
    }

    .products-grid {
        padding: 1.5rem 0;
    }
}

@media (max-width: 992px) {
    .hero-title {
        font-size: 2.8rem;
    }

    .products-section {
        padding: 80px 0;
    }

    .product-card {
        margin-bottom: 2rem;
    }

    /* Adjust grid spacing */
    .products-grid .col-xl-3,
    .products-grid .col-lg-4,
    .products-grid .col-md-6,
    .products-grid .col-6 {
        margin-bottom: 2.5rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 80px 0 50px;
        margin-top: 60px;
    }

    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .products-section {
        padding: 60px 0;
    }

    .products-grid {
        padding: 1rem 0;
        margin-top: 1.5rem;
    }

    .products-grid .col-xl-3,
    .products-grid .col-lg-4,
    .products-grid .col-md-6,
    .products-grid .col-6 {
        margin-bottom: 2rem;
        padding: 0 0.75rem;
    }

    .product-card {
        margin-bottom: 1.5rem;
        border-radius: 16px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    }

    .product-content {
        padding: 1.5rem 1.25rem 1.75rem;
    }

    .product-image {
        height: 200px;
        border-radius: 16px 16px 0 0;
    }

    .product-name {
        font-size: 1rem;
        line-height: 1.3;
    }

    .product-header {
        margin-bottom: 1rem;
        gap: 0.5rem;
    }

    .product-id {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }

    .product-brand {
        margin-bottom: 1rem;
    }

    .product-brand span {
        font-size: 0.85rem;
    }

    .offer-value {
        font-size: 1.1rem;
        padding: 0.3rem 0.6rem;
    }

    .offer-label {
        font-size: 0.85rem;
    }

    /* Simplified hover effects for tablets */
    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 30px rgba(184, 65, 31, 0.12);
    }

    .product-card:hover .product-image {
        transform: translateZ(15px) translateY(-8px) rotateX(2deg);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    }

    /* No products message */
    .no-products {
        padding: 2rem 1rem;
    }

    .no-products h3 {
        font-size: 1.5rem;
    }

    .no-products p {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 60px 0 40px;
        margin-top: 50px;
    }

    .hero-title {
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        padding: 0 1.5rem;
        line-height: 1.4;
    }

    .products-section {
        padding: 40px 0;
    }

    .products-grid {
        padding: 0.5rem 0;
        margin-top: 1rem;
    }

    .products-grid .col-xl-3,
    .products-grid .col-lg-4,
    .products-grid .col-md-6,
    .products-grid .col-6 {
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }

    .product-card {
        margin-bottom: 1rem;
        border-radius: 14px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
        overflow: hidden;
        /* Prevent 3D effects from causing scrolling issues */
    }

    .product-content {
        padding: 1.25rem 1rem 1.5rem;
    }

    .product-image {
        height: 180px;
        border-radius: 14px 14px 0 0;
    }

    .product-header {
        flex-direction: column;
        gap: 0.6rem;
        align-items: flex-start;
        margin-bottom: 0.8rem;
    }

    .product-name {
        font-size: 0.95rem;
        line-height: 1.3;
        margin-bottom: 0;
        text-align: left;
        width: 100%;
    }

    .product-id {
        align-self: flex-end;
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        border-radius: 8px;
        margin-top: -0.3rem;
    }

    .product-brand {
        margin-bottom: 0.8rem;
        justify-content: flex-start;
    }

    .product-brand i {
        font-size: 0.75rem;
    }

    .product-brand span {
        font-size: 0.8rem;
    }

    .product-offer {
        padding: 0.75rem 0 0.5rem;
        margin-bottom: 0.5rem;
    }

    .offer-label {
        font-size: 0.8rem;
        font-weight: 500;
    }

    .offer-value {
        font-size: 1rem;
        padding: 0.25rem 0.5rem;
        border-radius: 8px;
        font-weight: 700;
    }

    /* Minimal hover effects for mobile */
    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(184, 65, 31, 0.1);
    }

    .product-card:hover .product-image {
        transform: translateZ(5px) translateY(-3px) rotateX(1deg);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

    /* Disable complex animations on mobile for performance */
    .product-card:hover .product-image::after {
        opacity: 0.1;
    }

    /* No products message for mobile */
    .no-products {
        padding: 1.5rem 1rem;
        text-align: center;
    }

    .no-products i {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .no-products h3 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }

    .no-products p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 50px 0 35px;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        padding: 0 1rem;
    }

    .products-section {
        padding: 2px 0;
    }

    .products-grid .col-xl-3,
    .products-grid .col-lg-4,
    .products-grid .col-md-6,
    .products-grid .col-6 {
        padding: 0 0.25rem;
        margin-bottom: 1.25rem;
    }

    .product-card {
        border-radius: 12px;
    }

    .product-content {
        padding: 1rem 0.85rem 1.25rem;
    }

    .product-image {
        height: 160px;
        border-radius: 12px 12px 0 0;
    }

    .product-name {
        font-size: 0.9rem;
    }

    .product-id {
        font-size: 0.65rem;
    }

    .offer-value {
        font-size: 0.95rem;
    }

    /* Completely disable 3D effects on very small screens */
    .product-card:hover .product-image {
        transform: none;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    }
}

@media (max-width: 375px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .products-grid .col-xl-3,
    .products-grid .col-lg-4,
    .products-grid .col-md-6,
    .products-grid .col-6 {
        padding: 0 0.125rem;
    }

    .product-image {
        height: 150px;
    }

    .product-content {
        padding: 0.85rem 0.75rem 1rem;
    }

    .product-name {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .product-brand {
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
    }

    .offer-value {
        font-size: 1.1rem;
        padding: 0.3rem 0.6rem;
    }

    /* Simplified animations on mobile */
    .product-card {
        animation-duration: 0.4s;
    }

    .product-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 15px 25px rgba(184, 65, 31, 0.12);
    }

    .no-image-placeholder i {
        font-size: 2.2rem;
    }

    .no-image-placeholder span {
        font-size: 0.85rem;
    }
}

/* Animation for card entrance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }

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

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.product-card {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* Stagger animation delay for each card */
.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;
}

.product-card:nth-child(7) {
    animation-delay: 0.7s;
}

.product-card:nth-child(8) {
    animation-delay: 0.8s;
}

.product-card:nth-child(9) {
    animation-delay: 0.9s;
}

.product-card:nth-child(10) {
    animation-delay: 1.0s;
}

.product-card:nth-child(11) {
    animation-delay: 1.1s;
}

.product-card:nth-child(12) {
    animation-delay: 1.2s;
}

/* Hover animations for specific elements */
.product-card:hover .product-brand i {
    animation: pulse 1.5s infinite;
}

.product-card:hover .no-image-placeholder i {
    animation: pulse 2s infinite;
}

/* Loading animation for images */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 200px 100%;
    animation: shimmer 2s infinite linear;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-image:hover::before {
    opacity: 1;
}