/* ==========================================================================
   WooCommerce Product Carousel Styles
   ========================================================================== */
/* Reset and Base Styles - Override Theme Styles */
.woo-product-carousel-wrapper,
.woo-product-carousel-wrapper * {
    box-sizing: border-box !important;
}

/* Carousel Wrapper */
.woo-product-carousel-wrapper {
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 40px 20px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    background: transparent !important;
    border: none !important;
}

.woo-product-carousel-wrapper a {
    text-decoration: none !important;
    color: inherit !important;
}

/* Carousel Header */
.carousel-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 30px !important;
}

.carousel-title {
    font-size: 32px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin: 0 !important;
    letter-spacing: -0.5px;
}

.view-all-link {
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.view-all-link:hover {
    color: #333;
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    background: #000000;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    border-radius: 0;
}

.carousel-nav-btn.prev-btn {
    left: 8px;
}

.carousel-nav-btn.next-btn {
    right: 8px;
}

.carousel-nav-btn:hover {
    background: #333;
    transform: translateY(-50%) scale(1.05);
}

.carousel-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-nav-btn:disabled:hover {
    background: #000000;
    transform: translateY(-50%);
}

/* Carousel Container */
.carousel-container {
    position: relative;
    padding: 0 60px;
}

.woo-product-carousel {
    position: relative;
    overflow: hidden;
    padding: 20px 0;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.645, 0.045, 0.355, 1);
    align-items: stretch;
}

.carousel-item {
    flex: 0 0 100%;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0 10px;
}

/* Product Card */
.product-card {
    background: #edf1f2;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
}

/* Product Badge */
.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #000000;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    text-transform: capitalize;
}

/* Product Image */
.product-image-wrapper {
    position: relative;
    overflow: hidden;
    background: #f4f4f4;
    aspect-ratio: 10 / 10;
    border-radius: 0;
}

.product-image-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: #ffffff;
    border-radius: 25px 0 0 0;
    z-index: 2;
}

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

.product-card:hover .product-image-wrapper img {
    transform: scale(1.03);
}

/* Add to Cart Icon */
.add-to-cart-icon {
    position: absolute !important;
    bottom: 5px !important;
    right: 5px !important;
    width: 44px !important;
    height: 44px !important;
    background: #000000 !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    z-index: 3 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: none !important;
    outline: none !important;
    cursor: pointer !important;
}

.add-to-cart-icon:hover {
    background: #ffffff !important;
    color: #000000 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.add-to-cart-icon:hover svg {
    stroke: #000000 !important;
    color: #000000 !important;
}

.add-to-cart-icon svg {
    width: 20px !important;
    height: 20px !important;
    stroke: #ffffff !important;
    fill: none !important;
    color: #ffffff !important;
}

/* Product Info */
.product-info {
    padding: 15px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
}

.product-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a:hover {
    color: #181818;
}

/* Product Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.star-rating {
    display: flex;
    gap: 2px;
}

.star {
    color: #d1d5db;
    font-size: 25px;
}

.star.filled {
    color: #fbbf24;
}

.star.half {
    color: #fbbf24;
    position: relative;
}

.rating-count {
    font-size: 12px;
    color: #6b7280;
}

/* Product Price */
.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: auto;
}

.product-price del {
    font-size: 14px;
    color: #9ca3af;
    font-weight: 400;
    margin-right: 6px;
}

.product-price ins {
    text-decoration: none;
    color: #059669;
}

/* Carousel Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.carousel-dot.active {
    background: #333;
    width: 30px;
    border-radius: 5px;
}

.carousel-dot:hover {
    background: #6b7280;
}

/* Loading State */
.carousel-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

/* Responsive Design - Mobile First Approach */

/* Mobile (0-767px) - 2 cards */
@media screen and (max-width: 767px) {
    .woo-product-carousel-wrapper {
        padding: 20px 10px;
    }
    
    .carousel-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
        padding: 0 15px;
    }
    
    .carousel-title {
        font-size: 20px;
    }
    
    .carousel-container {
        padding: 0 15px;
    }
    
    .woo-product-carousel {
        padding: 15px 0;
    }
    
    .carousel-item {
        flex: 0 0 50%;
        flex-shrink: 0;
        box-sizing: border-box;
        padding: 0 5px;
    }
    
    .product-title {
        font-size: 14px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .product-badge {
        font-size: 10px;
        padding: 4px 10px;
        top: 10px;
        left: 10px;
    }
    
    .product-info {
        padding: 12px 10px;
    }
    
    .add-to-cart-icon {
        width: 38px !important;
        height: 38px !important;
    }
    
    .add-to-cart-icon svg {
        width: 18px !important;
        height: 18px !important;
    }
    
    .carousel-nav-btn {
        display: none !important;
    }
    
    .star {
        font-size: 20px;
    }
    
    .rating-count {
        font-size: 11px;
    }
}

