/* Shop Page Styles */

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

.featured-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

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

.featured-card {
    display: flex;
    flex-direction: column;
    background: var(--white-alpha-05);
    border: var(--border-dark);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;

    &:hover {
        border-color: var(--color-decoration-light);
        transform: translateY(-4px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .featured-card-icon {
        width: 100%;
        height: 200px;
        overflow: hidden;
        background: var(--background);

        img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    }

    .featured-card-placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 3rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .featured-card-content {
        padding: 1.5rem;

        h3 {
            font-size: 1.25rem;
            margin: 0 0 1rem 0;
            color: var(--text-color);
        }
    }

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

        .vat-notice {
            font-size: 0.875rem;
            font-weight: normal;
            color: var(--text-muted);
        }
    }
}

/* Shop Controls */
.shop-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;

    & .search-widget {
        flex: 2;
        min-width: 200px;
        margin-bottom: 0; /* Override default margin from search-widget */
    }
}
.shop-filter,
.shop-ordering {
    flex: 1;
    min-width: 150px;
}

.search-input,
.filter-select,
.ordering-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-decoration-light-alpha-30);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--color-background-2);
    color: var(--text-color);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.filter-select:hover,
.ordering-select:hover {
    border-color: var(--color-decoration-light-alpha-40);
    background: var(--color-background-3);
}

.search-input:focus,
.filter-select:focus,
.ordering-select:focus {
    outline: none;
    border-color: var(--color-decoration-light);
    background: var(--color-background-3);
    box-shadow: 0 0 0 3px var(--color-decoration-light-alpha-10),
                0 4px 12px var(--black-alpha-30);
}

/* Shop Detail Page */
.shop-purchase-section {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    background: var(--color-decoration-light-alpha-15);
}

.shop-purchase-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.shop-purchase-info {
    flex: 1;
}

.shop-purchase-action {
    flex-shrink: 0;
}

.shop-price-display {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.shop-price-amount {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.shop-price-vat {
    font-size: 1rem;
    color: var(--text-muted);
}

.shop-price-notice {
    margin-bottom: 1.5rem;
}

/* Card Grid Enhancements */
.ambience-card-price {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--primary);
}

/* List Header Enhancements */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .featured-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }

    .shop-controls {
        flex-direction: column;
    }

    .shop-controls .search-widget,
    .shop-filter,
    .shop-ordering {
        flex: 1 1 100%;
    }

    .featured-card-content h3 {
        font-size: 1.125rem;
    }

    .featured-card-price {
        font-size: 1.25rem;
    }

    .list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .shop-purchase-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .shop-purchase-action {
        width: 100%;
    }

    .shop-purchase-action .button {
        width: 100%;
    }
}

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

    .shop-price-amount {
        font-size: 1.5rem;
    }
}

/* Reviews Section */
.reviews-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.review-form-container {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--white-alpha-05);
    border: 1px solid var(--color-decoration-light-alpha-30);
    border-radius: 12px;

    h4 {
        margin: 0 0 1rem 0;
        color: var(--text-color);
    }
}

.review-own-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Star rating input */
.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-bottom: 0.5rem;

    input[type="radio"] {
        display: none;
    }

    .star-label {
        cursor: pointer;
        font-size: 1.75rem;
        color: var(--text-muted);
        transition: color 0.15s;
    }

    .star-label:hover,
    .star-label:hover ~ .star-label,
    input[type="radio"]:checked ~ .star-label {
        color: #f5a623;
    }
}

/* Review cards (list) */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.review-card {
    background: var(--white-alpha-05);
    border: 1px solid var(--color-decoration-light-alpha-30);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    transition: border-color 0.2s;

    &:hover {
        border-color: var(--color-decoration-light-alpha-40);
    }

    &.review-card--own {
        border-color: var(--color-decoration-light-alpha-40);
        background: var(--color-decoration-light-alpha-05);
    }
}

.review-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.review-stars {
    display: flex;
    gap: 0.1rem;
    line-height: 1;
}

.star {
    font-size: 1.25rem;
}

.star-filled {
    color: #f5a623;
}

.star-empty {
    color: var(--text-muted);
    opacity: 0.4;
}

.review-author {
    font-weight: 500;
    color: var(--text-color);
}

.review-date {
    margin-left: auto;
}

.review-comment-wrap {
    margin-top: 0.5rem;
}

.review-comment-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;

    &.expanded {
        display: block;
    }
}

.review-see-more-btn {
    background: none;
    border: none;
    color: var(--color-decoration-light);
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    margin-top: 0.25rem;

    &:hover {
        text-decoration: underline;
    }
}

