/* CSS Reset and Variables */
:root {
    /* Colors from logo */
    --primary-purple: #7B3F99;
    --primary-yellow: #FFD700;
    --soft-pink: #FFB6C1;
    --light-pink: #FFF0F5;
    --brown: #8B4513;
    --white: #FFFFFF;
    --gray-light: #F5F5F5;
    --gray-medium: #666666;
    --shadow: rgba(0, 0, 0, 0.1);
    --success-green: #28a745;
    
    /* Typography */
    --font-primary: 'Kalam', cursive;
    --font-accent: 'Caveat', cursive;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

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

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: var(--soft-pink);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Construction Banner */
.construction-banner {
    background: var(--primary-yellow);
    color: #333;
    text-align: center;
    padding: var(--spacing-sm);
    font-weight: 700;
    font-size: 1.2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    box-shadow: 0 2px 10px var(--shadow);
}

.construction-banner p {
    margin: 0;
}

/* Header Styles */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    padding: var(--spacing-md) 0;
    box-shadow: 0 2px 10px var(--shadow);
    position: relative;
    overflow: hidden;
    margin-top: 60px; /* Space for fixed banner */
}

.site-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-purple), var(--primary-yellow), var(--soft-pink));
}

.site-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-purple);
    text-align: center;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.fancy-o {
    font-family: var(--font-accent);
    font-size: 4.5rem;
    color: var(--primary-purple);
    font-weight: 700;
    display: inline-block;
    transform: rotate(-10deg);
    margin-right: -0.3rem;
}

.loom-text {
    display: inline-flex;
    align-items: center;
    position: relative;
    margin-left: 0.8rem;
}

