/**
 * Product Card Component Styles
 * Used across Homepage, Product List, Related Products, etc.
 */

.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.product-image-wrapper {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 1 / 1;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e74c3c;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 12px;
    z-index: 2;
}

.out-of-stock-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 3;
}

.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    gap: 8px;
    padding: 12px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.product-card:hover .product-overlay {
    transform: translateY(0);
}

.product-overlay button {
    flex: 1;
    border: none;
    background: #27ae60;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.product-overlay button:hover {
    background: #229954;
}

.product-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 16px;
}

.product-name {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.product-name a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-name a:hover {
    color: #27ae60;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
}

.stars {
    color: #f39c12;
    font-size: 14px;
    letter-spacing: 2px;
}

.review-count {
    color: #999;
    font-size: 11px;
}

.product-price {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.price {
    font-size: 18px;
    font-weight: bold;
    color: #27ae60;
}

.sale-price {
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
}

.original-price {
    font-size: 12px;
    color: #999;
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.product-actions button,
.product-actions a {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.product-actions .btn-success {
    background: #27ae60;
    color: white;
}

.product-actions .btn-success:hover:not(:disabled) {
    background: #229954;
}

.product-actions .btn-success:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.product-actions .btn-outline-primary {
    background: transparent;
    border: 1px solid #3498db;
    color: #3498db;
}

.product-actions .btn-outline-primary:hover {
    background: #3498db;
    color: white;
}

.product-actions .btn-secondary {
    background: #95a5a6;
    color: white;
    cursor: not-allowed;
}

/* Quick View Modal */
#quickViewModal .modal-gallery {
    margin-bottom: 20px;
}

#quickViewModal .modal-main-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

#quickViewModal .modal-thumbnails {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

#quickViewModal .gallery-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#quickViewModal .gallery-thumb:hover,
#quickViewModal .gallery-thumb.active {
    border-color: #27ae60;
}

#quickViewModal .modal-product-name {
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: bold;
}

#quickViewModal .modal-product-price {
    margin-bottom: 8px;
    color: #27ae60;
}

#quickViewModal .modal-product-original-price {
    margin-bottom: 12px;
    font-size: 14px;
}

#quickViewModal .modal-product-rating {
    margin-bottom: 12px;
    font-size: 14px;
}

#quickViewModal .modal-product-stock {
    margin-bottom: 12px;
}

#quickViewModal .modal-product-description {
    margin-bottom: 16px;
    line-height: 1.6;
    font-size: 14px;
}

#quickViewModal .modal-add-to-cart-btn {
    background: #27ae60;
    border: none;
    color: white;
    font-weight: bold;
}

#quickViewModal .modal-add-to-cart-btn:hover:not(:disabled) {
    background: #229954;
}

#quickViewModal .modal-add-to-cart-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Mini Cart */
.mini-cart-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.mini-cart-item:last-child {
    border-bottom: none;
}

.mini-cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.mini-cart-item .item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mini-cart-item h6 {
    margin: 0 0 4px 0;
    font-size: 13px;
    font-weight: 600;
}

.mini-cart-item .item-price {
    font-size: 12px;
    color: #27ae60;
    font-weight: 600;
}

.mini-cart-item .btn-remove {
    background: #e74c3c;
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.mini-cart-item .btn-remove:hover {
    background: #c0392b;
}

.empty-cart-message {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Toast Notifications */
.alert {
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    .product-card {
        border-radius: 6px;
    }

    .product-overlay {
        padding: 8px;
    }

    .product-overlay button {
        font-size: 11px;
        padding: 6px 10px;
    }

    .product-actions button,
    .product-actions a {
        font-size: 11px;
        padding: 6px 10px;
    }

    #quickViewModal .modal-body .row {
        flex-direction: column;
    }

    #quickViewModal .col-md-6 {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .product-info {
        padding: 12px;
    }

    .product-name {
        font-size: 12px;
    }

    .product-price {
        font-size: 14px;
    }
}
