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

html {
    background: #00a0e2;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #00a0e2 0%, #0078b3 100%);
    min-height: 100vh;
    padding: 16px 16px 100px;
}

.container {
    max-width: 400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

header p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 4px;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

.item:last-child {
    border-bottom: none;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.item-price {
    color: #666;
    font-size: 0.85rem;
    margin-top: 2px;
}

.item-subtotal {
    color: #00a0e2;
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 2px;
    transition: transform 0.15s ease-out;
}

.item-subtotal.animate {
    transform: scale(1.1);
}

.counter {
    display: flex;
    align-items: center;
    gap: 12px;
}

.counter button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.counter button:active {
    transform: scale(0.95);
}

.counter button:focus {
    outline: none;
    border-color: #005a8c;
    box-shadow: 0 0 0 3px rgba(0, 160, 226, 0.3);
}

.counter .minus {
    background: #f0f0f0;
    color: #666;
}

.counter .minus:hover {
    background: #e0e0e0;
}

.counter .minus:focus {
    border-color: #666;
    box-shadow: 0 0 0 3px rgba(102, 102, 102, 0.3);
}

.counter .plus {
    background: #00a0e2;
    color: white;
}

.counter .plus:hover {
    background: #0090cc;
}

.counter .count {
    font-size: 16px;
    font-weight: 600;
    width: 50px;
    text-align: center;
    color: #333;
    border: 2px solid transparent;
    border-radius: 8px;
    background: transparent;
    padding: 4px;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s ease-out;
    -moz-appearance: textfield;
}

.counter .count::-webkit-outer-spin-button,
.counter .count::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.counter .count:focus {
    outline: none;
    background: #f0f0f0;
    border-color: #00a0e2;
    box-shadow: 0 0 0 3px rgba(0, 160, 226, 0.3);
}

.counter .count.animate {
    transform: scale(1.15);
}

.total-card {
    background: #1a1a2e;
    color: white;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
}

.total-row.grand {
    border-top: 2px solid rgba(255,255,255,0.2);
    margin-top: 8px;
    padding-top: 16px;
    font-size: 1.25rem;
    font-weight: 700;
}

.total-row .label {
    opacity: 0.8;
}

.total-row.grand .label {
    opacity: 1;
}

.total-row .value {
    font-weight: 600;
    transition: transform 0.15s ease-out;
}

.total-row .value.animate {
    transform: scale(1.1);
}

#grand-total.animate {
    transform: scale(1.15);
}

.reset-btn {
    width: 100%;
    padding: 16px;
    background: white;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #e74c3c;
    cursor: pointer;
    margin-top: 8px;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.reset-btn:hover {
    background: #f8f8f8;
}

.reset-btn:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.3);
}

.reset-btn:active {
    background: #f0f0f0;
}

/* Install banner */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 16px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    animation: slideUp 0.3s ease-out;
}

.install-banner[hidden] {
    display: none;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.install-content {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.install-text {
    font-size: 0.9rem;
    color: #333;
    flex: 1;
}

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

.install-btn {
    background: #00a0e2;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.install-btn:hover {
    background: #0090cc;
}

.install-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 160, 226, 0.3);
}

.install-dismiss {
    background: transparent;
    border: none;
    color: #999;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.install-dismiss:hover {
    color: #666;
}

.install-dismiss:focus {
    outline: none;
    color: #333;
}

/* Help page */
.help-card {
    padding: 0;
    overflow: hidden;
}

.help-section {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.help-section:last-child {
    border-bottom: none;
}

.help-section h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
}

.help-section p:last-child {
    margin-bottom: 0;
}

.help-section strong {
    color: #333;
}

.price-list {
    list-style: none;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px 0;
    margin-top: 8px;
}

.price-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: #333;
}

.price-list li:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.price-list li span:last-child {
    color: #00a0e2;
    font-weight: 600;
    white-space: nowrap;
}

.back-btn {
    display: block;
    text-align: center;
    padding: 16px;
    background: white;
    border-radius: 12px;
    color: #00a0e2;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s, transform 0.2s;
}

.back-btn:hover {
    background: #f8f8f8;
    transform: translateY(-1px);
}

.back-btn:active {
    transform: translateY(0);
}

.back-btn:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(0, 160, 226, 0.3);
}

/* Help link */
.help-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.help-link:hover {
    opacity: 1;
}

/* About page */
.about-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.about-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    transition: background-color 0.2s, transform 0.2s;
}

.about-link:hover {
    background: #eef0f2;
    transform: translateX(4px);
}

.about-link:active {
    transform: translateX(2px);
}

.about-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #00a0e2;
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}