.review-edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Voice Triggers List */
.voice-triggers-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.vt-stat {
    font-size: 0.75rem;
    color: var(--color-decoration-light);
    background: var(--color-decoration-light-alpha-10);
    border: 1px solid var(--color-decoration-light-alpha-30);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.voice-triggers-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.voice-trigger-card {
    background: var(--white-alpha-05);
    border: 1px solid var(--color-decoration-light-alpha-30);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s;

    &:hover {
        border-color: var(--color-decoration-light-alpha-40);
    }

    &[open] {
        border-color: var(--color-decoration-light-alpha-40);
        background: var(--color-background-3);
    }
}

.voice-trigger-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;

    &::-webkit-details-marker {
        display: none;
    }

    &::before {
        content: "▶";
        font-size: 0.55rem;
        color: var(--color-decoration-light);
        transition: transform 0.2s;
        flex-shrink: 0;
    }

    details[open] & {
        border-bottom: 1px solid var(--color-decoration-light-alpha-30);

        &::before {
            transform: rotate(90deg);
        }
    }
}

.voice-trigger-name {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.voice-trigger-phrase-count {
    font-size: 0.7rem;
    color: var(--color-decoration-light);
    background: var(--color-decoration-light-alpha-10);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.voice-trigger-phrases {
    margin: 0;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    list-style-type: "🗣️ ";

    li {
        margin-bottom: 0.4rem;
        color: var(--text-secondary);
        font-size: 0.9rem;

        &:last-child {
            margin-bottom: 0;
        }
    }
}

/* ============================================================
   Cart
   ============================================================ */

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 4rem 2rem;
    text-align: center;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--color-decoration-light-alpha-30);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 64px 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--white-alpha-05);
    border-bottom: 1px solid var(--border-dark);
    transition: background 0.15s;

    &:last-child {
        border-bottom: none;
    }

    &:hover {
        background: var(--color-background-3);
    }

    &.cart-item--unavailable {
        opacity: 0.6;
    }
}

.cart-item-icon {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.cart-item-placeholder {
    font-size: 2rem;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    &:hover {
        color: var(--color-decoration-light);
    }
}

.cart-item-notice {
    font-size: 0.8rem;
    font-weight: 500;

    &.cart-item-notice--info {
        color: var(--color-decoration-light);
    }

    &.cart-item-notice--warning {
        color: #f59e0b;
    }
}

.cart-item-price {
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
}

.price-amount {
    color: var(--primary);
}

.cart-item-actions {
    flex-shrink: 0;
}

.cart-summary {
    background: var(--white-alpha-05);
    border: 1px solid var(--color-decoration-light-alpha-30);
    border-radius: 12px;
    padding: 1.5rem;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cart-summary-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

.cart-summary-total {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.cart-summary-notice {
    margin-bottom: 1.5rem;
}

.cart-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.shop-add-to-cart-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================================
   Orders
   ============================================================ */

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

.order-card {
    display: block;
    background: var(--white-alpha-05);
    border: 1px solid var(--color-decoration-light-alpha-30);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.15s, transform 0.15s;

    &:hover {
        border-color: var(--color-decoration-light);
        background: var(--color-background-3);
        transform: translateY(-2px);
    }
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.order-card-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.order-card-date {
    font-weight: 500;
    color: var(--text-color);
}

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

.order-card-items {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
}

.order-card-count {
    font-size: 0.8rem;
}

.order-status {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;

    &.order-status--completed {
        background: rgba(34, 197, 94, 0.15);
        color: #22c55e;
    }

    &.order-status--pending {
        background: rgba(245, 158, 11, 0.15);
        color: #f59e0b;
    }

    &.order-status--cancelled {
        background: rgba(239, 68, 68, 0.15);
        color: #ef4444;
    }

    &.order-status--lg {
        font-size: 1rem;
        padding: 0.35rem 1rem;
    }
}

.order-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.order-uuid {
    font-family: monospace;
    font-size: 0.9em;
    color: var(--text-muted);
}

.order-summary-card {
    background: var(--white-alpha-05);
    border: 1px solid var(--color-decoration-light-alpha-30);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.order-purchases {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--color-decoration-light-alpha-30);
    border-radius: 12px;
    overflow: hidden;
}

.order-purchase-item {
    display: grid;
    grid-template-columns: 64px 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--white-alpha-05);
    border-bottom: 1px solid var(--border-dark);

    &:last-child {
        border-bottom: none;
    }
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.pagination-info {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 48px 1fr auto;
        grid-template-rows: auto auto;
    }

    .cart-item-price {
        grid-column: 2;
        grid-row: 2;
        text-align: left;
    }

    .cart-item-actions {
        grid-column: 3;
        grid-row: 1 / 3;
    }

    .cart-actions {
        flex-direction: column;
    }

    .cart-actions .button {
        width: 100%;
        text-align: center;
    }

    .order-purchase-item {
        grid-template-columns: 48px 1fr auto;
    }

    .order-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
