/* ============================================
   The Enchanted Brew Shop - Styles
   ============================================ */

/* Accessibility utility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* CSS Variables */
:root {
    --color-primary: #4a1c6b;
    --color-primary-dark: #2d1040;
    --color-secondary: #1a2a4a;
    --color-accent: #d4af37;
    --color-accent-light: #f4e4a6;
    --color-success: #2d8a4e;
    --color-background: #0d0d1a;
    --color-surface: #1a1a2e;
    --color-surface-light: #252540;
    --color-text: #e8e8f0;
    --color-text-muted: #a0a0b0;
    --color-border: #3d3d5c;
    --font-display: 'Cinzel', serif;
    --font-body: 'Open Sans', sans-serif;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--color-background) 0%, var(--color-primary-dark) 100%);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
}

/* ============================================
   Header
   ============================================ */
.site-header {
    background: linear-gradient(180deg, var(--color-primary-dark) 0%, transparent 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-border);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.shop-name {
    font-size: 2rem;
    color: var(--color-accent);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    letter-spacing: 2px;
}

.tagline {
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 0.25rem;
}

.header-info {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.delivery-info, .hours {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.section-title {
    font-size: 1.5rem;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

/* ============================================
   Featured Section
   ============================================ */
.featured-section {
    margin-bottom: 2rem;
}

.featured-potion {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-accent);
}

.discount-badge {
    position: absolute;
    top: 15px;
    right: -35px;
    background: #c0392b; /* darkened from #e74c3c for WCAG 1.4.3: 5.10:1 contrast ratio */
    color: white;
    padding: 0.5rem 3rem;
    font-weight: 700;
    font-size: 0.9rem;
    transform: rotate(45deg);
    box-shadow: var(--shadow-sm);
}

.featured-label {
    display: inline-block;
    background: var(--color-accent);
    color: var(--color-primary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.featured-name {
    font-size: 1.75rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.featured-description {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    max-width: 600px;
}

.featured-price {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.original-price {
    color: var(--color-text-muted);
    text-decoration: line-through;
    font-size: 1.1rem;
}

.sale-price {
    color: var(--color-accent);
    font-size: 1.5rem;
    font-weight: 700;
}

.featured-image {
    position: absolute;
    top: 20px;
    right: 120px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

/* ============================================
   Builder Layout
   ============================================ */
.builder-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* ============================================
   Potion Builder
   ============================================ */
.potion-builder {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.builder-section {
    margin-bottom: 2rem;
}

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

.builder-section h3 {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 1rem;
}

/* Potion Cards */
.potion-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.potion-card {
    cursor: pointer;
}

.potion-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.potion-card .card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem;
    background: var(--color-surface-light);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.potion-card:hover .card-content {
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.potion-card:nth-child(3) .card-content {
    border-radius: 4px;
}

.potion-card input:checked + .card-content {
    border-color: var(--color-accent);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-surface-light) 100%);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.potion-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.potion-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-align: center;
}

.potion-price {
    color: var(--color-accent);
    font-size: 0.9rem;
}

/* Size Options */
.size-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.size-option {
    flex: 1;
    min-width: 120px;
    cursor: pointer;
}

.size-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.size-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--color-surface-light);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.size-option:hover .size-content {
    border-color: var(--color-accent);
}

.size-option input:checked + .size-content {
    border-color: var(--color-accent);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-surface-light) 100%);
}

.size-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.size-name {
    font-weight: 600;
}

.size-detail {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Ingredients Grid */
.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.ingredient-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-surface-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ingredient-option:hover {
    border-color: var(--color-accent);
}

.ingredient-option:nth-child(4) {
    padding: 0.5rem;
}

.ingredient-option input {
    accent-color: var(--color-accent);
    width: 18px;
    height: 18px;
}

.ingredient-option input:checked + .ingredient-name {
    color: var(--color-accent);
}

.ingredient-name {
    flex: 1;
}

.ingredient-price {
    color: var(--color-accent);
    font-size: 0.85rem;
}

/* Potency Options */
.potency-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.potency-option {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-surface-light);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.potency-option:hover {
    border-color: var(--color-accent);
}

.potency-option input {
    accent-color: var(--color-accent);
}

.potency-option input:checked {
    outline: none;
}

.potency-option:has(input:checked) {
    border-color: var(--color-accent);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-surface-light) 100%);
}

.potency-name {
    font-weight: 600;
    display: block;
}

.potency-detail {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: block;
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
}

.qty-btn {
    width: 40px;
    height: 40px;
    background: var(--color-surface-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-accent);
}

.qty-btn:focus {
    outline: none;
}

.quantity-selector input {
    width: 60px;
    height: 40px;
    text-align: center;
    background: var(--color-surface-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 1rem;
    font-family: var(--font-body);
}

.quantity-selector input:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* ============================================
   Order Summary
   ============================================ */
.order-summary {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 1rem;
    height: fit-content;
    min-width: 320px;
}

.summary-title {
    font-size: 1.25rem;
    color: var(--color-accent);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.summary-item .item-name {
    color: var(--color-text-muted);
}

.summary-item .item-price {
    color: var(--color-text);
    font-weight: 500;
}

.summary-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0.5rem 0;
}

.brewing-fee {
    font-style: italic;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
}

.total-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
}

.total-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
}

/* ============================================
   Customer Information Form
   ============================================ */
.customer-info {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.order-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
}

.label-placeholder {
    height: 1.35rem;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    background: var(--color-surface-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* Delivery Options */
.delivery-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.delivery-option {
    flex: 1;
    min-width: 180px;
    cursor: pointer;
}

.delivery-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.delivery-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-surface-light);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.delivery-option:hover .delivery-content {
    border-color: var(--color-accent);
}

.delivery-option input:checked + .delivery-content {
    border-color: var(--color-accent);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-surface-light) 100%);
}

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

.delivery-name {
    font-weight: 600;
    display: block;
}

.delivery-detail {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: block;
}

/* Form Actions */
.form-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent) 0%, #b8942e 100%);
    color: var(--color-primary-dark);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(212, 175, 55, 0.3);
}

