/* ========================================
   UNIVERSAL PRODUCT CARD - GLOBAL STYLES
   Used across: Homepage, Shop, Category, Product Details (Related Products)
   ======================================== */

.universal-product-card {
    width: 100%;
    min-width: 240px;
    max-width: 100%;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
}

.product-card-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card-container:hover {
    transform: translateY(-4px);
    border-color: #9333ea;
    box-shadow: 0 8px 24px rgba(147, 51, 234, 0.12);
}

/* ========================================
   PRODUCT IMAGE SECTION
   ======================================== */

.product-image-section {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f5f5f7;
    overflow: hidden;
}

.product-link {
    display: block;
    width: 100%;
    height: 100%;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card-container:hover .product-img {
    transform: scale(1.08);
}

/* ========================================
   WISHLIST HEART ICON - TOP RIGHT
   ======================================== */

.wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.wishlist-btn:hover {
    background: #ff4757;
    transform: scale(1.1);
}

.wishlist-btn:hover svg {
    stroke: #ffffff;
}

.wishlist-btn svg {
    stroke: #9ca3af;
    transition: all 0.3s ease;
}

.wishlist-btn.active {
    background: #ff4757;
}

.wishlist-btn.active svg {
    fill: #ffffff;
    stroke: #ffffff;
}

/* ========================================
   DISCOUNT BADGE - TOP LEFT
   ======================================== */

.discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ff4757;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(255, 71, 87, 0.3);
}

/* ========================================
   PRODUCT CONTENT SECTION
   ======================================== */

.product-content-section {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

/* ========================================
   CATEGORY - UPPERCASE BLUE
   ======================================== */

.product-category-link {
    font-size: 11px;
    font-weight: 600;
    color: #3b82f6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-block;
}

.product-category-link:hover {
    color: #2563eb;
}

/* ========================================
   PRODUCT TITLE
   ======================================== */

.product-title-text {
    margin: 0;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #1f2937;
    min-height: 42px;
}

.product-title-link {
    color: #1f2937;
    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-link:hover {
    color: #7c3aed;
}

/* ========================================
   RATING STARS WITH REVIEW COUNT
   ======================================== */

.product-rating-section {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0;
}

.rating-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.star-icon {
    width: 14px;
    height: 14px;
}

.star-icon.filled {
    fill: #FFA500;
}

.star-icon.empty {
    fill: none;
    stroke: #FFA500;
}

.review-count {
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
}

/* ========================================
   PRICE SECTION - PREVENT OVERFLOW
   ======================================== */

.product-price-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 32px;
    margin: 8px 0;
}

.current-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #9333ea;
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    white-space: nowrap;
}

.original-price {
    font-size: 0.875rem;
    font-weight: 400;
    color: #9ca3af;
    text-decoration: line-through;
    white-space: nowrap;
}

/* ========================================
   ORDER NOW BUTTON AND CART ICON (SEPARATED) - SOLID PURPLE
   ======================================== */

.product-action-section {
    margin-top: auto;
    padding-top: 0.5rem;
    display: flex !important;
    gap: 8px !important;
    align-items: stretch;
}

/* ORDER NOW BUTTON - SOLID PURPLE (NO GRADIENT) */
.order-now-btn,
.btn-order,
.btn-order-now,
.btn-order-now-variant {
    flex: 1 !important;
    background: #9333ea !important;
    background-color: #9333ea !important;
    background-image: none !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0.625rem 1rem !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 6px rgba(147, 51, 234, 0.2) !important;
    min-height: 40px !important;
    font-family: inherit !important;
}

.order-now-btn:hover,
.btn-order:hover,
.btn-order-now:hover,
.btn-order-now-variant:hover {
    background: #7e22ce !important;
    background-color: #7e22ce !important;
    background-image: none !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3) !important;
}

.order-now-btn:active,
.btn-order:active {
    transform: translateY(0) !important;
}

/* CART ICON BUTTON - LIGHT PURPLE BACKGROUND (NO GRADIENT) */
.cart-icon-btn,
.btn-cart-icon,
.btn-add-cart,
.btn-add-cart-variant {
    flex: 0 0 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    width: 42px !important;
    background: rgba(147, 51, 234, 0.1) !important;
    background-color: rgba(147, 51, 234, 0.1) !important;
    background-image: none !important;
    color: #9333ea !important;
    border: 1px solid rgba(147, 51, 234, 0.2) !important;
    border-radius: 8px !important;
    padding: 0.625rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 6px rgba(147, 51, 234, 0.1) !important;
}

.cart-icon-btn:hover,
.btn-cart-icon:hover,
.btn-add-cart:hover,
.btn-add-cart-variant:hover {
    background: #9333ea !important;
    background-color: #9333ea !important;
    background-image: none !important;
    color: #ffffff !important;
    border-color: #9333ea !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3) !important;
}

.cart-icon-btn:hover svg,
.btn-cart-icon:hover svg,
.btn-add-cart:hover svg,
.btn-add-cart-variant:hover svg {
    stroke: #ffffff !important;
}

