* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

section h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 15px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

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

.product-card {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.product-card.compact {
    padding: 15px;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.product-card h3 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.25rem;
}

.product-info {
    margin-bottom: 15px;
}

.product-info div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #4a5568;
}

.price {
    font-weight: 600;
    color: #38a169;
}

.inventory {
    font-weight: 600;
}

.inventory.low-stock {
    color: #e53e3e;
}

.inventory.out-of-stock {
    color: #e53e3e;
    font-weight: 700;
}

.sell-button {
    width: 100%;
    margin-top: 10px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.sell-button:disabled {
    background: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sell-button:disabled:hover {
    transform: none;
    box-shadow: none;
}

.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.edit-button, .delete-button {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.edit-button {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.edit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.4);
}

.delete-button {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.delete-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 101, 101, 0.4);
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h3 {
    color: #2d3748;
    margin-bottom: 25px;
    font-size: 1.5rem;
    text-align: center;
}

.modal-content .form-group {
    margin-bottom: 20px;
}

.modal-content label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 600;
}

.modal-content input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.modal-content input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-buttons {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.form-buttons button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-buttons button[type="submit"] {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.form-buttons button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.form-buttons button[type="button"] {
    background: #e2e8f0;
    color: #4a5568;
}

.form-buttons button[type="button"]:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.edit-sizes-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.edit-size-group {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.edit-size-group h4 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 1rem;
    text-align: center;
    font-weight: 600;
}

.edit-size-group input {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    transition: border-color 0.3s ease;
}

.edit-size-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.edit-size-note {
    font-size: 0.85rem;
    color: #718096;
    text-align: center;
    margin: 0;
    font-style: italic;
}

@media (max-width: 600px) {
    .edit-sizes-container {
        grid-template-columns: 1fr;
    }
}

.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-preview {
    min-height: 80px;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    position: relative;
}

.image-preview:empty::before {
    content: "No image selected";
    color: #a0aec0;
    font-style: italic;
}

.preview-image {
    max-width: 100%;
    max-height: 120px;
    border-radius: 6px;
    object-fit: contain;
}

.product-image {
    width: 100%;
    height: 150px;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.remove-image-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 5px;
}

.remove-image-btn:hover {
    background: #c53030;
    transform: translateY(-1px);
}

input[type="file"] {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
}

input[type="file"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

@media (max-width: 768px) {
    .product-image {
        height: 120px;
    }
    
    .preview-image {
        max-height: 100px;
    }
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4a5568;
    font-weight: 500;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.sizes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.size-group {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.size-group h4 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 1rem;
    text-align: center;
    font-weight: 600;
}

.size-group input {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.size-note {
    font-size: 0.85rem;
    color: #718096;
    text-align: center;
    margin: 0;
    font-style: italic;
}

.sized-product {
    min-height: auto;
}

.print-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    margin-left: 8px;
}

.sizes-list {
    margin-top: 15px;
}

.size-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.size-row:last-child {
    border-bottom: none;
}

.size-info {
    display: flex;
    gap: 15px;
    align-items: center;
    flex: 1;
}

.size-label {
    font-weight: 600;
    color: #2d3748;
    min-width: 50px;
}

.size-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.size-sell-button {
    padding: 6px 12px;
    font-size: 0.85rem;
    margin: 0;
    min-width: 60px;
}

.size-undo-button {
    padding: 6px 8px;
    font-size: 0.85rem;
    min-width: 30px;
}

@media (max-width: 768px) {
    .sizes-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .size-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .size-info {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .size-buttons {
        justify-content: center;
    }
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.summary-header h2 {
    margin-bottom: 0;
}

.summary-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.reset-sales-button {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-sales-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.4);
}

.undo-last-button {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.undo-last-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(160, 174, 192, 0.4);
}

.product-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.product-buttons .sell-button {
    flex: 1;
    margin-top: 0;
}

.undo-button {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.undo-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(160, 174, 192, 0.4);
}

.product-stats {
    margin-bottom: 15px;
    text-align: center;
}

.sold-count {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
}

.product-actions-grid {
    display: grid;
    gap: 8px;
    align-items: start;
}

.product-actions-grid.single-product {
    grid-template-columns: 1fr;
}

.product-actions-grid.sizes-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.sell-button-compact.full-width {
    grid-column: span 1;
}

.sell-button-compact {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    min-height: 80px;
    justify-content: center;
}

.sell-button-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.sell-button-compact:disabled {
    background: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sell-button-compact:disabled:hover {
    transform: none;
    box-shadow: none;
}

.sell-button-compact.size-variant {
    min-height: 90px;
    gap: 3px;
}

.sell-label {
    font-weight: 700;
    font-size: 1rem;
}

.price-info {
    font-weight: 600;
    font-size: 1.1rem;
}

.stock-info {
    font-size: 0.8rem;
    opacity: 0.9;
}

.stock-info.low-stock {
    color: #ffd700;
    font-weight: 600;
}

.stock-info.out-of-stock {
    color: #ff6b6b;
    font-weight: 700;
}

.sold-info {
    font-size: 0.75rem;
    opacity: 0.8;
}


@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .product-actions-grid.sizes-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .sell-button-compact {
        min-height: 70px;
        font-size: 0.85rem;
        padding: 10px;
    }
    
    .sell-button-compact.size-variant {
        min-height: 75px;
    }
    
    .summary-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .summary-header h2 {
        font-size: 1.3rem;
    }
    
    .summary-buttons {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .undo-last-button,
    .reset-sales-button {
        width: 100%;
    }
    
    .product-buttons {
        flex-direction: column;
    }
    
    .undo-button {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.plus-button {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border: none;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.plus-button:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.plus-button:active {
    transform: translateY(-1px) scale(1.05);
}

.cat-emoji-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-emoji-button:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.cat-emoji-button:active {
    transform: translateY(-1px) scale(1.05);
}

.dancing-cat {
    position: fixed;
    width: 80px;
    height: 80px;
    z-index: 999;
    pointer-events: none;
}

.dancing-cat img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    section {
        padding: 20px;
    }
    
    .plus-button {
        width: 45px;
        height: 45px;
        font-size: 24px;
        bottom: 70px;
        right: 15px;
    }
    
    .cat-emoji-button {
        width: 45px;
        height: 45px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }
}