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

:root {
    --primary-color: #ff1493;
    --secondary-color: #ff69b4;
    --accent-color: #ffc0cb;
    --dark-color: #4d2d3d;
    --light-color: #fff5f9;
    --bg-pink: #ffe4f0;
    --border-color: #ffd1e3;
    --shadow: 0 2px 10px rgba(255, 105, 180, 0.15);
    --shadow-hover: 0 4px 20px rgba(255, 105, 180, 0.25);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background: var(--bg-pink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Touch-friendly improvements */
* {
    -webkit-tap-highlight-color: transparent;
}

button,
.btn-primary,
.btn-secondary,
.btn-tool,
.filter-btn,
.add-to-cart-btn,
.buy-design-btn {
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.logo-icon {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    transition: color 0.3s;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn-tool {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-tool:hover {
    background: var(--accent-color);
}

/* Sections */
.section {
    display: none;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

.section.active {
    display: block;
}

/* Hero Section */
.hero {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
    width: 100%;
}

.hero-content {
    text-align: center;
    margin-bottom: 4rem;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.3rem;
    color: #6d4c5c;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s;
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

/* Design Studio */
.studio-container {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.studio-header {
    text-align: center;
    margin-bottom: 2rem;
}

.studio-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.studio-workspace {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 2rem;
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

/* Tools Panel */
.tools-panel {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 12px;
    height: fit-content;
}

.tools-panel h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.tool-group {
    margin-bottom: 1.5rem;
}

.tool-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.tool-select,
.color-picker {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
}

.color-picker {
    height: 50px;
    cursor: pointer;
}

.slider {
    width: 80%;
}

#brushSizeValue {
    margin-left: 0.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.pattern-grid,
.sticker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.pattern-btn,
.sticker-btn {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.pattern-btn:hover,
.sticker-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.sticker-btn {
    font-size: 1.5rem;
}

.tool-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* Canvas Area */
.canvas-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.canvas-container {
    background: white;
    border: 3px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--shadow);
}

#nailCanvas {
    display: block;
    cursor: crosshair;
    background: #fff5f9;
    border-radius: 8px;
}

.canvas-info {
    margin-top: 1rem;
    color: #6d4c5c;
    font-size: 0.9rem;
}

/* Preview Panel */
.preview-panel {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 12px;
    height: fit-content;
}

.preview-panel h3,
.preview-panel h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.hand-preview {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.preview-nails {
    display: flex;
    justify-content: space-around;
    gap: 0.5rem;
}

.preview-nail {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: #fff5f9;
}

.saved-designs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.saved-design-item {
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
}

.saved-design-item:hover {
    background: var(--accent-color);
    transform: translateX(5px);
}

.saved-design-item canvas {
    width: 40px;
    height: 60px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.empty-state {
    color: #a88d9e;
    text-align: center;
    padding: 2rem;
}

/* Shop Section */
.shop-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

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

.shop-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.shop-filters,
.gallery-filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

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

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    cursor: pointer;
}

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

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.product-description {
    color: #6d4c5c;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.add-to-cart-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.add-to-cart-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

/* Gallery Section */
.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

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

.gallery-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.gallery-header p {
    color: #6d4c5c;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

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

.gallery-item {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    cursor: pointer;
}

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

.gallery-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
}

.gallery-info {
    padding: 1.5rem;
}

.gallery-artist {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.artist-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.artist-name {
    font-weight: 600;
    color: var(--dark-color);
}

.gallery-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.gallery-stats {
    display: flex;
    gap: 1rem;
    color: #6d4c5c;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.buy-design-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.buy-design-btn:hover {
    background: var(--secondary-color);
}

/* Shopping Cart */
.cart-sidebar {
    position: fixed;
    right: -400px;
    top: 0;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h3 {
    color: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #6d4c5c;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-image {
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: bold;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.cart-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-hover);
    transition: transform 0.3s;
    z-index: 1000;
}

.cart-fab:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .studio-workspace {
        grid-template-columns: 1fr;
    }

    .preview-panel,
    .tools-panel {
        max-width: 600px;
        margin: 0 auto;
    }

    .hero-features {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 968px) {
    .nav-container {
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.85rem;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .studio-workspace {
        padding: 1rem;
    }

    .canvas-container {
        padding: 0.5rem;
    }

    #nailCanvas {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 768px) {
    /* Typography */
    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .studio-header h2,
    .shop-header h2,
    .gallery-header h2 {
        font-size: 1.8rem;
    }

    /* Navigation */
    .nav-container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        margin-top: 1rem;
    }

    .nav-link {
        padding: 0.5rem 1rem;
        background: white;
        border-radius: 20px;
        font-size: 0.85rem;
    }

    /* Hero Section */
    .hero {
        padding: 2rem 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .btn-large {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    /* Section Padding */
    .section {
        padding: 1rem;
    }

    /* Studio */
    .studio-workspace {
        gap: 1.5rem;
        padding: 1rem;
    }

    .tools-panel,
    .preview-panel {
        padding: 1rem;
    }

    .canvas-area {
        order: -1;
    }

    #nailCanvas {
        width: 100%;
        max-width: 350px;
        height: auto;
    }

    .pattern-grid,
    .sticker-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tool-actions {
        margin-top: 1rem;
    }

    /* Preview Nails */
    .preview-nails {
        flex-wrap: wrap;
        justify-content: center;
    }

    .preview-nail {
        width: 50px;
        height: 75px;
    }

    /* Products & Gallery */
    .products-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }

    .product-card,
    .gallery-item {
        max-width: 500px;
        margin: 0 auto;
    }

    .product-image,
    .gallery-image {
        height: 200px;
    }

    /* Filters */
    .shop-filters,
    .gallery-filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }

    /* Shopping Cart */
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .cart-fab {
        bottom: 1rem;
        right: 1rem;
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }

    /* Feature Cards */
    .feature-card {
        padding: 1.5rem;
    }

    .feature-icon {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .hero-content h1 {
        font-size: 1.5rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo-icon {
        font-size: 1.5rem;
    }

    .nav-links {
        font-size: 0.8rem;
        gap: 0.25rem;
    }

    .nav-link {
        padding: 0.4rem 0.8rem;
    }

    .studio-header h2,
    .shop-header h2,
    .gallery-header h2 {
        font-size: 1.5rem;
    }

    #nailCanvas {
        max-width: 280px;
    }

    .pattern-btn,
    .sticker-btn {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .sticker-btn {
        font-size: 1.2rem;
    }

    .btn-tool {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .product-info,
    .gallery-info {
        padding: 1rem;
    }

    .product-title {
        font-size: 1rem;
    }

    .product-price {
        font-size: 1.2rem;
    }

    .cart-item {
        padding: 0.75rem;
    }

    .cart-item-image {
        width: 50px;
        height: 50px;
    }

    .section {
        padding: 0.5rem;
    }
}

/* Landscape orientation fixes */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: 2rem 1rem;
    }

    .hero-content h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    .hero-content p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    .hero-features {
        margin-top: 2rem;
    }

    .feature-card {
        padding: 1.5rem;
    }
}
