.profile-header {
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
}

.profile-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 300;
}

.profile-subtitle {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.customer-id {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
}

.customer-status {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
}

.customer-status.active {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.customer-status.inactive {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.profile-stats {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.ocasiones-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    padding: 10px 0;
    color: #5f6368;
}



.ocasion-filter-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 6px;
    cursor: pointer;
}

.ocasion-filter-link:hover {
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
    border-color: #667eea;
}

.ocasion-filter-link.active .ocasion-filter {
    color: white;
    background-color: #667eea;
}

.ocasion-filter-link.active .ocasion-name {
    color: white;
}

.ocasion-filter-link.active .ocasion-count {
    color: rgba(255, 255, 255, 0.8);
}

.ocasion-filter {
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ocasion-filter:hover {
    background: #e8eaed;
    border-color: #dadce0;
}

.ocasion-name {
    color: #5f6368;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ocasion-count {
    color: #9aa0a6;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 8px;
    /*overflow: hidden;*/
    cursor: pointer;
}

.stat-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.stat-card-link.active .stat-card {
    color: white;
    background-color: #667eea;
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-card-link.active .stat-number {
    color: white;
}

.stat-card-link.active .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.stat-card {
    background: #f8f9fa;
    padding: 15px 12px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
    min-width: 120px;
    flex-shrink: 0;
}

.stat-card:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.stat-number {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 12px;
}

.saved-products-section {
    margin-top: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.edit-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(102, 126, 234, 0.1);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.3);
    font-size: 14px;
    color: #667eea;
}

.edit-icon {
    font-size: 16px;
}

.edit-text {
    font-weight: 500;
}

.section-title {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.customer-code-display {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    margin: 0 0 24px;
    background: #ffffff;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(126, 126, 126, 0.15);
    transition: box-shadow 0.3s ease;
    border-radius: 6px;
}

.customer-code-display:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
}

.customer-code-display .code-label {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.customer-code-display .code-value {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    background: #f4f4f4;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 15px;
    letter-spacing: 0.5px;
}

.customer-code-display .mgm-info-link {
    text-decoration: underline;
}

.customer-code-display .mgm-info-link:hover {
    background: #667eea;
    color: white;
    text-decoration: none;
}

.view-all-btn {
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
}

.view-all-btn:hover {
    background: #5a6fd8;
    color: white;
    text-decoration: none;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.product-card {
    background: #fafafa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border-color: #667eea;
}

/* Order Number Bubble */
.order-number-bubble {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #00719d92;
    color: white;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 113, 157, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    line-height: 1;
}

.order-number-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 113, 157, 0.5);
}

/* Drag and Drop Styles */
.sortable-grid {
    cursor: grab;
    /* Prevent text selection on iOS */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.sortable-grid:active {
    cursor: grabbing;
}

.sortable-item {
    cursor: grab;
    transition: all 0.2s ease;
    /* Prevent text selection and magnifier on iOS */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.sortable-item:active {
    cursor: grabbing;
}

.sortable-item.dragging {
    opacity: 0.8;
    transform: rotate(8deg) scale(1.05);
    z-index: 100;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    transition: none;
    cursor: grabbing;
}

.sortable-item.drag-over {
    border: 3px dashed #667eea !important;
    background-color: rgba(102, 126, 234, 0.15);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.2s ease;
}

/* Visual indicator for draggable items */
.sortable-item::before {
    content: '⋮⋮';
    position: absolute;
    top: 10px;
    right: 10px;
    color: #667eea;
    font-size: 18px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.sortable-item::after {
    content: attr(data-drag-text);
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(134, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 100;
    transform: translateY(10px);
}

.sortable-item:hover::before {
    opacity: 1;
    transform: scale(1.2);
}

.sortable-item:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.sortable-item:active::before {
    opacity: 0;
}

.sortable-item:active::after {
    opacity: 0;
}

/* Hover effect for sortable items */
.sortable-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Pulse animation for draggable items */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.sortable-item:hover {
    animation: pulse 2s infinite;
}

.sortable-item.dragging {
    animation: none;
}

.product-image {
    height: 180px;
    object-fit: cover;
    object-position: center;
    background: #f8f9fa;
    display: block;
    border-radius: 8px 8px 0 0;
    min-height: 120px;
    margin: 12px auto;
}

.product-image:not([src]), 
.product-image[src=""] {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    font-weight: 500;
}

.product-image:not([src])::after, 
.product-image[src=""]::after {
    content: '🖼️';
    font-size: 24px;
}

.product-info {
    padding: 15px;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    flex: 1;
    margin-right: 10px;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
    flex-shrink: 0;
}

.product-preferences {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.preference-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    background: #00719d;
    color: white;
}
/*
.preference-favorite {
}

.preference-owns {
}

.preference-wants {
}
*/

.product-date {
    font-size: 12px;
    color: #666;
}

.product-comments {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

/* Modal Styles */
.saved-products-modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 1200px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 24px;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

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

.message.error {
    padding: 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    text-align: center;
    margin: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-card {
        min-height: 180px;
    }
    
    .product-image {
        height: 110px;
        object-fit: cover;
        object-position: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .profile-stats {
        gap: 10px;
    }
    
    .stat-card {
        min-width: 100px;
        padding: 12px 8px;
    }
    
    .stat-number {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .ocasiones-filters {
        gap: 6px;
        padding: 8px 0;
    }
    
    .ocasion-filter {
        padding: 6px 10px;
        min-width: 80px;
    }
    
    .order-number-bubble {
        width: 30px;
        height: 30px;
        font-size: 13px;
        top: 8px;
        left: 8px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .customer-code-display {
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px 20px;
        margin: 20px 0;
    }
    
    .customer-code-display .mgm-info-link {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .profile-stats {
        gap: 8px;
    }
    
    .stat-card {
        min-width: 80px;
        padding: 10px 6px;
    }
    
    .stat-number {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .ocasiones-filters {
        gap: 4px;
        padding: 6px 0;
    }
    
    .ocasion-filter {
        padding: 5px 8px;
        min-width: 70px;
    }
    
    .order-number-bubble {
        width: 28px;
        height: 28px;
        font-size: 12px;
        top: 8px;
        left: 8px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-card {
        min-height: 160px;
    }
    
    .product-image {
        height: 90px;
        object-fit: cover;
        object-position: center;
        margin: 12px auto;
    }
    
    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .product-name {
        font-size: 12px;
        line-height: 1.3;
        margin-right: 0;
    }
    
    .product-price {
        font-size: 14px;
    }
    
    .user-profile-container {
        padding: 10px;
    }
    
    .profile-header {
        padding: 20px;
    }
    
    .profile-header h1 {
        font-size: 24px;
    }
}

.product-card-inner {
    height: 97%;
    border-radius: 6px;
    border: 1px solid #e6e6f4;
    margin: 4px;
    background-color: white;
  }