.form-actions {
    display: flex;
    justify-content: flex-start;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.btn-form-cancel {
    background-color: #6c757d;
    color: white;
}

.btn-form-cancel:hover {
    background-color: #5a6268;
}

.edit-mode-indicator {
    display: none;
    background-color: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-md);
    font-weight: bold;
}

.edit-mode-indicator.active {
    display: flex;
    align-items: center;
}

.edit-mode-indicator i {
    margin-right: 8px;
}

.address-icon, .card-icon {
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* Enhance item cards with better visuals */
.item-card {
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    background: white;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.item-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-hover);
}

.item-card-header {
    display: flex;
    align-items: center;
    margin-bottom: var (--spacing-sm);
}

.item-card-header i {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-right: var(--spacing-sm);
}

.item-card-header h4 {
    margin: 0;
    font-size: 1.2rem;
    flex-grow: 1;
}

.default-badge {
    background-color: var(--primary-light);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: var (--border-radius-sm);
    margin-left: var(--spacing-sm);
    vertical-align: middle;
}

.item-card-content {
    flex-grow: 1;
    margin-bottom: var(--spacing-md);
}

.item-card-content p {
    margin: var (--spacing-xs) 0;
    line-height: 1.5;
}

.item-card-content .text-muted {
    color: var(--text-light);
    font-size: 0.85rem;
}

.item-card-content i {
    width: 16px;
    margin-right: var(--spacing-xs);
    color: var(--text-light);
}

/* Animation for item card actions */
@keyframes itemHighlight {
    0% { box-shadow: 0 0 0 2px var(--primary-light); }
    50% { box-shadow: 0 0 0 4px var(--primary-light); }
    100% { box-shadow: 0 0 0 2px var(--primary-light); }
}

.item-card.highlight {
    animation: itemHighlight 1s ease;
}

/* Improved card display */
.item-card-content {
    position: relative;
}

.credit-card-card::after {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 25px;
    background: linear-gradient(135deg, #e8e8e8 0%, #f5f5f5 100%); /* Subtle light gray */
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Badge styles */
.item-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 5px;
}

.badge-primary {
    background-color: var(--primary-light);
    color: white;
}

.badge-success {
    background-color: var(--secondary-color);
    color: white;
}

/* Animation for adding/updating items */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.new-item {
    animation: slideDown 0.5s ease forwards;
}

/* Visual feedback for delete button */
.btn-danger {
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background-color: var(--danger-hover);
    transform: scale(1.05);
}

/* Form transition improvement */
.collapsible-form.open {
    animation: fadeIn 0.4s ease;
    border: 1px solid var(--primary-light);
    box-shadow: 0 0 10px rgba(74, 111, 165, 0.2);
}

/* Focus styles for form fields */
.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
    outline: none;
}

/* Empty state improvements */
.empty-state {
    transition: all 0.3s ease;
}

.empty-state:hover {
    background-color: rgba(0, 0, 0, 0.03);
    transform: translateY(-2px);
}

.btn-xs {
    padding: 2px 5px;
    font-size: 0.7rem;
    border-radius: 3px;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-xs:hover {
    background-color: var(--primary-light);
    color: white;
    border-color: var (--primary-light);
}

.form-success-indicator {
    display: flex;
    align-items: center;
    background-color: var(--success-bg);
    color: var(--success-text);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    margin-top: 10px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.form-success-indicator i {
    margin-right: 8px;
    color: var(--secondary-color);
}

/* Improved style for edit mode indicator */
.edit-mode-indicator.active {
    display: flex;
    align-items: center;
    background-color: var(--warning-bg);
    border-left: 4px solid var(--warning-color);
    padding: 10px 15px;
    animation: fadeIn 0.3s ease;
}

/* Enhanced toggle buttons */
.toggle-form-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 8px 15px;
}

.toggle-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.toggle-form-btn.active {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #263a59 100%);
}

/* Loading indicator styling */
.loading-indicator-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#profile-container {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#profile-container h2 {
    color: var(--primary-dark);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: var(--spacing-sm);
    display: inline-block;
}

#profile-container p {
    margin: 12px 0;
    font-size: 17px;
    line-height: 1.6;
}

#profile-container p strong {
    color: var(--primary-dark);
    margin-right: 8px;
    font-weight: 600;
}