.hook-l {
    height: 3rem;
    width: auto;
    margin-right: -0.2rem;
    transform: rotate(-5deg);
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.tagline {
    text-align: center;
    color: var(--gray-medium);
    font-family: var(--font-accent);
    font-size: 1.5rem;
    margin-top: var(--spacing-xs);
}

/* Hero Section */
.hero {
    padding: var(--spacing-xl) 0;
    position: relative;
    background: linear-gradient(to bottom, 
        var(--primary-purple) 0%, 
        var(--primary-purple) 70%, 
        rgba(123, 63, 153, 0.8) 85%, 
        rgba(123, 63, 153, 0.5) 95%,
        transparent 100%);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    position: relative;
    z-index: 2;
}

.intro-card {
    background: rgba(255, 255, 255, 0.95);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px var(--shadow);
    transform: rotate(-1deg);
    transition: transform 0.3s ease;
}

.intro-card:hover {
    transform: rotate(0deg);
}

.intro-card h2 {
    color: var(--primary-purple);
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
    font-family: var(--font-accent);
}

.intro-card p {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
}

.summer-note {
    color: var(--primary-purple);
    font-weight: 700;
    font-style: italic;
}

.signature {
    text-align: right;
    font-family: var(--font-accent);
    font-size: 1.3rem;
    color: var(--primary-purple);
    margin-top: var(--spacing-md);
}

.logo-display {
    text-align: center;
}

.main-logo {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Products Section */
.products {
    padding: var(--spacing-xl) 0;
    position: relative;
    background: transparent;
}

.products h2 {
    text-align: center;
    font-size: 3rem;
    color: var(--white);
    margin-bottom: var(--spacing-sm);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.section-intro {
    text-align: center;
    font-size: 1.3rem;
    color: var(--white);
    margin-bottom: var(--spacing-lg);
    font-family: var(--font-accent);
}

.product-category {
    margin-bottom: var(--spacing-xl);
}

.product-category h3 {
    text-align: center;
    font-size: 2rem;
    color: var(--white);
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.product-gallery {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.sample-icecream {
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
}

.sample-popsicle {
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm);
}

.sample-popsicle img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-item {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.product-item:hover {
    transform: translateY(-5px);
}

.product-item img {
    max-width: 200px;
    height: auto;
    margin-bottom: var(--spacing-sm);
}

.product-item p {
    font-size: 1.2rem;
    color: var(--primary-purple);
    font-weight: 700;
}

/* Builder Section */
.builder {
    padding: var(--spacing-xl) 0 calc(var(--spacing-xl) * 0.25) 0;
    background: rgba(255, 255, 255, 0.95);
    margin: var(--spacing-xl) 0 calc(var(--spacing-xl) * 0.25) 0;
    border-radius: var(--radius-lg);
}

.builder h2 {
    text-align: center;
    font-size: 3rem;
    color: var(--primary-purple);
    margin-bottom: var(--spacing-sm);
}

/* Product Type Selector */
.product-type-selector {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.product-type-selector h3 {
    font-size: 1.5rem;
    color: var(--primary-purple);
    margin-bottom: var(--spacing-md);
}

.product-types {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.product-type-option {
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-type-option input[type="radio"] {
    display: none;
}

.product-type-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border: 3px solid var(--gray-light);
    border-radius: var(--radius-md);
    background: var(--white);
    transition: all 0.3s ease;
    min-width: 120px;
}

.product-type-label:hover {
    border-color: var(--primary-yellow);
    transform: translateY(-2px);
}

.product-type-option input[type="radio"]:checked + .product-type-label {
    border-color: var(--primary-purple);
    background: var(--light-pink);
    box-shadow: 0 4px 16px var(--shadow);
}

.product-type-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.popsicle-icon {
    background: linear-gradient(to bottom, #FF69B4 0%, #FF69B4 30%, #9370DB 30%, #9370DB 60%, #87CEEB 60%, #87CEEB 90%, transparent 90%, transparent 100%);
    border-radius: 8px 8px 4px 4px;
}
.popsicle-icon::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 12px;
    background: var(--brown);
    border-radius: 2px 2px 8px 8px;
}

.icecream-icon {
    background: #FF69B4;
    border-radius: 50% 50% 50% 50%;
    position: relative;
    width: 24px;
    height: 24px;
    top: 2px;
}

.icecream-icon::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 18px solid var(--brown);
}

.product-type-label span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-purple);
}

.product-price {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: var(--primary-yellow) !important;
    background: var(--primary-purple);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 2px;
}

.builder-area {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.color-palette h3,
.popsicle-preview h3 {
    font-size: 1.5rem;
    color: var(--primary-purple);
    margin-bottom: var(--spacing-sm);
}

.instructions {
    color: var(--gray-medium);
    margin-bottom: var(--spacing-md);
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(7, 50px);
    gap: calc(var(--spacing-sm) * 0.25);
    margin-bottom: var(--spacing-md);
    row-gap: calc(var(--spacing-lg) * 0.75);
    justify-content: center;
}

.color-swatch {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid #CCCCCC;
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: var(--primary-yellow);
}

.color-swatch.selected {
    border-color: var(--primary-purple);
    border-width: 3px;
    box-shadow: 0 0 0 2px var(--primary-yellow), 0 4px 8px rgba(0, 0, 0, 0.2);
}

.color-swatch span {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-medium);
}

.selected-color-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.color-preview {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--gray-medium);
    background: var(--gray-light);
}

/* Product Builder Switching */
.product-builder {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.product-builder.active {
    display: block;
}

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

/* Popsicle Display */
.popsicle-container {
    display: flex;
    justify-content: center;
    margin: var(--spacing-md) 0;
}

.popsicle {
    width: 120px;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    box-shadow: 0 4px 16px var(--shadow);
}

/* Ice Cream Cone Display */
.icecream-container {
    display: flex;
    justify-content: center;
    margin: var(--spacing-md) 0;
}

.icecream {
    width: 120px;
    height: 140px;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    box-shadow: 0 4px 16px var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.popsicle-section {
    width: 100%;
    height: 60px;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    position: relative;
    outline: 4px solid #CCCCCC;
    outline-offset: -4px;
}

.popsicle-section:hover {
    border-color: var(--primary-yellow);
    transform: scale(1.05);
}

.popsicle-section.top {
    background: #FF69B4;
    border-radius: 30px 30px var(--radius-sm) var(--radius-sm);
}

.popsicle-section.middle {
    background: #9370DB;
}

.popsicle-section.bottom {
    background: #87CEEB;
}

.popsicle-section.stick {
    background: var(--brown);
    height: 80px;
    width: 40%;
    margin: 4px auto 0;
    border-radius: 4px 4px 20px 20px;
}

/* Ice Cream Cone Sections */
.icecream-section {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    position: relative;
    outline: 4px solid #CCCCCC;
    outline-offset: -4px;
}

.icecream-section:hover {
    border-color: var(--primary-yellow);
    transform: scale(1.05);
}

.icecream-section.scoop {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #FF69B4;
    margin-bottom: -15px; /* Overlap with cone */
    z-index: 1; /* Behind cone */
}

.icecream-section.cone {
    width: 0;
    height: 0;
    border-left: 30px solid transparent; /* Reduced from 35px */
    border-right: 30px solid transparent; /* Reduced from 35px */
    border-top: 60px solid var(--brown);
    background: transparent;
    border-radius: 0;
    outline: none;
    position: relative;
    cursor: pointer;
    z-index: 2; /* In front of scoop */
}

.icecream-section.cone:hover {
    transform: scale(1.05);
    border-top-color: var(--primary-yellow);
}

.icecream-section.cone::before {
    content: '';
    position: absolute;
    top: -60px;
    left: -33px; /* Adjusted to cover full cone width */
    width: 60px; /* Adjusted to cover full cone width */
    height: 60px;
    background: transparent;
    border: 4px solid #CCCCCC;
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    pointer-events: none;
}

/* Product Builder Layout */
.product-builder-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
}

.section-labels {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-width: 100px;
}

.section-label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 0.85rem;
    height: 60px; /* Match popsicle section height */
    position: relative;
}

.section-label.stick-label {
    height: 80px; /* Match stick height */
    margin-top: 4px; /* Match stick margin */
}

.section-label.scoop-label {
    height: 80px; /* Match scoop height */
}

.section-label.cone-label {
    height: 60px; /* Match cone height */
    margin-top: -15px; /* Match cone overlap */
}

.section-labels .color-name {
    color: var(--primary-purple);
    font-style: normal;
    font-weight: 600;
    font-size: 0.85rem;
}

.selected-color-display .color-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-purple);
    text-align: center;
    margin-top: var(--spacing-xs);
}

/* Buttons */
.builder-controls {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background: #6B3588;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--primary-purple);
}

.btn-secondary:hover {
    background: #E0E0E0;
}

/* Collection Section */
.collection {
    padding: calc(var(--spacing-xl) * 0.25) 0;
}

.collection h2 {
    text-align: center;
    font-size: 3rem;
    color: var(--white);
    margin-bottom: var(--spacing-sm);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.saved-product {
    background: var(--white);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: 0 4px 16px var(--shadow);
    transition: transform 0.3s ease;
    height: fit-content;
}

.saved-product:hover {
    transform: translateY(-5px);
}

.saved-product .product-builder-layout {
    margin: var(--spacing-sm) 0;
    gap: var(--spacing-xs);
}

.saved-product .popsicle,
.saved-product .icecream {
    margin: 0;
    transform: scale(0.7);
}

.saved-product .popsicle-section {
    height: 35px; /* Reduced from 60px for more compact display */
    margin-bottom: 1px; /* Reduced from 2px */
}

.saved-product .popsicle-section.stick {
    height: 45px; /* Reduced from 80px */
    margin-top: 2px; /* Reduced from 4px */
}

.saved-product .popsicle-container,
.saved-product .icecream-container {
    margin: 0;
}

.saved-product .section-labels {
    gap: var(--spacing-xs);
    min-width: 80px;
}

.saved-product .section-label {
    height: 25px; /* Scaled down to match 35px popsicle sections */
    font-size: 0.75rem;
}

.saved-product .section-label.stick-label {
    height: 32px; /* Scaled down to match 45px stick section */
    margin-top: 1px; /* Scaled down to match 2px stick margin */
}

.saved-product .section-label.scoop-label {
    height: 56px; /* Scaled down from 80px */
}

.saved-product .section-label.cone-label {
    height: 42px; /* Scaled down from 60px */
    margin-top: -10px; /* Scaled down from -15px */
}

.product-card-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-yellow);
    background: var(--primary-purple);
    padding: 4px 8px;
    border-radius: 6px;
    text-align: center;
    margin: var(--spacing-xs) 0;
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    align-items: center;
}

