/**
 * OpSales Cart - Editorial Grid Design
 * Integrated with KTV Design System
 * 
 * Architecture:
 * - Uses CSS Grid for layout
 * - Design system variables for colors/spacing
 * - Minimal, editorial aesthetic
 * - Responsive mobile-first
 */
 
 /* =================================
   ROOT
   ================================= */
 :root {
    --gold: #c9a96e;
    --gold-light: #e2c97e;
    --gold-dim: rgba(201, 168, 76, 0.18);
    --dark: #0d0b08;
    --dark-card: #000000;
    --dark-surface: #1a1710;
    --dark-border: rgba(201, 168, 76, 0.18);
    --text-primary: #f0ebe0;
    --text-muted: rgba(240, 235, 224, .55);
    --text-dim: rgba(240, 235, 224, .35);
    --font-d: 'Cinzel', serif;
    --font-b: 'DM Sans', sans-serif;
    --csz: 44px;
    --cw: 1.5px;
    --border-radius-lg: 0px !important;
    --border-radius-sm: 0px !important;
    --color-gray-700: #a1a1a1 !important;
    --color-gray-900: #e9e9e9 !important;

/* =================================
   CART WRAPPER
   ================================= */

.opsales-cart-wrapper {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 2rem;
    font-family: var(--font-body);
    color: var(--color-gray-900);
}

.opsales-qty-display {
        color: black !important;
}

/* =================================
   EMPTY STATE
   ================================= */

.cart-empty-state {
    text-align: center;
    padding: 6rem 2rem;
    background: var(--color-gray-100);
    border-radius: var(--border-radius-md);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.cart-empty-state h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--color-gray-700);
}

.cart-empty-state p {
    color: var(--color-gray-500);
    margin-bottom: 2rem;
}

/* =================================
   CART HEADER
   ================================= */

.cart-header {
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--color-gray-200);
    padding-bottom: 1.5rem;
}

.cart-title {
        font-family: var(--font-heading);
        font-size: 2.5rem;
        margin: 0 0 0.5rem 0;
        color: var(--color-white);
}

.cart-count {
        color: var(--gold);
        font-size: 1rem;
        margin: 0;
        text-transform: uppercase;
        letter-spacing: 0.05em;
}

/* =================================
   CART ITEMS LIST
   ================================= */

.shopping-cart--list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.shopping-cart--list-item {
    border: 1px solid var(--color-gray-300);
    margin-bottom: 2rem;
    min-height: 10rem;
    transition: all 0.3s ease;
    background: var(--dark-surface);
}

.shopping-cart--list-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

/* =================================
   GRID LAYOUT
   ================================= */

._grid {
    display: grid;
    gap: 0;
}

.shopping-cart--list-item._grid {
    grid-template-columns: 10rem 1fr 16rem;
    align-items: center;
}

._column {
    padding: 1.5rem;
}

/* =================================
   PRODUCT IMAGE
   ================================= */

.product-image {
        align-items: center;
        justify-content: center;
        padding: 1rem;
        height: 130px;
        width: 130px;
        border: 1px solid rgba(201, 168, 76, .12);
        overflow: hidden;
        flex-shrink: 0;
}

.product-image--img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

.product-image--placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    opacity: 0.3;
}

/* =================================
   PRODUCT INFO
   ================================= */

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    justify-content: center;
}

.product-name {
    font-family: var(--font-d);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: .02em;
    line-height: 1.3;
}

.product-desc {
    font-size: .78rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-single-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gray-700);
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.meta-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-gray-200);
    border-radius: var(--border-radius-lg);
    font-size: 0.75rem;
    color: var(--color-gray-700);
}

/* =================================
   PRODUCT MODIFIERS (Controls)
   ================================= */

.product-modifiers {
    border-left: 1px solid var(--color-gray-300);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background: var(--dark-surface);
}

/* =================================
   QUANTITY CONTROLS
   ================================= */

.quantity-controls._grid {
    grid-template-columns: 2.5rem 3rem 2.5rem;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 1rem;
}

.product-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gray-900);
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--border-radius-sm);
}

._btn {
    background: var(--color-gray-300);
    border: none;
    padding: 0.5em 0.75em;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: var(--border-radius-lg);
    font-family: var(--font-body);
    font-size: 0.875rem;
}

._btn:hover {
    background: var(--color-primary);
    color: var(--color-black);
    transform: translateY(-1px);
}

._btn:active {
    transform: translateY(0);
}

.product-subtract,
.product-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 2.5rem;
    font-size: 1.25rem;
    padding: 0;
}

.product-remove {
    width: 100%;
    margin-bottom: 1rem;
    background: transparent;
    border: 1px solid var(--color-gray-300);
    color: var(--color-gray-700);
}