/* ─── CREDIT CARD OVERRIDES ────────────────────────────────────────────────── */
/* Match address-card defaults exactly and override any conflicting later rules */
.credit-card-card {
    background-color: var(--card-bg) !important;
    color:            var(--text-color) !important;
    box-shadow:       0 2px 4px rgba(0,0,0,0.05) !important;
    border:           1px solid var(--border-color) !important;
    transition:       transform 0.2s ease, box-shadow 0.2s ease !important;
}
.credit-card-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}

.credit-card-card .item-card-header h4,
.credit-card-card .item-card-content p,
.credit-card-card .card-detail-text {
    color:        var(--text-color) !important;
    text-shadow:  none           !important;
}

.credit-card-card .item-actions button {
    background-color: var(--body-bg)       !important;
    color:            var(--text-color)    !important;
    border:           1px solid var(--border-color) !important;
    box-shadow:       0 2px 4px rgba(0,0,0,0.05) !important;
    text-shadow:      none !important;
    font-weight:      500  !important;
}
.credit-card-card .item-actions button:hover {
    background-color: #e9ecef !important;
    box-shadow:       0 4px 8px rgba(0,0,0,0.1) !important;
}

.credit-card-card::after {
    display: none !important;
}
/* ─────────────────────────────────────────────────────────────────────────── */

/* Fix credit card styling issues */
.credit-card-card {
    position: relative;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
}

/* Ensure card content text is visible */
.credit-card-card .card-detail-text,
.credit-card-card .item-card-content p,
.credit-card-card .item-card-header h4 {
    color: var(--text-color) !important;
    font-weight: normal !important;
    text-shadow: none !important;
}

.credit-card-card .item-card-header h4 {
    font-weight: 600 !important;
    color: var (--primary-dark) !important;
}

/* Make credit card button text visible */
.credit-card-card .item-actions button {
    color: white !important;
    background-color: #6c757d !important;
    border: 1px solid #6c757d !important;
    text-shadow: none !important;
    font-weight: 500 !important;
}

.credit-card-card .item-actions button.btn-danger {
    background-color: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
}

/* Set default button color */
.btn-xs.set-default-btn {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border-color: #d3d9df !important;
}

/* Fix for infinite image loading issue */
img[src$="undefined"], 
img[src$="null"] {
    display: none !important;
}

/* Improve performance for image loading */
img {
    transition: transform 0.3s ease !important; /* Simplify transition for better performance */
}

/* Ensure default badge has proper styling */
.item-badge {
    background-color: var(--primary-light) !important;
    color: white !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    margin-left: 8px !important;
    display: inline-block !important;
}

/* Fix conflicting background/color rules for form input fields */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    background-color: white !important;
    color: var(--text-color) !important;
}

/* Hero Section */
.hero-section {
    margin-bottom: 3rem;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius-lg);
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(74, 111, 165, 0.03) 0%, transparent 70%);
    animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(1deg); }
    66% { transform: translate(-20px, 20px) rotate(-1deg); }
}

.main-header {
    margin-bottom: 2.5rem;
    padding: 0;
    position: relative;
    z-index: 2;
}

.main-header h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.main-header .subtitle {
    font-size: 1.4rem;
    color: var(--text-light);
    margin-bottom: 0;
    font-weight: 400;
    line-height: 1.4;
    max-width: 600px;
    margin: 0 auto;
}

/* Enhanced Search Section */
.search-section {
    margin: 3rem auto;
    max-width: 900px;
    position: relative;
    z-index: 2;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-input-wrapper {
    display: flex;
    position: relative;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    background: white;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 8px 32px rgba(74, 111, 165, 0.2);
    transform: translateY(-2px);
}

#search-term {
    flex-grow: 1;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    border: none;
    background: white;
    color: var(--text-color);
    transition: all 0.3s ease;
}

#search-term::placeholder {
    color: var(--text-light);
    font-style: italic;
}

#search-term:focus {
    outline: none;
    background: #fafbfc;
}

.search-button {
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center; /* Center the text without icon */
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 140px;
}

.search-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
}

.search-button:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #2c4a6b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(74, 111, 165, 0.3);
}

.search-button:hover::before {
    left: 100%;
}

.search-button:active {
    transform: translateY(0);
}

/* Remove the search icon completely */
.search-icon {
    display: none !important;
}

/* Enhanced Search Info */
.search-info {
    background: linear-gradient(135deg, var(--warning-bg) 0%, #fff8e1 100%);
    border: 1px solid var(--warning-border);
    border-left: 4px solid var(--warning-color);
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius-md);
    color: var(--warning-text);
    margin-top: 1rem;
    display: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(240, 173, 78, 0.1);
}