.cart-icon-btn svg,
.btn-cart-icon svg,
.btn-add-cart svg,
.btn-add-cart-variant svg {
    width: 18px !important;
    height: 18px !important;
    stroke: #9333ea !important;
    stroke-width: 2 !important;
    fill: none !important;
    transition: all 0.3s ease;
    display: block !important;
    margin: 0 auto !important;
}

.cart-icon-btn i,
.btn-cart-icon i,
.btn-add-cart i,
.btn-add-cart-variant i {
    width: 18px !important;
    height: 18px !important;
    font-size: 18px !important;
}

/* OUT OF STOCK BUTTON */
.out-of-stock-btn {
    background: #e5e7eb !important;
    background-image: none !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.out-of-stock-btn:hover {
    background: #e5e7eb !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-block {
    width: 100% !important;
}

/* ========================================
   RESPONSIVE DESIGN
   Desktop: 4 columns
   Tablet: 2 columns
   Mobile: 1 column
   ======================================== */

/* Desktop - Default (4 columns handled by grid) */
@media (min-width: 1024px) {
    .product-title-text {
        font-size: 15px;
        min-height: 42px;
    }

    .current-price {
        font-size: 18px;
    }
}

/* Tablet - 2 columns */
@media (max-width: 1023px) and (min-width: 768px) {
    .product-title-text {
        font-size: 14px;
        min-height: 40px;
    }

    .current-price {
        font-size: 17px;
    }

    .order-now-btn {
        padding: 11px 14px;
        font-size: 13px;
    }
}

/* Mobile - 1 column */
@media (max-width: 767px) {
    .universal-product-card {
        margin-bottom: 20px;
        min-width: 200px;
    }

    .product-content-section {
        padding: 14px;
        gap: 6px;
    }

    .product-category-link {
        font-size: 10px;
    }

    .product-title-text {
        font-size: 14px;
        min-height: 38px;
    }

    .rating-stars .star-icon {
        width: 13px;
        height: 13px;
    }

    .review-count {
        font-size: 11px;
    }

    .current-price {
        font-size: 1rem !important;
    }

    .original-price {
        font-size: 13px;
    }

    /* MOBILE: Show buttons side by side (Order Now + Cart Icon) */
    .product-action-section {
        flex-direction: row !important;
        gap: 8px !important;
    }

    /* Order Now Button - Takes most space */
    .order-now-btn,
    .btn-order,
    .btn-order-now,
    .btn-order-now-variant {
        padding: 10px 12px !important;
        font-size: 13px !important;
        flex: 1 !important;
        width: auto !important;
        max-width: none !important;
        min-height: 42px !important;
    }

    /* Cart Icon Button - Square icon button */
    .cart-icon-btn,
    .btn-cart-icon,
    .btn-add-cart,
    .btn-add-cart-variant {
        flex: 0 0 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        width: 42px !important;
        padding: 10px !important;
        justify-content: center !important;
        min-height: 42px !important;
    }

    .cart-icon-btn svg,
    .btn-cart-icon svg,
    .btn-add-cart svg,
    .btn-add-cart-variant svg {
        width: 18px !important;
        height: 18px !important;
    }

    .wishlist-btn {
        width: 32px;
        height: 32px;
        top: 10px;
        right: 10px;
    }

    .wishlist-btn svg {
        width: 18px;
        height: 18px;
    }

    .discount-badge {
        font-size: 11px;
        padding: 5px 10px;
        top: 10px;
        left: 10px;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .universal-product-card {
        min-width: 180px;
    }

    .product-title-text {
        font-size: 13px;
        min-height: 36px;
    }

    .current-price {
        font-size: 15px !important;
    }
}

/* ========================================
   RELATED PRODUCTS SLIDER SPECIFIC FIXES
   ======================================== */

.related-products-carousel .swiper-slide {
    width: auto;
    height: auto;
}

.related-products-carousel .universal-product-card {
    min-width: 240px;
}

@media (max-width: 768px) {
    .related-products-carousel .universal-product-card {
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .related-products-carousel .universal-product-card {
        min-width: 180px;
    }
}

/* ========================================
   GRID CONTAINER STYLES
   (To be used in parent containers)
   ======================================== */

.product-grid-container {
    display: grid;
    gap: 24px;
}

/* 4 columns on desktop by default (for homepage) */
@media (min-width: 1024px) {
    .product-grid-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 3 columns ONLY for products page */
@media (min-width: 1024px) {
    .products-content .product-grid-container {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* 2 columns on tablet */
@media (max-width: 1023px) and (min-width: 768px) {
    .product-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* 2 columns on mobile (2 products per row) */
@media (max-width: 767px) {
    .product-grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* ========================================
   LOADING STATE
   ======================================== */

.product-card-container.loading {
    pointer-events: none;
    opacity: 0.6;
}

.product-card-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {

    .wishlist-btn,
    .order-now-btn {
        display: none;
    }

    .product-card-container {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
}