.product-remove:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: var(--color-white);
}

/* =================================
   ITEM SUBTOTAL
   ================================= */

.product-total-price {
    font-family: var(--font-d);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    white-space: nowrap;
    text-align: right;
}

.price {
    font-family: var(--font-heading);
}

/* =================================
   CART TOTALS FOOTER
   ================================= */

.cart-totals {
    background: var(--dark-surface);
    border: 2px solid var(--gold-dim);
    border-radius: 0px;
    padding: 2rem;
    margin-top: 3rem;
   grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.cart-totals-key {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gray-700);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.cart-totals-value {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-900);
}

.total-section .cart-totals-value {
    font-size: 2rem;
    color: var(--color-primary);
}

.actions-section {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--color-gray-300);
}

.continue-shopping {
    background: transparent;
    border: 2px solid var(--color-gray-300);
    color: var(--color-gray-700);
    padding: 1rem 2rem;
}

.continue-shopping:hover {
    background: var(--color-gray-200);
        color: var(--color-black);
}

.checkout-btn {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
    border: none;
}

.checkout-btn:hover {
    background: var(--gold-dim);
    transform: translateY(-2px);
    color: var(--color-white);
    box-shadow: var(--shadow-lg);
}

/* =================================
   LOADING OVERLAY
   ================================= */

.cart-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.cart-spinner {
    background: var(--color-white);
    padding: 2rem 3rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-gray-200);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.cart-spinner p {
    margin: 0;
    color: var(--color-gray-700);
    font-weight: 600;
}

/* =================================
   NOTIFICATIONS
   ================================= */

.cart-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--color-white);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--color-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 700;
}

.notification-text {
    color: var(--color-gray-900);
    font-weight: 600;
}

.cart-notification.error {
    border-left-color: #ef4444;
}

.cart-notification.error .notification-icon {
    background: #ef4444;
}

/* OpSales Product Embedder Styles */

/* Buttons */
.opsales-button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none !important;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.opsales-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Button Styles */
.opsales-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
}

.opsales-btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #ffffff !important;
}

.opsales-btn-dark {
    background: #333;
    color: #ffffff !important;
}

.opsales-btn-primary:hover { opacity: 0.9; }
.opsales-btn-success:hover { opacity: 0.9; }
.opsales-btn-dark:hover { opacity: 0.9; }

/* Button Sizes */
.opsales-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.opsales-btn-medium {
    padding: 12px 24px;
    font-size: 16px;
}

.opsales-btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.opsales-btn-block {
    display: block;
    width: 100%;
}

/* Product Card */
.opsales-product-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.opsales-product-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

.opsales-product-image {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.opsales-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.opsales-product-card:hover .opsales-product-image img {
    transform: scale(1.05);
}

.opsales-product-image.opsales-no-image {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.opsales-product-content {
    padding: 20px;
}

.opsales-product-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #333;
    line-height: 1.3;
}

.opsales-product-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 15px 0;
}

.opsales-product-price {
    margin: 15px 0;
}

.opsales-price-amount {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.opsales-price-note {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.opsales-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.opsales-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
}

.opsales-badge-success {
    background: #d4edda;
    color: #155724;
}

.opsales-badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.opsales-badge-default {
    background: #f8f9fa;
    color: #6c757d;
}

/* Product Grid */
.opsales-product-grid {
    display: grid;
    gap: 24px;
    margin: 20px 0;
}

.opsales-grid-col-2 { grid-template-columns: repeat(2, 1fr); }
.opsales-grid-col-3 { grid-template-columns: repeat(3, 1fr); }
.opsales-grid-col-4 { grid-template-columns: repeat(4, 1fr); }

/* Responsive */
@media (max-width: 992px) {
    .opsales-grid-col-4,
    .opsales-grid-col-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .opsales-product-grid {
        grid-template-columns: 1fr !important;
    }
    
    .opsales-product-image {
        height: 220px;
    }
    
    .opsales-product-title {
        font-size: 18px;
    }
    
    .opsales-price-amount {
        font-size: 24px;
    }
}

/* Product Actions (Add to Cart + View Details) */
.opsales-product-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.opsales-product-actions .opsales-button {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
}

/* Shopping Cart Styles */
.opsales-cart-wrapper {
        max-width: 1000px;
        margin: 40px auto;
        padding: 44px 48px;
        background: var(--dark-card);
        border-radius: 0px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
        border: 1px solid var(--dark-border);
        margin-bottom: 24px;
    }

.opsales-cart-header h2 {
    margin: 0 0 30px 0;
    font-size: 28px;
    color: #333;
}

.opsales-cart-empty {
    text-align: center;
    padding: 60px 20px;
}

.opsales-cart-empty p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.opsales-cart-items {
    margin-bottom: 30px;
}

.opsales-cart-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
    border: 1px solid rgba(201, 168, 76, .1);
    border-radius: 0px;
    margin-bottom: 15px;
    transition: border-color .2s;
    }