.search-info.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Product Grid Section */
.products-section {
    margin-top: 4rem;
    position: relative;
}

.products-section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.products-section-header h2 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

.products-section-header .section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Enhanced Loading Skeleton */
.loading-skeleton {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    width: 100%;
    margin-top: 2rem;
}

.skeleton {
    animation: pulse 2s ease-in-out infinite;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.skeleton-image {
    height: 240px;
    background: linear-gradient(110deg, #f0f0f0 8%, #f8f8f8 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    margin-bottom: 15px;
}

.skeleton-title {
    height: 28px;
    width: 85%;
    background: linear-gradient(110deg, #f0f0f0 8%, #f8f8f8 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    border-radius: 6px;
    margin: 0 20px 15px;
}

.skeleton-desc {
    height: 70px;
    background: linear-gradient(110deg, #f0f0f0 8%, #f8f8f8 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    border-radius: 6px;
    margin: 0 20px 20px;
}

.skeleton-price {
    height: 24px;
    width: 45%;
    background: linear-gradient(110deg, #f0f0f0 8%, #f8f8f8 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    border-radius: 6px;
    margin: 0 20px 15px;
}

.skeleton-stock {
    height: 20px;
    width: 65%;
    background: linear-gradient(110deg, #f0f0f0 8%, #f8f8f8 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    border-radius: 6px;
    margin: 0 20px 20px;
}

.skeleton-button {
    height: 48px;
    background: linear-gradient(110deg, #f0f0f0 8%, #f8f8f8 18%, #f0f0f0 33%);
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    border-radius: var(--border-radius-md);
    margin: 0 20px 20px;
}

@keyframes shimmer {
    to {
        background-position-x: -200%;
    }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Enhanced No Products Message */
.no-products-message {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius-lg);
    border: 2px dashed var(--border-color);
    color: var(--text-light);
    font-size: 1.2rem;
    margin: 3rem 0;
    position: relative;
    overflow: hidden;
}

.no-products-message::before {
    content: '🔍';
    display: block;
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.no-products-message h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.no-products-message p {
    margin: 0;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

/* Enhanced Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 3rem;
    padding: 0 10px;
}

/* Hide overlay icons completely */
.overlay-icons,
.product-card .overlay-icons,
.image-container .overlay-icons,
.product-card-image .overlay-icons {
    display: none !important;
}

/* Hide quick view and other overlay elements */
.quick-view-icon,
.overlay-icon,
.product-overlay,
.card-overlay,
.hover-overlay {
    display: none !important;
}

/* Ensure no overlay elements appear on hover */
.product-card:hover .overlay-icons,
.product-card:hover .quick-view-icon,
.product-card:hover .overlay-icon,
.image-container:hover .overlay-icons {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Remove any positioned overlay containers */
.product-card .image-container::after,
.product-card .image-container::before,
.product-card-image::after,
.product-card-image::before {
    display: none !important;
}

/* Clean up product card image containers */
.product-card .image-container,
.product-card-image {
    position: relative;
    overflow: hidden;
}

/* Ensure clean product card layout without overlays */
.product-card img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    padding: 10px;
    background-color: #f8f8f8;
    transition: transform 0.3s ease;
    display: block;
}

/* Responsive Adjustments for Main Page */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 1.5rem;
        margin-bottom: 2rem;
    }
    
    .main-header h1 {
        font-size: 2.5rem;
    }
    
    .main-header .subtitle {
        font-size: 1.1rem;
    }
    
    .search-input-wrapper {
        flex-direction: column;
        box-shadow: none;
    }
    
    #search-term {
        border-radius: var(--border-radius-md);
        margin-bottom: 1rem;
        border: 2px solid var(--border-color);
    }
    
    .search-button {
        border-radius: var(--border-radius-md);
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
        gap: 0; /* Remove gap since no icon */
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
        padding: 0;
    }
    
    .loading-skeleton {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .main-header h1 {
        font-size: 2rem;
    }
    
    .main-header .subtitle {
        font-size: 1rem;
    }
    
    .search-section {
        margin: 2rem auto;
    }
    
    .product-grid,
    .loading-skeleton {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .no-products-message {
        padding: 3rem 1rem;
    }
}

/* Page transition effects */
.main-content {
    animation: fadeInUp 0.6s ease-out;
}

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