/* Creatus App - Core Styles */
:root {
    --creatus-primary: #ff4500;
    /* Dieci Orange-ish */
    --creatus-dark: #1a1a1a;
    --creatus-light: #f5f5f5;
    --creatus-white: #ffffff;
    --creatus-gray: #e0e0e0;
    --creatus-text: #333333;
    --creatus-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body.creatus-app-body {
    margin: 0;
    padding: 0;
    font-family: var(--creatus-font);
    background-color: var(--creatus-light);
    color: var(--creatus-text);
}

#creatus-app-root {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Minimal Header */
#creatus-app-header {
    background: var(--creatus-white);
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.creatus-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.creatus-logo h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--creatus-dark);
    letter-spacing: -0.5px;
}

/* Loading Screen */
.creatus-loading-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.creatus-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--creatus-gray);
    border-top: 4px solid var(--creatus-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* HERO SECTION */
#creatus-hero {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url('https://source.unsplash.com/1600x900/?pizza,restaurant') no-repeat center center/cover;
    position: relative;
    min-height: 80vh;
}

#creatus-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    /* Dark overlay */
    z-index: 1;
}

.creatus-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    color: white;
}

.creatus-hero-content h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 800;
}

.creatus-hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* PLZ BOX */
.creatus-plz-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: var(--creatus-text);
}

.creatus-toggle-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.creatus-toggle-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--creatus-gray);
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.creatus-toggle-btn.active {
    border-color: var(--creatus-primary);
    color: var(--creatus-primary);
    background: rgba(255, 69, 0, 0.05);
}

.creatus-input-group {
    display: flex;
    gap: 10px;
}

#creatus-plz-input {
    flex: 1;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid var(--creatus-gray);
    border-radius: 8px;
    outline: none;
    text-align: center;
    letter-spacing: 2px;
}

#creatus-plz-input:focus {
    border-color: var(--creatus-dark);
}

#creatus-check-plz-btn {
    background: var(--creatus-primary);
    color: white;
    border: none;
    border-radius: 8px;
    width: 60px;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#creatus-check-plz-btn:hover {
    background: #e63e00;
}

@media (max-width: 768px) {
    .creatus-hero-content h1 {
        font-size: 2rem;
    }

    #creatus-hero {
        min-height: 60vh;
        align-items: flex-start;
        padding-top: 100px;
    }
}

/* SHOP LAYOUT */
.creatus-cat-nav-wrapper {
    background: white;
    position: sticky;
    top: 70px;
    /* Below Header */
    z-index: 900;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 10px 0;
}

.creatus-cat-nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 0 20px;
    -webkit-overflow-scrolling: touch;
}

.creatus-cat-link {
    white-space: nowrap;
    text-decoration: none;
    color: var(--creatus-text);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--creatus-light);
    transition: all 0.2s;
}

.creatus-cat-link.active,
.creatus-cat-link:hover {
    background: var(--creatus-primary);
    color: white;
}

.creatus-shop-content {
    padding: 30px 20px;
}

.creatus-category-section {
    margin-bottom: 50px;
}

.creatus-category-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--creatus-gray);
    padding-bottom: 10px;
}

.creatus-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

/* PRODUCT CARD (Dieci Style) */
.creatus-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

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

.creatus-prod-img {
    height: 180px;
    background-size: cover;
    background-position: center;
}

.creatus-prod-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.creatus-prod-info h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.creatus-prod-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
    flex: 1;
}

.creatus-prod-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.price {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--creatus-dark);
}