.opsales-cart-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.opsales-cart-item-image {
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 6px;
    background: #f5f5f5;
}

.opsales-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.opsales-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: #999;
    font-size: 12px;
}

.opsales-cart-item-details h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.opsales-cart-item-price {
    color: #666;
    font-size: 14px;
}

.opsales-cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.opsales-qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 0px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    transition: all 0.2s ease;
}

.opsales-qty-btn:hover {
    background: #f8f8f8;
    border-color: #bbb;
}

.opsales-qty-input {
    width: 60px;
    height: 32px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 0px;
    font-size: 14px;
}

.opsales-cart-item-subtotal {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    text-align: right;
}

.opsales-cart-remove {
    border: none;
    background: #f10f0f;
    color: #fff;
    border-radius: 0px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s ease;
}

.opsales-cart-remove:hover {
    background: #b11414;
}

.opsales-cart-footer {
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
}

.opsales-cart-totals {
    margin-bottom: 20px;
}

.opsales-cart-subtotal,
.opsales-cart-tax,
.opsales-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.opsales-cart-subtotal {
    font-size: 16px;
    color: #666;
}

.opsales-cart-tax {
    font-size: 14px;
    color: #888;
}

#cart-tax-note {
    font-style: italic;
    color: #999;
}

.opsales-cart-total {
    font-size: 24px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.opsales-cart-total strong {
    color: #333;
}

.opsales-cart-total .total-amount {
    color: #10b981;
    font-weight: bold;
}

.opsales-cart-total .total-amount {
    color: #28a745;
    font-weight: 700;
}

/* Notifications */
.opsales-notification {
    position: fixed;
    top: -100px;
    right: 20px;
    padding: 16px 24px;
    background: #fff;
    border-radius: 0px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 9999;
    transition: top 0.3s ease;
    min-width: 300px;
    font-size: 14px;
}

.opsales-notification-show {
    top: 20px;
}

.opsales-notification-success {
    border-left: 4px solid #28a745;
}

.opsales-notification-error {
    border-left: 4px solid #dc3545;
}

/* Spinner */
.opsales-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: opsales-spin 0.6s linear infinite;
}

@keyframes opsales-spin {
    to { transform: rotate(360deg); }
}

/* Store Grid Alignment */
.opsales-products-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.store-page .opsales-products-wrapper {
    padding-top: 40px;
}

/* Responsive Cart */
@media (max-width: 768px) {
    .opsales-cart-item {
        grid-template-columns: 80px 1fr;
        gap: 15px;
    }
    
    .opsales-cart-item-image {
        width: 80px;
        height: 80px;
    }
    
    .opsales-cart-item-quantity {
        grid-column: 1 / -1;
        justify-content: center;
    }
    
    .opsales-cart-item-subtotal {
        grid-column: 1 / -1;
        text-align: center;
    }
    
    .opsales-cart-remove {
        position: absolute;
        top: 10px;
        right: 10px;
    }
    
    .opsales-cart-item {
        position: relative;
    }
}

/* ===============================================
   CHECKOUT FORM STYLES
   =============================================== */

.opsales-checkout-wrapper {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 0px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.opsales-checkout-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.opsales-checkout-header h2 {
    margin: 0;
    color: #333;
    font-size: 28px;
    font-weight: 700;
}

.opsales-checkout-form {
    display: block;
}

.opsales-form-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 0px;
    border: 1px solid #e8e8e8;
}

.opsales-form-section h3 {
    margin: 0 0 20px 0;
    color: #444;
    font-size: 20px;
    font-weight: 600;
}

.opsales-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.opsales-form-group {
    margin-bottom: 20px;
}

.opsales-form-group:last-child {
    margin-bottom: 0;
}

.opsales-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 14px;
}

.opsales-form-group input[type="text"],
.opsales-form-group input[type="email"],
.opsales-form-group input[type="tel"],
.opsales-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 0px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #333;
}

.opsales-form-group input:focus,
.opsales-form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.opsales-form-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.opsales-checkout-summary {
    margin: 30px 0;
    padding: 25px;
    background: #f5f8ff;
    border-radius: 0px;
    border: 2px solid #d0deff;
}

.opsales-checkout-summary h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

#checkout-items-summary {
    margin-bottom: 20px;
}

.opsales-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    color: #555;
    font-size: 15px;
}

.opsales-summary-item:last-child {
    border-bottom: none;
}

.opsales-summary-totals {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #d0deff;
}