/* Tablet (768px - 1023px) - 2 cards */
@media screen and (min-width: 768px) {
    .woo-product-carousel-wrapper {
        padding: 35px 15px;
    }
    
    .carousel-title {
        font-size: 28px;
    }
    
    .carousel-item {
        flex: 0 0 50%;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    
    .carousel-header {
        padding: 0 60px;
    }
    
    .carousel-container {
        padding: 0 60px;
    }
    
    .carousel-nav-btn {
        width: 48px;
        height: 48px;
    }
    
    .carousel-nav-btn.prev-btn {
        left: 8px;
    }
    
    .carousel-nav-btn.next-btn {
        right: 8px;
    }
    
    .product-title {
        font-size: 18px;
    }
}

/* Desktop (1024px+) - 4 cards */
@media screen and (min-width: 1024px) {
    .woo-product-carousel-wrapper {
        max-width: 1440px;
        margin: 0 auto;
        padding: 40px 20px;
    }
    
    .carousel-title {
        font-size: 32px;
    }
    
    .carousel-item {
        flex: 0 0 25%;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    
    .carousel-header {
        padding: 0 60px;
    }
    
    .carousel-container {
        padding: 0 60px;
    }
    
    .carousel-nav-btn {
        width: 50px;
        height: 50px;
    }
    
    .carousel-nav-btn.prev-btn {
        left: 8px;
    }
    
    .carousel-nav-btn.next-btn {
        right: 8px;
    }
    
    .product-carousel {
        padding-block-end: var(--spacing-7xl);
        padding-block-start: var(--spacing-2xl);
    }
}


/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.carousel-item {
    animation: fadeIn 0.6s ease-out;
}

/* Cart Icon Feedback States */
.add-to-cart-icon.loading {
    pointer-events: none !important;
    opacity: 0.7 !important;
}

.add-to-cart-icon.success-feedback {
    background: #059669 !important;
    animation: successPulse 0.5s ease !important;
}

.add-to-cart-icon.error-feedback {
    background: #dc2626 !important;
    animation: errorShake 0.5s ease !important;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Accessibility */
.carousel-nav-btn:focus,
.add-to-cart-icon:focus,
.carousel-dot:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Product Variation Modal */
.product-variation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border: 2px solid #ffffff !important;
    background: #000000 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    transition: all 0.3s ease !important;
    z-index: 10000 !important;
    border-radius: 50% !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.modal-close svg {
    width: 20px !important;
    height: 20px !important;
    stroke: #ffffff !important;
    fill: none !important;
    stroke-width: 2 !important;
    display: block !important;
}

.modal-close:hover {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #000000 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.modal-close:hover svg {
    stroke: #000000 !important;
}

.modal-body {
    padding: 30px;
}

.modal-product-image {
    width: 140px;
    height: 140px;
    margin: 0 auto 25px;
    background: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-product-details {
    text-align: left;
}

.modal-product-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.modal-product-price {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.modal-product-stock {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 25px 0;
}

.modal-product-stock .stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.modal-product-stock .in-stock {
    color: #16a34a;
}

.modal-product-stock .low-stock {
    color: #f59e0b;
}

.modal-product-stock .out-of-stock {
    color: #dc2626;
}

.modal-product-stock .on-backorder {
    color: #f59e0b;
}

.variation-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.variation-option {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.variation-option label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-transform: capitalize;
}

.variation-option select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a1a;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 45px;
}

.variation-option select:hover {
    border-color: #999;
}

.variation-option select:focus {
    outline: none;
    border-color: #000;
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.quantity-selector label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin: 0 !important;
}

#modal-quantity {
    width: 100%;
    height: 45px;
    text-align: center;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    background: #ffffff;
    appearance: textfield;
    -moz-appearance: textfield;
    transition: border-color 0.3s ease;
}

#modal-quantity::-webkit-outer-spin-button,
#modal-quantity::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#modal-quantity:hover {
    border-color: #999;
}

#modal-quantity:focus {
    outline: none;
    border-color: #000;
}

.modal-add-to-cart-btn {
    width: 100% !important;
    padding: 16px 32px !important;
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
    border-radius: 50px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-top: 10px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.modal-add-to-cart-btn:hover {
    background: #000000 !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

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

.modal-add-to-cart-btn:disabled {
    background: #f5f5f5;
    color: #999;
    border-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.variation-option.out-of-stock select {
    opacity: 0.5;
    cursor: not-allowed;
}

.variation-message {
    padding: 12px;
    background: #f0f0f0;
    border-radius: 6px;
}

/* Print Styles */
@media print {
    .carousel-nav-btn,
    .carousel-dots,
    .add-to-cart-icon,
    .product-variation-modal {
        display: none;
    }
    
    .carousel-track {
        display: block;
    }
    
    .carousel-item {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
}
