/* =====================================================================
   Shop App Styles
   ===================================================================== */

#shop-root {
    width: 100%;
}

.shop-view {
    width: 100%;
}

.shop-hidden {
    display: none !important;
}

/* ----- Header row ----- */
.shop-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 2px solid #ccc;
    margin-bottom: 0.5rem;
}

.shop-title {
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    color: #2c3e50;
}

.shop-cart-area {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.shop-cart-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: background 0.15s;
}


.shop-cart-btn:hover {
    background: #eef;
}

.shop-cart-icon {
    font-style: normal;
}

.shop-cart-label {
    font-size: 0.95rem;
    color: #444;
}

/* ----- Buttons ----- */
.shop-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    border: 1px solid #aaa;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.shop-btn-primary {
    background: #1e049c;
    color: #fff;
    border-color: #2a5ea8;
}

.shop-btn-primary:hover {
    background: #2a5ea8;
}

.shop-btn-primary:disabled {
    background: #999;
    border-color: #888;
    cursor: default;
}

.shop-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.shop-btn-secondary:hover {
    background: #e0e0e0;
}

.shop-btn-danger {
    background: #e74c3c;
    color: #fff;
    border-color: #c0392b;
}

.shop-btn-danger:hover {
    background: #c0392b;
}

.shop-btn-back {
    background: none;
    border: 1px solid #aaa;
    color: #555;
}

.shop-btn-back:hover {
    background: #f5f5f5;
}

.shop-back-link {
    color: #1e049c;
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.shop-back-link:hover {
    text-decoration: underline;
}

/* ----- Category row ----- */
.shop-category-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 0.75rem;
}

.shop-category-btn {
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    border: 2px solid #bbb;
    background: #f8f8f8;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s, border-color 0.15s;
    box-shadow: 2px 2px 0 #ccc;
}

.shop-category-btn:hover,
.shop-category-btn.active {
    background: #1e049c;
    color: #fff;
    border-color: #2a5ea8;
    box-shadow: 2px 2px 0 #1a3e78;
}

/* ----- Item grid ----- */
.shop-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

.shop-item-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.1s;
    background: #fff;
}

.shop-item-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.shop-item-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #eee;
}

.shop-item-card-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #bbb;
}

.shop-item-caption {
    padding: 0.5rem 0.6rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.shop-item-price {
    padding: 0 0.6rem 0.5rem;
    font-size: 0.82rem;
    color: #555;
    text-align: center;
}

/* ----- Item detail ----- */
.shop-detail-nav-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 0.75rem;
}

.shop-detail-title-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.shop-detail-content {
    padding: 0.5rem 0 1rem;
    line-height: 1.6;
}

.shop-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.shop-detail-actions {
    padding: 0.5rem 0;
    border-top: 1px solid #ddd;
    margin-top: 0.5rem;
}

/* ----- Cart & Checkout ----- */
.shop-cart-items {
    margin: 0.5rem 0;
}

.shop-cart-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    gap: 0.5rem;
    background-color: white;
}

.shop-cart-item-name {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.shop-cart-item-price {
    color: #555;
    font-size: 0.9rem;
    min-width: 120px;
    text-align: right;
}

.shop-cart-summary {
    padding: 0.75rem 0;
    font-size: 1.05rem;
    border-top: 2px solid #ddd;
}

.shop-cart-total-label {
    color: #333;
}

.shop-cart-actions {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.shop-checkout-links {
    display: flex;
    gap: 0.75rem;
}

.shop-checkout-message {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 0.75rem 0;
    font-weight: 600;
    font-size: 1rem;
}

.shop-checkout-message.validating {
    background: #fff8e1;
    color: #7b5c00;
    border: 1px solid #ffe082;
}

.shop-checkout-message.success {
    background: #e8f5e9;
    color: #2e7d;
    border: 1px solid #a5d6a7;
}

.shop-checkout-message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* ----- Confirmation ----- */
.shop-confirmation-content {
    text-align: center;
    padding: 2rem 0;
}

.shop-confirmation-content h2 {
    font-size: 1.8rem;
    color: #2e7d;
    margin-bottom: 0.5rem;
}

#shop-confirmation-fulfillment {
    text-align: left;
    margin: 1.25rem auto 1.5rem;
    max-width: 520px;
}

#shop-confirmation-fulfillment .shop-fulfillment-heading {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

/* ----- Order History overlay ----- */
.shop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-overlay-box {
    background: #fff;
    border-radius: 10px;
    width: min(520px, 95vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
}

.shop-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #ddd;
}

.shop-overlay-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.shop-order-history-content {
    padding: 0.75rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.shop-order-history-item {
    padding: 0.45rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
    color: #333;
}

.shop-order-history-date {
    font-size: 0.78rem;
    color: #888;
}

.shop-fulfillment-btn {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
}

/* ----- Fulfillment info section (item detail & confirmation) ----- */
.shop-fulfillment-section {
    border-top: 1px solid #c8e6c9;
    margin-top: 1.25rem;
    padding-top: 1rem;
    background: #f1f8f2;
    border-radius: 6px;
    padding: 0.85rem 1rem;
}

.shop-fulfillment-heading {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #2e7d;
}

.shop-fulfillment-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.shop-fulfillment-content a {
    color: #1a73e8;
}

.shop-empty-message {
    color: #888;
    font-style: italic;
    padding: 0.5rem 0;
}