.btn-small {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.9rem;
}

.btn-edit {
    background: var(--primary-yellow);
    color: #333;
}

.btn-delete {
    background: #FF6B6B;
    color: var(--white);
}

/* Collection Summary */
.collection-summary {
    background: var(--white);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    box-shadow: 0 4px 16px var(--shadow);
}

.summary-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.collection-total {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.total-items {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-purple);
}

.total-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-purple);
}

.purchase-section {
    display: flex;
    align-items: center;
}

.paypal-collection-button {
    min-width: 250px;
}

/* Purchased Indicator */
.purchased-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-xs);
    background: var(--success-green);
    color: var(--white);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
}

.purchased-text {
    font-weight: bold;
    font-size: 0.9rem;
}

.order-id {
    font-size: 0.7rem;
    opacity: 0.9;
    margin-top: 2px;
}

/* Button Row for Edit/Delete */
.button-row {
    display: flex;
    gap: var(--spacing-xs);
    justify-content: center;
}

.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--white);
    font-size: 1.3rem;
    font-family: var(--font-accent);
}

/* Footer */
.site-footer {
    background: rgba(0, 0, 0, 0.1);
    padding: var(--spacing-lg) 0;
    text-align: center;
    color: var(--white);
    margin-top: var(--spacing-xl);
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-title {
        font-size: 2.5rem;
    }
    
    .fancy-o {
        font-size: 3rem;
    }
    
    .hook-l {
        height: 2rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .intro-card {
        transform: none;
    }
    
    .builder-area {
        grid-template-columns: 1fr;
    }
    
    .color-grid {
        grid-template-columns: repeat(5, 50px);
        gap: calc(var(--spacing-sm) * 0.25);
        row-gap: calc(var(--spacing-xl) * 0.75);
        justify-content: center;
    }
    
    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .product-types {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-md);
    }
    
    .product-type-label {
        min-width: 150px;
    }
    
    .product-builder-layout {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .section-labels {
        align-items: center;
        min-width: auto;
    }
    
    .section-label {
        justify-content: center;
        height: auto;
        margin-top: 0;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .color-grid {
        grid-template-columns: repeat(4, 45px);
        gap: calc(var(--spacing-sm) * 0.2);
    }
    
    .color-swatch {
        width: 45px;
        height: 45px;
    }
    
    .color-swatch span {
        font-size: 0.8rem;
        bottom: -22px;
    }
}