.creatus-add-btn {
    background: var(--creatus-dark);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.creatus-add-btn:hover {
    background: var(--creatus-primary);
}

/* Disabled State */
.creatus-product-card.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* MODAL */
.creatus-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.creatus-modal-content {
    background: white;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 12px;
    position: relative;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.creatus-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.creatus-modal-body {
    display: flex;
    flex-direction: row;
}

.creatus-modal-img {
    width: 50%;
    min-height: 400px;
    background-size: cover;
    background-position: center;
}

.creatus-modal-details {
    width: 50%;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.creatus-modal-details h2 {
    margin-top: 0;
    font-size: 2rem;
}

.creatus-modal-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--creatus-primary);
    margin: 20px 0;
}

.creatus-modal-actions {
    margin-top: auto;
    display: flex;
    gap: 15px;
}

.creatus-qty-control {
    display: flex;
    border: 2px solid var(--creatus-gray);
    border-radius: 8px;
}

.creatus-qty-control button {
    background: transparent;
    border: none;
    width: 40px;
    font-size: 1.2rem;
    cursor: pointer;
}

.creatus-qty-control input {
    width: 50px;
    border: none;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.creatus-add-to-cart-btn {
    flex: 1;
    background: var(--creatus-primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.creatus-add-to-cart-btn:hover {
    background: #e63e00;
}

@media (max-width: 768px) {
    .creatus-modal-body {
        flex-direction: column;
    }

    .creatus-modal-img {
        width: 100%;
        height: 250px;
        min-height: auto;
    }

    .creatus-modal-details {
        width: 100%;
        padding: 20px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* CART SIDEBAR */
#creatus-cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.creatus-cart-header {
    padding: 20px;
    border-bottom: 1px solid var(--creatus-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--creatus-light);
}

.creatus-cart-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

#creatus-close-cart {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.creatus-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.creatus-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--creatus-gray);
    padding-bottom: 15px;
}

.creatus-item-details h4 {
    margin: 0 0 5px;
}

.creatus-item-qty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.creatus-item-qty button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--creatus-gray);
    background: white;
    cursor: pointer;
}

.creatus-cart-footer {
    padding: 20px;
    border-top: 1px solid var(--creatus-gray);
    background: var(--creatus-light);
}

.creatus-cart-totals {
    margin-bottom: 20px;
}

.creatus-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.creatus-total-row.final {
    font-weight: 800;
    font-size: 1.2rem;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
}

.creatus-surcharge-row {
    color: #d32f2f;
    font-size: 0.9rem;
}

#creatus-checkout-btn {
    width: 100%;
    padding: 15px;
    background: var(--creatus-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
}

#creatus-checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Cart Toggle (Floating) */
#creatus-cart-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--creatus-dark);
    color: white;
    border: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 990;
    display: flex;
    justify-content: center;
    align-items: center;
}

#creatus-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--creatus-primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    line-height: 24px;
    font-weight: bold;
}

@media (max-width: 500px) {
    #creatus-cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* CHECKOUT VIEW */
#creatus-checkout-view {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.05);
}

.creatus-checkout-container h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
}

.creatus-section {
    margin-bottom: 40px;
}

.creatus-section h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--creatus-gray);
    padding-bottom: 10px;
}

.creatus-form-row {
    margin-bottom: 15px;
}

.two-col {
    display: flex;
    gap: 15px;
}

.two-col input {
    width: 50%;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--creatus-gray);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--creatus-light);
}

input:focus,
select:focus {
    border-color: var(--creatus-dark);
    background: white;
    outline: none;
}

.creatus-info-box {
    background: rgba(255, 69, 0, 0.1);
    padding: 15px;
    border-radius: 6px;
    color: var(--creatus-primary);
}

.creatus-payment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.creatus-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border: 2px solid var(--creatus-gray);
    border-radius: 8px;
    cursor: pointer;
}

.creatus-radio input {
    width: 20px;
    height: 20px;
}

.creatus-summary {
    background: var(--creatus-light);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

#creatus-checkout-totals {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 10px 0;
}

#creatus-place-order-btn {
    width: 100%;
    padding: 18px;
    background: #4cd964;
    /* Green for Success action */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.2s;
}

#creatus-place-order-btn:hover {
    background: #3cb853;
}

#creatus-back-to-shop {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px solid var(--creatus-gray);
    color: var(--creatus-text);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.creatus-success-msg {
    text-align: center;
    padding: 50px 20px;
}

.creatus-success-msg h2 {
    color: #4cd964;
}

@media (max-width: 600px) {
    .two-col {
        flex-direction: column;
    }

    .two-col input {
        width: 100%;
    }
}