/* Enhanced styles for product detail page - Mobile & Desktop optimized */

/* Ensure minimum touch target size (44px) for all interactive elements */
:root {
    --touch-target-size: 48px;
    --mobile-spacing: 16px;
}

/* Variant Selector Improvements */
.variant-selector-wrapper {
    margin-bottom: 24px;
}

.variant-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.variant-option-btn {
    min-height: var(--touch-target-size);
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.variant-option-btn:hover,
.variant-option-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.variant-option-btn.selected {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary);
    color: white;
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.2);
}

.variant-option-btn.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.variant-option-btn .stock-badge {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.8;
}

/* Enhanced Quantity Selector */
.quantity-selector-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #f8f9fa;
    border-radius: 16px;
    padding: 8px;
    margin: 20px 0;
}

.quantity-btn {
    width: var(--touch-target-size);
    height: var(--touch-target-size);
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--bs-primary);
}

.quantity-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quantity-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.quantity-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quantity-display {
    min-width: 80px;
    text-align: center;
}

.quantity-number {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    display: block;
}

.quantity-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile Add to Cart Button */
.mobile-cart-wrapper {
    width: 100%;
    padding: 12px 0;
}

.add-to-cart-mobile {
    width: 100%;
    min-height: 56px;
    border-radius: 16px;
    border: none;
    padding: 0;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background: var(--bs-primary);
    box-shadow: 0 4px 16px rgba(var(--bs-primary-rgb), 0.3);
}

.add-to-cart-mobile:not(:disabled):hover {
    background: var(--bs-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--bs-primary-rgb), 0.4);
}

.add-to-cart-mobile:not(:disabled):active {
    transform: translateY(0);
}

.add-to-cart-mobile:disabled {
    background: #6c757d;
    box-shadow: none;
    cursor: not-allowed;
}

.mobile-cart-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    color: white;
}

.mobile-cart-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.mobile-cart-text {
    font-size: 16px;
    font-weight: 600;
    text-align: left;
}

.mobile-cart-right {
    display: flex;
    align-items: center;
}

.mobile-price-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    min-width: 70px;
    text-align: center;
}

/* Loading and success states */
.add-to-cart-mobile.loading {
    pointer-events: none;
}

.add-to-cart-mobile.loading .mobile-cart-content {
    opacity: 0.7;
}

.add-to-cart-mobile.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.add-to-cart-mobile.cart-success {
    background: #28a745;
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.3);
}

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

/* Product Image Gallery Mobile Optimization */
@media (max-width: 768px) {
    .swiperthumb {
        height: 300px !important;
        margin-bottom: 12px !important;
    }
    
    .swiperthumbnav {
        height: 60px;
    }
    
    .swiperthumbnav .swiper-slide {
        width: 60px !important;
    }
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    /* Hide desktop quantity selector on mobile */
    .increamenter {
        display: none !important;
    }
    
    /* Adjust variant grid for smaller screens */
    .variant-options-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
    
    /* Mobile cart button adjustments */
    .mobile-cart-content {
        padding: 14px 16px;
    }
    
    .mobile-cart-text {
        font-size: 15px;
    }
    
    .mobile-price-badge {
        font-size: 14px;
        padding: 6px 10px;
        min-width: 60px;
    }
    
    .add-to-cart-mobile {
        min-height: 52px;
        border-radius: 14px;
    }
    
    /* Breadcrumbs */
    .breadcrumb {
        font-size: 12px;
        padding: 8px 0;
    }
    
    /* Product stats */
    .product-stats {
        font-size: 12px !important;
    }
    
    /* Tabs */
    .nav-tabs .nav-link {
        font-size: 14px;
        padding: 8px 12px;
    }
}

/* Haptic feedback simulation */
.haptic-feedback {
    animation: haptic 0.1s ease-out;
}

@keyframes haptic {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Success animation for add to cart */
.cart-success {
    animation: cartSuccess 0.6s ease-out;
}

@keyframes cartSuccess {
    0% { transform: scale(1); }
    25% { transform: scale(1.1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Improved focus states for accessibility */
.variant-option-btn:focus,
.quantity-btn:focus,
.add-to-cart-mobile:focus {
    outline: 3px solid rgba(var(--bs-primary-rgb), 0.5);
    outline-offset: 2px;
}

/* Service booking mobile improvements */
@media (max-width: 768px) {
    .service-booking {
        margin-left: -16px;
        margin-right: -16px;
        border-radius: 0;
        padding: 20px 16px;
    }
    
    .service-booking input[type="date"],
    .service-booking select {
        min-height: var(--touch-target-size);
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Desktop Quantity Selector Enhancements */
.quantity-selector-desktop {
    display: inline-flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.quantity-btn-desktop {
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #495057;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quantity-btn-desktop:hover:not(:disabled) {
    background: var(--bs-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.quantity-btn-desktop:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quantity-btn-desktop:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #e9ecef;
}

.quantity-input-desktop {
    width: 80px;
    height: 40px;
    border: 2px solid transparent;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    background: white;
    transition: all 0.2s ease;
}

.quantity-input-desktop:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.1);
}

/* Desktop Add to Cart Button Enhancement */
.add-to-cart-desktop {
    height: 48px;
    padding: 0 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.add-to-cart-desktop:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.3);
}

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

/* Desktop specific layout for variant products */
@media (min-width: 768px) {
    .desktop-variant-quantity {
        margin-top: 24px;
        padding: 20px;
        background: #f8f9fa;
        border-radius: 12px;
    }
    
    .desktop-cart-actions {
        display: flex;
        align-items: center;
        gap: 16px;
        margin-top: 20px;
    }
    
    .desktop-price-info {
        margin-left: auto;
        text-align: right;
    }
    
    .desktop-price-label {
        font-size: 12px;
        color: #6c757d;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .desktop-price-value {
        font-size: 24px;
        font-weight: 700;
        color: var(--bs-primary);
    }
}

/* Related Products Cards */
.related-product-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.related-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--bs-primary);
}

.related-product-card .card-img-wrapper {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.related-product-card .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.related-product-card .card-body {
    padding: 1rem;
}

.related-product-card .card-title {
    color: #333;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.related-product-card .card-text {
    color: var(--bs-primary);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.related-product-card .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.related-product-card:hover .btn {
    background-color: var(--bs-primary);
    color: white;
    transform: translateY(-2px);
}

/* Responsive adjustments for related products */
@media (max-width: 768px) {
    .related-product-card .card-img-wrapper {
        height: 150px;
    }
    
    .related-product-card .card-title {
        font-size: 0.9rem;
    }
    
    .related-product-card .card-text {
        font-size: 1rem;
    }
}

/* Hide mobile cart wrapper on desktop */
@media (min-width: 768px) {
    .mobile-cart-wrapper {
        display: none !important;
    }
}