/* ========================================
   MODERN PRODUCT CARD SYSTEM
   Fully Responsive with Impressive Design
   ======================================== */

/* ========================================
   1. PRODUCT CARD BASE STYLES
   ======================================== */

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    height: 100%;
    min-height: auto; /* Remove fixed height for mobile flexibility */
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.04);
}

/* Only apply min-height on larger screens for consistency */
@media (min-width: 769px) {
    .product-card {
        min-height: 460px;
    }
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    border-color: rgba(232, 197, 71, 0.3);
}

/* Product Image Container */
.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 6; /* Modern aspect-ratio for consistent sizing */
    overflow: hidden;
    background: #F8F9FA;
}

/* Fallback for older browsers without aspect-ratio support */
@supports not (aspect-ratio: 1) {
    .product-image {
        padding-top: 120%; /* 5:6 aspect ratio fallback */
        height: 0;
    }
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Image Functionality */
.hover-image {
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 2;
}

.main-image {
    z-index: 1;
}

.product-card:hover .hover-image {
    opacity: 1;
}

.product-card:hover .main-image {
    opacity: 0;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

/* Product Badges */
.product-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.badge {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.badge-new {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge-sale {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.badge-hot {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #2C3E50;
}

.badge-out-of-stock {
    background: linear-gradient(135deg, #868f96 0%, #596164 100%);
    color: white;
}

/* Product Actions (Overlay) */
.product-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    z-index: 10;
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    color: #2C3E50;
    cursor: pointer;
}

.action-btn:hover {
    background: #E8C547;
    color: white;
    transform: scale(1.1);
}

.action-btn.active {
    background: #E74C3C;
    color: white;
}

/* Quick View Button (Bottom Overlay) */
.quick-view {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(44, 62, 80, 0.95);
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
    cursor: pointer;
}

.product-card:hover .quick-view {
    opacity: 1;
    transform: translateY(0);
}

.quick-view:hover {
    background: #E8C547;
    color: #2C3E50;
}

/* ========================================
   2. PRODUCT INFO SECTION
   ======================================== */

.product-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 200px;
}

/* Category & Brand */
.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.product-category {
    font-size: 11px;
    text-transform: uppercase;
    color: #95A5A6;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.product-brand {
    font-size: 11px;
    color: #E8C547;
    font-weight: 600;
}

/* Product Title */
.product-title {
    font-size: 16px;
    font-weight: 600;
    color: #2C3E50;
    line-height: 1.5;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 64px; /* allow a longer product title to occupy two lines without overlap */
}

.product-title a {
    color: inherit;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #E8C547;
}

/* Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.stars {
    display: flex;
    gap: 2px;
}

.stars i {
    font-size: 12px;
    color: #FFD700;
}

.stars i.far {
    color: #E0E0E0;
}

.rating-count {
    font-size: 12px;
    color: #95A5A6;
}

/* Price Section */
.product-price {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
}

.price-current {
    font-size: 24px;
    font-weight: 700;
    color: #2C3E50;
}

.price-original {
    font-size: 16px;
    color: #95A5A6;
    text-decoration: line-through;
}

.price-discount {
    font-size: 12px;
    color: #E74C3C;
    font-weight: 700;
    background: rgba(231, 76, 60, 0.1);
    padding: 3px 8px;
    border-radius: 12px;
}

/* Add to Cart Button */
.add-to-cart-btn {
    width: 100%;
    padding: 12px;
    background: #2C3E50;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.add-to-cart-btn:hover {
    background: #E8C547;
    color: #2C3E50;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(232, 197, 71, 0.4);
}

.add-to-cart-btn i {
    font-size: 16px;
}

/* Color Variants */
.product-colors {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.color-option {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.color-option:hover {
    transform: scale(1.15);
    border-color: #2C3E50;
}

.color-option.active {
    border-color: #E8C547;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #E8C547;
}

/* Size Options */
.product-sizes {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.size-option {
    padding: 4px 10px;
    border: 1.5px solid #E0E0E0;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #2C3E50;
}

.size-option:hover {
    border-color: #E8C547;
    background: #FFF9E6;
}

.size-option.active {
    border-color: #E8C547;
    background: #E8C547;
    color: #2C3E50;
}

/* Stock Status */
.stock-status {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.stock-status.in-stock {
    color: #27AE60;
}

.stock-status.low-stock {
    color: #F39C12;
}

.stock-status.out-of-stock {
    color: #E74C3C;
}

.stock-status i {
    font-size: 10px;
}

/* ========================================
   3. PRODUCT GRID LAYOUTS
   ======================================== */

.products-grid {
    display: grid;
    /* Slightly larger minimum column width to give product cards room for title, price and actions */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 34px; /* increase vertical & horizontal spacing between cards */
    margin: 42px 0;
    width: 100%;
    overflow: visible;
}

/* 2 Column Grid */
.products-grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

/* 3 Column Grid */
.products-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* 4 Column Grid */
.products-grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* 5 Column Grid */
.products-grid-5 {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* ========================================
   4. RESPONSIVE BREAKPOINTS
   ======================================== */

/* Extra Large Screens (4K) */
@media (min-width: 1920px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 30px;
    }
    
    .products-grid-3 {
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
        min-height: 520px; /* give extra vertical room so titles and badges don't crowd */
    
    .products-grid-4 {
        grid-template-columns: repeat(5, 1fr);
        gap: 30px;
    }
    
    .product-info {
        padding: 24px;
    }
    
    .product-title {
        font-size: 17px;
    }
    
    .price-current {
        font-size: 24px;
    }
    
    .add-to-cart-btn {
        padding: 14px;
        font-size: 15px;
    }
}

/* Large Desktops */
@media (min-width: 1400px) and (max-width: 1919px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 28px;
    }
    
    .products-grid-3 {
        grid-template-columns: repeat(4, 1fr);
        gap: 28px;
    }
}

/* Standard Desktops */
@media (min-width: 1200px) and (max-width: 1399px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
    }
    
    .products-grid-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
    
    .product-info {
        padding: 18px;
    }
}

/* Small Desktops & Tablets Landscape */
@media (min-width: 992px) and (max-width: 1199px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .products-grid-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .product-info {
        padding: 16px;
    }
    
    .product-title {
        font-size: 14px;
    }
    
    .price-current {
        font-size: 20px;
    }
}

/* Tablets Portrait */
@media (min-width: 768px) and (max-width: 991px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .products-grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .product-image {
        padding-top: 130%;
    }
    
    .product-info {
        padding: 14px;
        gap: 8px;
    }
    
    .product-badges {
        top: 10px;
        left: 10px;
    }
    
    .badge {
        padding: 5px 10px;
        font-size: 10px;
    }
    
    .product-actions {
        top: 10px;
        right: 10px;
        gap: 6px;
    }
    
    .action-btn {
        width: 36px;
        height: 36px;
    }
    
    .product-title {
        font-size: 13px;
        min-height: 36px;
    }
    
    .product-rating {
        margin: 2px 0;
    }
    
    .stars i {
        font-size: 11px;
    }
    
    .rating-count {
        font-size: 11px;
    }
    
    .price-current {
        font-size: 18px;
    }
    
    .price-original {
        font-size: 14px;
    }
    
    .add-to-cart-btn {
        padding: 10px;
        font-size: 13px;
        margin-top: 10px;
    }
}

/* Mobile Landscape & Large Phones */
@media (min-width: 576px) and (max-width: 767px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .products-grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .product-card {
        border-radius: 10px;
    }
    
    .product-image {
        padding-top: 140%;
    }
    
    .product-info {
        padding: 12px;
        gap: 6px;
    }
    
    .product-badges {
        top: 8px;
        left: 8px;
        gap: 6px;
    }
    
    .badge {
        padding: 4px 8px;
        font-size: 9px;
    }
    
    .product-actions {
        display: flex;
        opacity: 1;
        transform: translateX(0);
        top: 8px;
        right: 8px;
        gap: 6px;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .quick-view {
        font-size: 11px;
        padding: 10px;
    }
    
    .product-meta {
        margin-bottom: 2px;
    }
    
    .product-category,
    .product-brand {
        font-size: 10px;
    }
    
    .product-title {
        font-size: 13px;
        min-height: 36px;
        -webkit-line-clamp: 2;
    }
    
    .product-rating {
        margin: 2px 0;
    }
    
    .stars i {
        font-size: 10px;
    }
    
    .rating-count {
        font-size: 10px;
    }
    
    .price-current {
        font-size: 16px;
    }
    
    .price-original {
        font-size: 13px;
    }
    
    .price-discount {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .add-to-cart-btn {
        padding: 8px;
        font-size: 12px;
        margin-top: 8px;
        border-radius: 6px;
    }
    
    .product-colors,
    .product-sizes {
        margin-top: 6px;
        gap: 4px;
    }
    
    .color-option {
        width: 20px;
        height: 20px;
    }
    
    .size-option {
        padding: 3px 8px;
        font-size: 10px;
    }
}

/* Small Mobile */
@media (max-width: 575px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .products-grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .product-card {
        border-radius: 8px;
        min-height: 420px;
    }
    
    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    }
    
    .product-image {
        padding-top: 145%;
    }
    
    .product-info {
        padding: 10px;
        gap: 5px;
    }
    
    .product-badges {
        top: 6px;
        left: 6px;
        gap: 4px;
    }
    
    .badge {
        padding: 3px 6px;
        font-size: 8px;
    }
    
    .product-actions {
        display: flex;
        opacity: 1;
        transform: translateX(0);
        top: 6px;
        right: 6px;
        gap: 4px;
    }
    
    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .quick-view {
        font-size: 10px;
        padding: 8px;
        letter-spacing: 0.5px;
    }
    
    .product-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        margin-bottom: 2px;
    }
    
    .product-category,
    .product-brand {
        font-size: 9px;
    }
    
    .product-title {
        font-size: 12px;
        min-height: 32px;
        -webkit-line-clamp: 2;
    }
    
    .product-rating {
        margin: 2px 0;
        gap: 4px;
    }
    
    .stars {
        gap: 1px;
    }
    
    .stars i {
        font-size: 9px;
    }
    
    .rating-count {
        font-size: 9px;
    }
    
    .product-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .price-current {
        font-size: 15px;
    }
    
    .price-original {
        font-size: 12px;
    }
    
    .price-discount {
        font-size: 9px;
        padding: 2px 5px;
    }
    
    .add-to-cart-btn {
        padding: 7px;
        font-size: 11px;
        margin-top: 6px;
        border-radius: 6px;
        gap: 4px;
    }
    
    .add-to-cart-btn i {
        font-size: 12px;
    }
    
    .product-colors,
    .product-sizes {
        display: none;
    }
    
    .stock-status {
        font-size: 10px;
        margin-top: 4px;
    }
}

/* Extra Small Mobile (320px) */
@media (max-width: 375px) {
    .products-grid {
        gap: 10px;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .product-title {
        font-size: 11px;
        min-height: 30px;
    }
    
    .price-current {
        font-size: 14px;
    }
    
    .add-to-cart-btn {
        padding: 6px;
        font-size: 10px;
    }
}

/* ========================================
   5. SPECIAL CARD VARIATIONS
   ======================================== */

/* Horizontal Card (List View) */
.product-card.horizontal {
    flex-direction: row;
    max-width: 100%;
}

.product-card.horizontal .product-image {
    width: 300px;
    padding-top: 0;
    min-height: 300px;
}

.product-card.horizontal .product-info {
    flex: 1;
    padding: 30px;
}

@media (max-width: 768px) {
    .product-card.horizontal {
        flex-direction: column;
    }
    
    .product-card.horizontal .product-image {
        width: 100%;
        padding-top: 120%;
        min-height: 0;
    }
    
    .product-card.horizontal .product-info {
        padding: 16px;
    }
}

/* Featured/Large Card */
.product-card.featured {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .product-card.featured {
        grid-column: span 1;
    }
}
