/**
 * Custom Theme Styles
 * 
 * Contains all custom CSS for widgets, admin, and frontend
 * 
 * @package HelloElementorChild
 */

/* WhatsApp Button Styles */
.whatsapp-floating-button {
    margin: 20px 0;
}

.whatsapp-button-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.whatsapp-button-circle:hover {
    background: #128C7E;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.5);
}

.whatsapp-button-circle svg {
    width: 24px;
    height: 24px;
}

/* Admin Product Info Tab Styles */
#product_info_product_data h4 {
    margin: 15px 12px 10px;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    font-size: 13px;
    color: #23282d;
}

#product_info_product_data .options_group {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

/* Admin Settings Styles */
#whatsapp_contact_number {
    width: 300px;
}

/* Product Grid Widget Styles */
.product-grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 0;
    padding: 0;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.product-card .product-image {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1 / 1;
}

.product-card .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-card .product-image a {
    display: block;
    height: 100%;
}

.product-card .product-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card .product-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    flex-grow: 1;
}

.product-card .product-title a {
    color: #333333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-card .product-title a:hover {
    color: #3498db;
}

.product-card .product-price {
    margin: 10px 0;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}

.product-card .product-price del {
    opacity: 0.6;
    font-size: 14px;
    margin-right: 8px;
}

.product-card .product-price ins {
    text-decoration: none;
    color: #e74c3c;
}

.product-card .product-button {
    display: inline-block;
    width: 100%;
    padding: 10px 20px;
    background: #3498db;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-top: auto;
}

.product-card .product-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.no-products-found {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

.no-products-found p {
    margin: 0;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .product-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .product-grid-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .product-card .product-title {
        font-size: 15px;
    }

    .product-card .product-price {
        font-size: 16px;
    }
}

/* Product Slider Widget Styles */
.product-slider-wrapper {
    position: relative;
    padding: 0;
    margin: 0 auto;
    overflow: hidden;
}

.product-slider-wrapper .swiper {
    overflow: visible;
}

.product-slide-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-slide-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.product-slide-image {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 4 / 3;
}

.product-slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-slide-card:hover .product-slide-image img {
    transform: scale(1.05);
}

.product-slide-image a {
    display: block;
    height: 100%;
}

.product-slide-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-slide-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    flex-grow: 1;
}

.product-slide-title a {
    color: #333333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-slide-title a:hover {
    color: #3498db;
}

.product-slide-price {
    margin: 10px 0;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}

.product-slide-price del {
    opacity: 0.6;
    font-size: 14px;
    margin-right: 8px;
}

.product-slide-price ins {
    text-decoration: none;
    color: #e74c3c;
}

.product-slide-button {
    display: inline-block;
    width: 100%;
    padding: 10px 20px;
    background: #3498db;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-top: auto;
}

.product-slide-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

/* Swiper Navigation Arrows */
.product-slider-wrapper .swiper-button-prev,
.product-slider-wrapper .swiper-button-next {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.product-slider-wrapper .swiper-button-prev:after,
.product-slider-wrapper .swiper-button-next:after {
    font-size: 20px;
    font-weight: bold;
}

.product-slider-wrapper .swiper-button-prev:hover,
.product-slider-wrapper .swiper-button-next:hover {
    background: #3498db;
    color: #ffffff;
    transform: scale(1.1);
}

.product-slider-wrapper .swiper-button-prev {
    left: 0;
}

.product-slider-wrapper .swiper-button-next {
    right: 0;
}

/* Swiper Pagination Dots */
.product-slider-wrapper .swiper-pagination {
    position: relative;
    margin-top: 30px;
}

.product-slider-wrapper .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #cccccc;
    opacity: 1;
    transition: all 0.3s ease;
}

.product-slider-wrapper .swiper-pagination-bullet-active {
    background: #3498db;
    width: 30px;
    border-radius: 5px;
}

/* Responsive Slider */
@media (max-width: 1024px) {
    .product-slider-wrapper {
        padding: 0 40px;
    }
}

@media (max-width: 768px) {
    .product-slider-wrapper {
        padding: 0 30px;
    }

    .product-slider-wrapper .swiper-button-prev,
    .product-slider-wrapper .swiper-button-next {
        width: 36px;
        height: 36px;
    }

    .product-slider-wrapper .swiper-button-prev:after,
    .product-slider-wrapper .swiper-button-next:after {
        font-size: 16px;
    }

    .product-slide-title {
        font-size: 15px;
    }

    .product-slide-price {
        font-size: 16px;
    }
}

/* ========================================
   Cart Drawer - Lightweight
   ======================================== */

.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 9998;
}

.cart-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 100%;
    max-width: 450px;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 20px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.cart-drawer.open { right: 0; }
body.cart-drawer-open { overflow: hidden; }

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.cart-drawer-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.cart-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    transition: transform 0.2s;
}

.cart-drawer-close:hover { transform: rotate(90deg); }