.opsales-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 16px;
    color: #555;
}

.opsales-summary-total {
    font-size: 20px;
    color: #333;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 2px solid #667eea;
}

.opsales-form-actions {
    margin-top: 30px;
}

.opsales-form-actions .opsales-button {
    margin-bottom: 12px;
}

.opsales-error-message {
    padding: 15px 20px;
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 0px;
    color: #c00;
    margin-top: 20px;
    font-weight: 600;
}

.opsales-loading {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 0px;
    margin-top: 20px;
}

.opsales-spinner {
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.opsales-loading p {
    color: #555;
    font-size: 16px;
    font-weight: 600;
}

.opsales-btn-secondary {
    background: #6c757d;
    color: #ffffff !important;
}

.opsales-btn-secondary:hover {
    opacity: 0.9;
}

/* Responsive adjustments for checkout form */
@media (max-width: 768px) {
    .opsales-checkout-wrapper {
        padding: 15px;
        margin: 20px auto;
    }
    
    .opsales-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .opsales-form-section {
        padding: 20px 15px;
    }
    
    .opsales-checkout-summary {
        padding: 20px 15px;
    }
}


/* ===============================================
   STORE PAGE — Toolbar, Cart Link, Fallback
   =============================================== */

.opsales-store-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto 8px auto;
    padding: 0 20px;
}

.opsales-store-heading {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #333;
}

/* Cart link pill */
.opsales-cart-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #333;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 0px;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
    position: relative;
}

.opsales-cart-link:hover {
    background: #111;
    transform: translateY(-1px);
}

/* Badge — shown/hidden via JS updateCartCount() */
.opsales-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #28a745;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border-radius: 0px;
    border: 2px solid #fff;
}

/* API unavailable fallback */
.opsales-store-unavailable {
    max-width: 600px;
    margin: 60px auto;
    padding: 30px 40px;
    text-align: center;
    background: #fff8e1;
    border: 2px solid #ffe082;
    border-radius: 0px;
    color: #5d4037;
    font-size: 16px;
    line-height: 1.7;
}

.opsales-store-unavailable a {
    color: #667eea;
    font-weight: 600;
}

/* Responsive toolbar */
@media (max-width: 576px) {
    .opsales-store-toolbar {
        flex-direction: column;
        gap: 14px;
        align-items: flex-start;
    }

    .opsales-store-heading {
        font-size: 22px;
    }
}

/* =================================
   RESPONSIVE - MOBILE
   ================================= */

@media (max-width: 768px) {
    .opsales-cart-wrapper {
        padding: 0 1rem;
        margin: 2rem auto;
    }
    
    .cart-title {
        font-size: 2rem;
    }
    
    /* Stack cart items vertically */
    .shopping-cart--list-item._grid {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .product-image,
    .product-info,
    .product-modifiers {
        border: none;
        background: transparent;
    }
    
    .product-image {
        height: 200px;
        border-bottom: 1px solid var(--color-gray-300);
    }
    
    .product-modifiers {
        border-top: 1px solid var(--color-gray-300);
        padding-top: 1.5rem;
    }
    
    .quantity-controls._grid {
        grid-template-columns: 3rem 4rem 3rem;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .product-total-price {
        font-size: 2rem;
    }
    
    /* Stack totals vertically */
    .cart-totals {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cart-totals ._column {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .cart-totals-key {
        margin: 0;
    }
    
    .total-section {
        padding-top: 1rem;
        border-top: 2px solid var(--color-gray-300);
    }
    
    .actions-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .continue-shopping,
    .checkout-btn {
        width: 100%;
        text-align: center;
    }
    
    .cart-notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

/* =================================
   RESPONSIVE - TABLET
   ================================= */

@media (min-width: 769px) and (max-width: 1024px) {
    .shopping-cart--list-item._grid {
        grid-template-columns: 8rem 1fr 14rem;
    }
    
    .cart-totals {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .actions-section {
        grid-column: 1 / -1;
    }
}

/* =================================
   PRINT STYLES
   ================================= */

@media print {
    .product-subtract,
    .product-plus,
    .product-remove,
    .checkout-btn,
    .continue-shopping,
    .cart-notification {
        display: none;
    }
    
    .shopping-cart--list-item {
        break-inside: avoid;
        border: 1px solid #000;
    }
}

/* =================================
   ACCESSIBILITY
   ================================= */

._btn:focus,
.checkout-btn:focus {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

.product-qty[aria-live="polite"] {
    /* Announce quantity changes to screen readers */
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    ._btn,
    .shopping-cart--list-item,
    .cart-notification {
        transition: none;
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .shopping-cart--list-item {
        border-width: 2px;
    }
    
    ._btn {
        border: 2px solid currentColor;
    }
}
