/* Fix Alignment for Product Cards */
.card.h-100 {
    border: 1px solid #ebedef;
    transition: transform 0.2s;
}

.card.h-100:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Force image to fixed height so cards align */
.card-img-top {
    height: 250px;       /* Fixed height for all images */
    width: 100%;         /* Full width of the card */
    object-fit: contain; /* Ensures the whole shoe is visible without cropping */
    padding: 15px;       /* Adds some breathing room inside the card */
    background-color: #fff;
}

/* Ensure the card body fills remaining space */
.card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Prevent long titles from breaking layout */
.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    min-height: 40px; /* Reserve space for 2 lines of text */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   Product Action Buttons (Wishlist & Compare)
   ======================================== */

.product-action-buttons {
    flex-shrink: 0;
}

.product-action-buttons .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #666;
}

.product-action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-action-buttons .btn .icon {
    width: 18px;
    height: 18px;
    margin-right: 6px;
}

.product-action-buttons .btn .btn-label {
    white-space: nowrap;
}

/* Wishlist Button */
.btn-wishlist {
    color: #e74c3c;
    border-color: #e74c3c;
}

.btn-wishlist:hover {
    background: #fff5f5;
    border-color: #c0392b;
}

.btn-wishlist.active,
.btn-wishlist.wished {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

.btn-wishlist.active:hover,
.btn-wishlist.wished:hover {
    background: #c0392b;
}

.btn-wishlist .icon use.wished {
    fill: currentColor;
}

.btn-wishlist .icon use.not-wished {
    fill: none;
}

/* Compare Button */
.btn-compare {
    color: #3498db;
    border-color: #3498db;
}

.btn-compare:hover {
    background: #f0f8ff;
    border-color: #2980b9;
}

.btn-compare.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.btn-compare.active:hover {
    background: #2980b9;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .product-action-buttons .btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .product-action-buttons .btn .btn-label {
        display: none;
    }

    .product-action-buttons .btn .icon {
        margin-right: 0;
    }
}

/* ========================================
   Compare Floating Widget
   ======================================== */

.compare-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 1050;
    max-width: 350px;
    min-width: 300px;
    overflow: hidden;
    display: none;
}

.compare-widget.show {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.compare-widget-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare-widget-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.compare-widget-header .compare-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.compare-widget-body {
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.compare-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fafafa;
}

.compare-item:last-child {
    margin-bottom: 0;
}

.compare-item-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
    margin-right: 10px;
}

.compare-item-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compare-item-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.compare-item-remove:hover {
    background: #fee;
    color: #e74c3c;
}

.compare-widget-footer {
    padding: 12px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
}

.compare-widget-footer .btn {
    flex: 1;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
}

.compare-widget-footer .btn-primary {
    background: #3498db;
    color: #fff;
    border: none;
}

.compare-widget-footer .btn-primary:hover {
    background: #2980b9;
}

.compare-widget-footer .btn-outline {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.compare-widget-footer .btn-outline:hover {
    background: #f5f5f5;
}

/* Compare Page Styles */
.compare-page-container {
    padding: 30px 0;
}

.compare-table-wrapper {
    overflow-x: auto;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-radius: 12px;
    overflow: hidden;
}

.compare-table th,
.compare-table td {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.compare-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    min-width: 200px;
}

.compare-table th:first-child {
    text-align: left;
    background: #fff;
    font-weight: 500;
    color: #666;
    min-width: 150px;
}

.compare-table tbody tr:hover {
    background: #fafafa;
}

.compare-product-image {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 12px;
}

.compare-product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.compare-product-name a {
    color: #333;
    text-decoration: none;
}

.compare-product-name a:hover {
    color: #3498db;
}

.compare-remove-btn {
    background: #fee;
    color: #e74c3c;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.compare-remove-btn:hover {
    background: #e74c3c;
    color: #fff;
}

.compare-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.compare-empty-state img {
    max-width: 200px;
    margin-bottom: 20px;
}

.compare-empty-state h3 {
    color: #333;
    margin-bottom: 10px;
}

.compare-empty-state p {
    color: #666;
    margin-bottom: 20px;
}

/* Compare Button on Product Cards */
.compare-card-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 0;
}

.compare-card-btn .icon {
    width: 18px;
    height: 18px;
    stroke: #3498db;
}

.compare-card-btn:hover {
    background: #3498db;
    border-color: #3498db;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.compare-card-btn:hover .icon {
    stroke: #fff;
}

.compare-card-btn.active {
    background: #3498db;
    border-color: #3498db;
}

.compare-card-btn.active .icon {
    stroke: #fff;
}

.compare-btn-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover .compare-btn-overlay,
.card.h-100:hover .compare-btn-overlay {
    opacity: 1;
}

.compare-card-btn.active.compare-btn-overlay {
    opacity: 1;
}

/* Adjust card image container for overlay button */
.card .card-img-container {
    position: relative;
}

/* Compare icon in navbar (optional) */
.compare-nav-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 8px;
    color: #333;
    cursor: pointer;
}

.compare-nav-icon .compare-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #3498db;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* ========================================
   Wishlist Icon in Navbar
   ======================================== */

/* Ensure wishlist icon shows when not hidden */
.navbar .wishlist-icon {
    position: relative;
}

.navbar .wishlist-icon .nav-link {
    position: relative;
    padding: 0.5rem;
}

.navbar .wishlist-icon .icon {
    color: #e74c3c;
    fill: none;
    stroke: currentColor;
}

.navbar .wishlist-icon:hover .icon {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Badge styling - wishlist (compact circle) */
.navbar .wishlist-icon .shopping-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 14px;
    height: 14px;
    font-size: 9px;
    font-weight: 600;
    line-height: 14px;
    padding: 0 3px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
}

/* Cart badge - pill shape to fit count + total */
.navbar .cart-icon .shopping-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    min-width: auto;
    height: auto;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    padding: 3px 8px;
    border-radius: 12px;
    background: #e74c3c;
    color: #fff;
    white-space: nowrap;
}

/* Animation when item added */
.navbar .wishlist-icon.cart-animate {
    animation: heartBeat 0.5s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