.btn-brew {
    font-size: 1.1rem;
    padding: 1rem 3rem;
}

.btn-featured {
    background: var(--color-accent);
    color: var(--color-primary-dark);
    padding: 0.75rem 1.5rem;
}

.btn-featured:hover {
    background: #90EE90;
}

/* ============================================
   Modal
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    max-width: 450px;
    width: 90%;
    position: relative;
    border: 1px solid var(--color-accent);
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.2);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--color-text);
}

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

.modal-content h2 {
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.modal-content p {
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.order-number {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--color-text);
    margin: 1rem 0;
}

.delivery-estimate {
    margin-bottom: 1.5rem;
}

/* ============================================
   Reviews Section
   ============================================ */
.reviews-section {
    margin-bottom: 2rem;
}

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

.review-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.review-stars {
    color: var(--color-accent);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    letter-spacing: 2px;
}

.review-stars.light-stars {
    color: #ffd700;
}

.review-text {
    color: var(--color-text);
    font-style: italic;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.review-author {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: var(--color-accent);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.footer-section p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.social-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.social-link:hover {
    color: var(--color-accent);
}

.social-link:focus {
    outline: none;
}

.footer-bottom {
    text-align: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--color-border);
}

.footer-bottom p {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.guarantee {
    color: var(--color-accent);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 900px) {
    .builder-layout {
        grid-template-columns: 1fr;
    }

    .order-summary {
        position: static;
        min-width: auto;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-info {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }

    .shop-name {
        font-size: 1.5rem;
    }

    .featured-potion {
        padding: 1.5rem;
    }

    .featured-name {
        font-size: 1.35rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .label-placeholder {
        display: none;
    }

    .potion-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .size-options {
        flex-direction: column;
    }

    .potency-options {
        flex-direction: column;
    }

    .delivery-options {
        flex-direction: column;
    }

    .discount-badge {
        right: -45px;
        font-size: 0.75rem;
    }

    .summary-title {
        white-space: nowrap;
        overflow: hidden;
    }
}

@media (max-width: 600px) {
    .featured-price {
        position: relative;
        z-index: 1;
    }

    .discount-badge {
        top: 10px;
        right: -50px;
    }
}

@media (max-width: 480px) {
    .shop-name {
        font-size: 1.25rem;
    }

    .header-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .potion-options {
        grid-template-columns: 1fr;
    }

    .credit-link {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .credit-wizzo {
        width: 35px;
        height: 35px;
    }

    .credit-logo {
        height: 22px;
    }

    .credit-text {
        font-size: 0.75rem;
    }

    .ingredients-grid {
        grid-template-columns: 1fr;
    }

    .featured-content {
        padding-right: 0;
    }

    .reviews-grid {
        grid-template-columns: 1fr;
    }

    .btn-brew {
        width: 100%;
        padding: 1rem 1.5rem;
    }

    .summary-total .total-price {
        min-width: 150px;
        text-align: right;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