.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
}

.cart-drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.cart-drawer-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-drawer-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    position: relative;
    transition: all 0.3s;
}

.cart-drawer-item.removing {
    opacity: 0;
    transform: translateX(100%);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.cart-item-title a {
    color: #333;
    text-decoration: none;
}

.cart-item-title a:hover { color: #3498db; }

.cart-item-price {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #d0d0d0;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: #3498db;
    border-color: #3498db;
    color: #fff;
}

.qty-input {
    width: 50px;
    height: 30px;
    text-align: center;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-weight: 600;
}

.cart-item-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.cart-item-remove:hover { background: #fee; }
.cart-item-remove svg { color: #e74c3c; }

.cart-drawer-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.cart-drawer-subtotal {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 18px;
}

.cart-drawer-subtotal strong {
    color: #2c3e50;
    font-size: 20px;
}

.cart-drawer-checkout-btn,
.cart-drawer-view-cart {
    display: block;
    width: 100%;
    padding: 15px 20px;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s;
}

.cart-drawer-checkout-btn {
    background: #3498db;
    color: #fff;
    margin-bottom: 10px;
    border: none;
    font-size: 16px;
}

.cart-drawer-checkout-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52,152,219,0.3);
}

.cart-drawer-view-cart {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
    font-size: 14px;
}

.cart-drawer-view-cart:hover {
    background: #3498db;
    color: #fff;
}

.cart-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s;
}

.cart-notice.show {
    opacity: 1;
    transform: translateX(0);
}

.cart-notice-success { border-left: 4px solid #27ae60; color: #27ae60; }
.cart-notice-error { border-left: 4px solid #e74c3c; color: #e74c3c; }

@media (max-width: 768px) {
    .cart-drawer {
        max-width: 100%;
        right: -100%;
    }
    .cart-drawer-header,
    .cart-drawer-body,
    .cart-drawer-footer {
        padding: 15px 20px;
    }
    .cart-item-image {
        width: 70px;
        height: 70px;
    }
    .cart-notice {
        right: 10px;
        left: 10px;
    }
}

/* Related Products Section */
.related-products-section {
    clear: both;
}

/* ========================================
   SEO Breadcrumbs Navigation
   ======================================== */

.gorurhaat-breadcrumbs {
    margin: 20px 0;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #3498db;
}

.gorurhaat-breadcrumbs ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.gorurhaat-breadcrumbs li {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.gorurhaat-breadcrumbs li:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: #999;
    font-weight: bold;
}

.gorurhaat-breadcrumbs a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.gorurhaat-breadcrumbs a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.gorurhaat-breadcrumbs li:last-child {
    color: #333;
    font-weight: 600;
}

@media (max-width: 768px) {
    .gorurhaat-breadcrumbs {
        padding: 12px 15px;
        margin: 15px 0;
    }
    
    .gorurhaat-breadcrumbs li {
        font-size: 13px;
    }
}

/* ========================================
   Enhanced Image Preloader Styles
   ======================================== */

/* Preloader container */
.image-preloader-container {
    position: relative;
    background-color: #f8f9fa;
    overflow: hidden;
}

.image-preloader-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 2s infinite;
    z-index: 1;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Preloader spinner overlay */
.has-preloader.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade in animation for loaded images */
.has-preloader.loaded img {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Product grid specific preloader */
.product-card .product-image.has-preloader,
.product-slide-card .product-slide-image.has-preloader {
    aspect-ratio: 1 / 1;
    background-color: #f8f9fa;
}

/* Related products preloader */
.related-product-image.has-preloader {
    aspect-ratio: 4 / 3;
    background-color: #f8f9fa;
}

/* Single product gallery preloader */
.woocommerce-product-gallery__wrapper .has-preloader {
    min-height: 400px;
}

/* Cart drawer image preloader */
.cart-drawer-item .cart-item-image.has-preloader {
    width: 80px;
    height: 80px;
    background-size: 25px 25px;
}

/* Skeleton loading effect */
.skeleton-loading {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Blur effect while loading */
.has-preloader.loading img {
    filter: blur(5px);
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.has-preloader.loaded img {
    filter: blur(0);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .woocommerce-product-gallery__wrapper .has-preloader {
        min-height: 300px;
    }
    
    .has-preloader.loading::after {
        width: 30px;
        height: 30px;
        margin: -15px 0 0 -15px;
        border-width: 2px;
    }
    
    .cart-drawer-item .cart-item-image.has-preloader {
        width: 70px;
        height: 70px;
        background-size: 20px 20px;
    }
}

/* Accessibility - Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .has-preloader.loading::before,
    .has-preloader.loading::after,
    .has-preloader.loaded img {
        animation: none;
    }
    
    .has-preloader.loading img {
        opacity: 0.5;
    }
    
    .has-preloader.loaded img {
        opacity: 1;
        transition: opacity 0.3s ease;
    }
}
