.products {
    margin-bottom: 50px;
}

.products h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #f7e7ce;
    font-size: 36px;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

/* Dynamic classes for different product counts */
.product-grid.items-1 {
    grid-template-columns: minmax(300px, 400px);
    justify-content: center;
    gap: 0;
    max-width: 400px;
}

.product-grid.items-2 {
    grid-template-columns: repeat(3, minmax(300px, 1fr));
    justify-content: center;
    gap: 25px;
    max-width: 1200px;
}

.product-grid.items-3 {
    grid-template-columns: repeat(3, minmax(300px, 350px));
    justify-content: center;
    gap: 25px;
    max-width: 1100px;
}

.product-grid.items-4 {
    grid-template-columns: repeat(3, minmax(300px, 1fr));
    justify-content: center;
    gap: 25px;
    max-width: 1200px;
}

.product-grid.items-5-plus {
    grid-template-columns: repeat(3, minmax(300px, 1fr));
    justify-content: center;
    gap: 25px;
    max-width: 1200px;
}

.product-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    min-height: 400px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    max-width: 400px;
}

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

.product-image {
    width: 100%;
    height: 250px;
    margin: 0 auto 15px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background-color: transparent !important;
    background: none !important;
    padding: 10px;
    box-sizing: border-box;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 1;
    border-radius: 0;
    transition: transform 0.3s ease;
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background-color: transparent !important;
    background: none !important;
}



.product-alt-image {
    opacity: 0;
}

.product-card {
    border-radius: 15px;
    overflow: hidden;
}


.product-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
    width: 100%;
}

.product-title {
    margin: 10px 0;
    color: #a67f83;
}

.product-template-note {
    display: none;
}

.product-price {
    margin: 10px 0 15px 0;
    text-align: center;
    order: 2;
}

.price-amount {
    font-size: 20px;
    font-weight: bold;
    color: #a67f83;
}


/* Heartbeat Animation */
@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    35% { transform: scale(1); }
    45% { transform: scale(1.3); }
    55% { transform: scale(1); }
}



/*btn styles*/
/* Wishlist Button Styles */
.btn-wishlist {
    background: none;
    border: none;
    color: #a67f83;
    cursor: pointer;
    font-size: 1.2em;
    padding: 8px;
    transition: all 0.3s ease;
    position: relative;
    outline: none;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.btn-wishlist:hover {
    transform: scale(1.1);
    background-color: rgba(255, 0, 0, 0.05);
}

/* Solid heart when active */
.btn-wishlist.active i.fa-heart {
    color: #ff0000 !important;
    animation: heartbeat 1s ease-in-out;
    font-weight: 900;
}

/* Outline heart when inactive */
.btn-wishlist i.fa-heart {
    transition: all 0.3s ease;
    display: inline-block;
    font-weight: 400;
}

/* Hover effect for outline heart */
.btn-wishlist:not(.active):hover i.fa-heart {
    color: #ff6b6b;
}

/* Pulsing effect for active state */
.btn-wishlist.active i::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.6s ease-out;
    z-index: -1;
}

.btn-wishlist.active i:active::after {
    transform: scale(1.5);
    opacity: 0;
}

/* View Button Styles */
.btn-view {
    background-color: #a67f83;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-view i {
    font-size: 0.9em;
}

.btn-view:hover {
    background-color: #db9097;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-view:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) inset;
}

/* Customize Button Styles (for preview modal) */
.btn-customize-preview {
    background-color: #a67f83;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 16px;
    margin-top: 20px;
}

.btn-customize-preview i {
    font-size: 0.9em;
}

.btn-customize-preview:hover {
    background-color: #db9097;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-customize-preview:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) inset;
}

/* Product Actions Container */
.product-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: auto;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

/* View More Button */
.view-btn {
    background-color: #a67f83;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.view-btn:hover {
    background-color: #db9097;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.view-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) inset;
}

.view-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

.view-btn:focus:not(:active)::after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

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

.preview-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.preview-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 20px;
    top: 15px;
    z-index: 1001;
    cursor: pointer;
    transition: color 0.3s ease;
}

.preview-close:hover,
.preview-close:focus {
    color: #000;
    text-decoration: none;
}

.preview-container {
    display: flex;
    min-height: 500px;
    border-radius: 15px;
    overflow: hidden;
}

.preview-left {
    flex: 1;
    background: #fff;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preview-combined-area {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}



.preview-magnet-section {
    width: 100%;
    text-align: center;
}

.preview-magnet-section img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.preview-right {
    flex: 1;
    padding: 40px;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.preview-right h2 {
    color: #a67f83;
    margin-bottom: 20px;
    font-size: 28px;
}

.preview-right p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 16px;
}

.preview-price {
    margin-bottom: 30px;
}

.preview-price span {
    font-size: 24px;
    font-weight: bold;
    color: #a67f83;
}

/* Responsive Design for Product Grid */
@media (max-width: 1024px) {
    .product-grid,
    .product-grid.items-5-plus {
        grid-template-columns: repeat(2, minmax(300px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .product-grid,
    .product-grid.items-1,
    .product-grid.items-2,
    .product-grid.items-3,
    .product-grid.items-4,
    .product-grid.items-5-plus {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 15px;
        padding: 0 15px;
        max-width: 100%;
    }

    .product-card {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .product-grid,
    .product-grid.items-1,
    .product-grid.items-2,
    .product-grid.items-3,
    .product-grid.items-4,
    .product-grid.items-5-plus {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
        max-width: 100%;
    }

    .product-card {
        max-width: 100%;
        padding: 15px;
    }
}

/* Responsive Design for Preview Modal */
@media (max-width: 768px) {
    .preview-container {
        flex-direction: column;
        min-height: auto;
    }

    .preview-left,
    .preview-right {
        padding: 20px;
    }

    .preview-modal-content {
        margin: 10% auto;
        width: 95%;
    }

    .preview-combined-area {
        max-width: 100%;
        gap: 15px;
    }
}
