/* 响应式布局和移动端适配样式 */

/* 基础响应式设置 */
html {
    font-size: 16px;
}

@media (max-width: 576px) {
    html {
        font-size: 14px;
    }
}

/* 导航栏响应式调整 */
@media (max-width: 992px) {
    .navbar-nav {
        text-align: center;
    }
    
    .navbar-nav .nav-item {
        margin-bottom: 0.5rem;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

/* 商品卡片响应式调整 */
@media (max-width: 768px) {
    .product-card .card-img-top {
        height: 180px;
    }
    
    .product-title {
        font-size: 0.9rem;
        height: 2rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    .product-original-price {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .product-card .card-img-top {
        height: 160px;
    }
    
    .product-card .card-body {
        padding: 0.75rem;
    }
    
    .product-title {
        font-size: 0.85rem;
        height: 1.8rem;
    }
}

/* 商品详情页响应式调整 */
@media (max-width: 768px) {
    .product-detail-image {
        margin-bottom: 1rem;
    }
    
    .product-detail-gallery img {
        width: 60px;
        height: 60px;
    }
    
    .product-actions .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* 购物车响应式调整 */
@media (max-width: 768px) {
    .cart-item {
        padding: 0.75rem 0;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
    }
    
    .cart-item-info {
        margin-left: 1rem;
    }
    
    .cart-item-title {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .cart-item-price {
        font-size: 0.9rem;
    }
    
    .cart-summary {
        margin-top: 1rem;
        padding: 1rem;
        background-color: #f8f9fa;
        border-radius: 8px;
    }
}

/* 结算页面响应式调整 */
@media (max-width: 768px) {
    .checkout-form .form-group {
        margin-bottom: 1rem;
    }
    
    .checkout-summary {
        margin-top: 1rem;
        padding: 1rem;
        background-color: #f8f9fa;
        border-radius: 8px;
    }
    
    .checkout-actions .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* 用户中心响应式调整 */
@media (max-width: 768px) {
    .user-profile {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .user-avatar {
        width: 80px;
        height: 80px;
        margin: 0 auto 0.5rem;
    }
    
    .user-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    .user-menu .nav-link {
        padding: 0.5rem 1rem;
        margin: 0.25rem;
        border: 1px solid #e9ecef;
        border-radius: 0.25rem;
    }
    
    .user-content {
        margin-top: 1rem;
    }
}

/* 订单列表响应式调整 */
@media (max-width: 768px) {
    .order-item {
        border: 1px solid #e9ecef;
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .order-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #e9ecef;
    }
    
    .order-products {
        margin-bottom: 0.5rem;
    }
    
    .order-product {
        display: flex;
        align-items: center;
        margin-bottom: 0.5rem;
    }
    
    .order-product-image {
        width: 40px;
        height: 40px;
        object-fit: cover;
        border-radius: 4px;
        margin-right: 0.5rem;
    }
    
    .order-product-info {
        flex: 1;
    }
    
    .order-product-title {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .order-product-price {
        font-size: 0.9rem;
    }
    
    .order-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 0.5rem;
        border-top: 1px solid #e9ecef;
    }
    
    .order-total {
        font-weight: bold;
        margin-bottom: 0.5rem;
    }
    
    .order-actions .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* 管理端响应式调整 */
@media (max-width: 992px) {
    .admin-sidebar {
        position: static;
        height: auto;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        margin-bottom: 1rem;
    }
    
    .admin-sidebar .nav {
        display: flex;
        flex-wrap: wrap;
    }
    
    .admin-sidebar .nav-link {
        padding: 0.5rem 1rem;
        margin: 0.25rem;
        border: 1px solid #e9ecef;
        border-radius: 0.25rem;
    }
    
    .admin-content {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .admin-header {
        padding: 0.75rem 0;
    }
    
    .admin-header h1 {
        font-size: 1.5rem;
    }
    
    .admin-card {
        margin-bottom: 1rem;
    }
    
    .admin-card .card-header {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .admin-card .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        border: none;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .btn-group {
        display: flex;
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        margin: 0.25rem;
    }
}

/* 表单响应式调整 */
@media (max-width: 768px) {
    .form-row {
        margin-bottom: 0;
    }
    
    .form-row .col,
    .form-row .col-sm-6,
    .form-row .col-md-4,
    .form-row .col-lg-3 {
        margin-bottom: 1rem;
    }
    
    .form-control {
        font-size: 0.9rem;
    }
    
    .form-check {
        margin-bottom: 0.5rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
}

/* 模态框响应式调整 */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .modal-footer .btn:last-child {
        margin-bottom: 0;
    }
}

/* 分页响应式调整 */
@media (max-width: 576px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination .page-item {
        margin: 0.25rem;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* 提示框响应式调整 */
@media (max-width: 576px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        margin-bottom: 0.5rem;
    }
}

/* 图片响应式调整 */
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* 工具类 */
.d-block-mobile {
    display: none;
}

.d-none-mobile {
    display: block;
}

@media (max-width: 768px) {
    .d-block-mobile {
        display: block;
    }
    
    .d-none-mobile {
        display: none;
    }
}

/* 文本响应式调整 */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center;
    }
    
    .text-left-mobile {
        text-align: left;
    }
    
    .text-right-mobile {
        text-align: right;
    }
}

/* 间距响应式调整 */
@media (max-width: 768px) {
    .mb-1-mobile {
        margin-bottom: 0.25rem;
    }
    
    .mb-2-mobile {
        margin-bottom: 0.5rem;
    }
    
    .mb-3-mobile {
        margin-bottom: 1rem;
    }
    
    .mb-4-mobile {
        margin-bottom: 1.5rem;
    }
    
    .mb-5-mobile {
        margin-bottom: 3rem;
    }
    
    .mt-1-mobile {
        margin-top: 0.25rem;
    }
    
    .mt-2-mobile {
        margin-top: 0.5rem;
    }
    
    .mt-3-mobile {
        margin-top: 1rem;
    }
    
    .mt-4-mobile {
        margin-top: 1.5rem;
    }
    
    .mt-5-mobile {
        margin-top: 3rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) {
    .product-card:hover {
        transform: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .btn:hover {
        transform: none;
    }
    
    .nav-link:hover {
        background-color: transparent;
        color: inherit;
    }
}

/* 横屏优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .product-card .card-img-top {
        height: 120px;
    }
    
    .navbar {
        padding: 0.25rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
}